Hi!
My site has a lot of large images and to improve site performance I compress them manually, I use on_after_post hook that takes path to the image and with help of the native php function does what I need:
ImageJPEG (ImageCreateFromString(file_get_contents($img)), $img, $quality);
But this method not fits anymore, give me an advice how to make compression automatic for all downloadable images?
Comments
I'll try to figure out.
in file fuel/modules/fuel/libraries/Fuel_assets.php on line 390 (before return TRUE) added a condition:
// IF is JPEG if (exif_imagetype($file['full_path']) == IMAGETYPE_JPEG) { ImageJPEG(ImageCreateFromString(file_get_contents($file['full_path'])), $file['full_path'], 85); }
Now all JPEG's compressed and have less weight.
Thanks for the help!