C
C
Cider Cherenkov2018-10-26 01:33:01
PHP
Cider Cherenkov, 2018-10-26 01:33:01

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

4 answer(s)
Z
zorca, 2018-10-26
@appendicit

https://murze.be/easily-optimize-images-using-php-...

X
xmoonlight, 2018-10-26
@xmoonlight

Image Magick

D
dollar, 2018-10-26
@dollar

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.

D
Damir, 2018-11-22
@ddem


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 question

Ask a Question

731 491 924 answers to any question