Extension Description: Automatically resize (shrink) image attachments server-side upon upload.
Extension Version: 1.0.5
Requirements: Requires ImageMagick and the PHP
exec()function to call it.
Extension Download: https://github.com/ftc2/phpbb-autoresiz ... -1.0.5.zip
Auto-Resize Images Server-side
Requires ImageMagick and the PHP exec() function to call it.
Copy the extension to
Go to "ACP" > "Customise" > "Extensions" and enable the "Auto-Resize Images Server-side" extension.
You may need to tweak the following settings to allow uploading larger files or enable
"ACP" > "General" > "Board configuration" > "Attachment settings":
Maximum file sizeto a large value (or 0)
Maximum image dimensionsto 0
php.inifor the PHP installation used by your web server (look at your
phpinfo()page or go to "ACP" > "System" > "General Tasks" > "PHP information"):
- look at
execif it's there
HTTP errorerror popup when uploading large files, look in your browser's console.
If you see plupload triggering
413 (Request Entity Too Large), then try configuring your web server to allow a larger client request body.
Automatically resize (shrink) image attachments server-side upon upload.
Hooks to the
Note that phpBB supports client-side image resizing via plupload, a feature that should be better advertised...
You can use this feature by specifying
Maximum image dimensionsin "ACP" > "General" > "Board configuration" > "Attachment settings".
However, the output quality is not that good, especially over large dimensional changes.
Resizing server-side with ImageMagick produces significantly better results (and smaller filesize in my testing) due to superior resize algorithm at the expense of server load.
If image quality is important to you and your server can handle it, or if you don't have people constantly uploading files, then this might be an attractive solution.
phpBB built-in resizing (plupload):
ImageMagick resizing with this extension with default
The second image has a slightly smaller filesize.
From the ACP, you can trigger resizing based on uploads exceeding max filesize, max dimensions (width,height), or either one.
Regardless of how resizing is triggered, the image will be shrunk to not exceed specified max dimensions. Shrunk image is not *guaranteed* to be smaller than the max filesize.
You may specify ImageMagick parameters if you wish as well.
You must specify the path to ImageMagick. The
mogrifybinary must be available there.
This extension also includes a feature to log debug messages to a text file.
- fixed deprecated license string
- brings support for phpBB v3.2.4 and above. Tested with phpBB v3.2.7.
-auto-orientto the default ImageMagick parameters to fix rotation issues on some uploaded images