Compress Uploaded Images Using ImageMagic or PHP GD (Admin Choice)

frm

Well-known member
My suggestion is to use ImageMagic or PHP GD, whichever is selected by the admin, to compress images to their choice (say 40% to 80%) as well as resize them to a maximum width (which will obviously resize their height to keep the same ratio too).

This will save some people enormous disk space and could also run retroactively for older photos uploaded (possibly on the cron).

In order to not be a resource hog, it would also queue up all photos as well as run a cron job to process X images not compressed every X minutes/hours (with admin able to execute it, like all other cron jobs, at non-peak hours to get ahead on compressing). This is so that someone couldn't upload 100 images and all resources would fly over to ImageMagic/GD to compress and resize. Rather, they'd upload at 100% and slowly, but surely, all compress.

Using this method wouldn't rely on a 3rd party API (such as Smush It) which could change at a moment's notice, keeping XF on their feet to maintain API calls, and be easier to maintain going forward with the development of XF.
 
Upvote 30
@Chris D / @Jeremy P - Shouldn't this thread be updated as implemented if there's $config['maxImageResizeQuality'] = 70; in 2.3?

I suggested making the quality compression an admin's choice (to include 100% for no compression).

Seems like an oversight to not have closed this thread out / included it in the documentation.
 
yeah my post is before that config setting was revealed after 2.3 release by a developer on these forums. this appears to be the first mention of this on the forum.

So I guess this should be "implemented" or moved out of suggestions, or however they want to handle it, as it was addressed in 2.3, but by bug report when it was already confirmed it was hard coded in this suggestion.

Just found it odd that someone found this thread and tagged me back in to find out it was implemented (I had known, but never changed it as I'm using webp and completely forgot about this suggestion).
 
Back
Top Bottom