Extension Description: Automatically resize (shrink) image attachments server-side upon upload.
Extension Version: 1.0.3
Requirements: Requires ImageMagick.
Extension Download: https://github.com/ftc2/phpbb-autoresiz ... -1.0.3.zip
# Auto-Resize Images Server-side
Copy the extension to phpBB/ext/ftc2/autoresize
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:
"ACP" > "General" > "Board configuration" > "Attachment settings":
- set `Maximum file size` to a large value (or 0)
- set `Maximum image dimensions` to 0
- increase `post_max_size`
- increase `upload_max_filesize`
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 `core.modify_uploaded_file` PHP event.
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 dimensions` in "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 (Lanczos filter) 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 -resize parameters:
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.
This extension also includes a feature to log debug messages to a text file.