Answer the question
In order to leave comments, you need to log in
Bulk optimization of images on the server, how?
Hello.
Such a question, is there any PHP script or a server-side solution for mass image optimization, similar to, for example, software on windows: https://github.com/lorents17/iCatalyst ?
The problem is that there are more than 100,000 images on the site (online store), all photos need to be optimized.
Answer the question
In order to leave comments, you need to log in
You can download all the images, optimize them, and upload them back with a replacement.
There is also a GD library for PHP, but I'm not sure if it can optimize. The compression level can be specified when saving the maximum, for example. But there are hardly any tricky ways to compress all the way.
If rooted, install the following packages and run find
at the root of the site . -type f -name "*.jpg" -exec jpegoptim --strip-all --max=80 {} \;
find. -type f -name "*.jpeg" -exec jpegoptim --strip-all --max=80 {} \;
find. -type f -name "*.jpg" -exec jpegtran -copy none -optimize -outfile {} {} \;
find. -type f -name "*.jpeg" -exec jpegtran -copy none -optimize -outfile {} {} \;
find. -type f -name "*.png" -exec optipng -o7 {} \;
find. -type f -name "*.png" -exec pngout {} \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question