Answer the question
In order to leave comments, you need to log in
How to reduce thousands of pictures in all subfolders?
There is a site on WordPress and there are a bunch of pictures that I would like to shrink in quality up to 60-70%. Yes, it can be size.
They lie in a subfolder for months and years. I have a Linux PC and a MacBook Pro at my disposal, that is, all the power of the consoles is at my service.
How and what is the best way to "sort through" all the folders and compress everything in them? I can only pinch everything in one folder.
Answer the question
In order to leave comments, you need to log in
We need mogrify
packages ,
everything will happen in place - files are replaced
starting from the current folder and further in depth
if there is no height (width), then we change proportionally the
maximum number of passes over the image, very effective for running cases, very, very long
a couple of minutes for a file 1500x1500
just a long time
# the code is provided as is
# why optipng is drop dead
# for other types of images we change find and look for what software will optimize them
. You can also convert images to png-jpg, but often this somehow needs to be synchronized with the database, and there is no easy way
yum install jpegoptim
or
, well, the process itself
find /home/bitrix/ext_www/shop.wildorchid.ru/-type f -regex ".*\(jpg\|jpeg\|JPG\|Jpeg\)" -exec jpegoptim -t --max=85 {} \;
How and what is the best way to "sort through" all the folders and compress everything in them? I can only pinch everything in one folder.
Maybe don't compress anything and use Nginx Image Filter Module ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question