Page 1 of 1
compress images already uploaded to the website
Posted: Wed Jun 07, 2023 7:26 pm
by Afrofunk
We have over 1000 images on our website that are JPG and PNG and over a 100kb, we want to compress these images somehow, Manually will be a long process. Is there another way of doing this? cant find an extension for this purpose? any ideas?. using OC 2.3.0.2
Re: compress images already uploaded to the website
Posted: Wed Jun 07, 2023 10:14 pm
by paulfeakins
Afrofunk wrote: ↑Wed Jun 07, 2023 7:26 pm
We have over 1000 images on our website that are JPG and PNG and over a 100kb, we want to compress these images somehow, Manually will be a long process. Is there another way of doing this? cant find an extension for this purpose? any ideas?. using OC 2.3.0.2
We have code that does this to WebP, but it's not an extension because it's very dependent on the web server software. Feel free to get in touch if you'd like an estimate for applying it to your site:
info@antropy.co.uk
Re: compress images already uploaded to the website
Posted: Thu Jun 08, 2023 12:56 am
by JNeuhoff
Do a Google search for "batch image compress", there are a number of tools which allow you to compress whole batches of images in one go.
Re: compress images already uploaded to the website
Posted: Thu Jun 08, 2023 4:50 am
by halfhope
HI!
You can use server software (jpegoptim/optipng/etc) via SSH. Like this:
Code: Select all
find /var/www -name "*.jpg" -type f -exec jpegoptim {} \;
Code: Select all
find /var/www -name "*.png" -type f -exec optipng {} \;
Re: compress images already uploaded to the website
Posted: Thu Jun 08, 2023 6:58 pm
by SohBH
system\library\image.php
Code: Select all
public function save($file, $quality = 70)
Reupload image/catalog folder for new cache