Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

[community.invisionpower.com - pliki] (RedEnzian) Resize Uploaded Images 1.0.0


NewsBot

Rekomendowane odpowiedzi

This hook trys to safe diskspace on your servers harddisk by resizing uploaded images before they get saved.

You can set the max. allowed file dimension for uploaded images (e.g. 1024x768). If the uploaded image exceeds this dimensions it will be resized and resampled.

The second option is a filesize check. If the uploaded image is smaller then the set dimensions, but the filesize is bigger than allowed, it will be resampled to save diskspace.

The following settings will be added to your settings interface after installation:

  • Enable or disable the hook
  • Resize to width x height (this is also the size the file will checked against)
  • Maximum filesize in KB
  • Imagequality for jpeg, png and gif (to compress the image after resizing)

If you only use the traditional uploader, no further steps must be done after installing the hook.

If you want to use the Flash Uploader, you have to edit on template bit:

Goto ACP->Look & Feel->YOUR SKIN->Post Screen->uploadForm

and search for

'file_size_limit': "{$stats['max_single_upload']}" } )});

replace {$stats['max_single_upload']} with 0.

This is because the flash uploader checks the filesize befor it really uploads to the server.

Known Issues:

The Flash Uploader displayes the original uploaded Filesize instead of the resized filesize.

Demo notes:

The Demo has the following settings applied (512kb max upload filesize and resize to 800x600 pixels).

Simple upload an image greater than 512KB

Oh, and one last thing:

When the resized image is still bigger then the allowed size (per Post Member settings, etc.) there will still be an error ;). This hook trys just to prevent the storage of unchanged 10 Megapixel camera images :a:.

This is a Hook from the Free Mod a Week List:

This Plugin has been created because you have voted for it in the Mod a week Request thread ( http://community.inv...-reboot-thread/ ). Keep up giving us developers ideas for modification and help us to improve existing ones by reporting problems :P.

Changelog:

1.0.0: Initial Version

This hook is FREE to use however Donations are greatly appreciated!

https://www.paypal.com/en_US/AT/i/btn/btn_donateCC_LG.gif

Pobierz plik

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.