I've noticed on our Magento 1.9.3.1 store that when Magento puts product images into cache it's actually making them bigger. I'm not sure where to start debugging this or if there is a fix for it?
To give you an example I uploaded a image which was compressed to 92kb with PhotoShops Save for Web feature. However when I checked the frontend of the website I found that it had increased to 209kb.
The larger version of the file is coming from the Magento cache for product images, it's file path is:
media/catalog/product/cache/9/thumbnail/c96a280f94e22e3ee3823dd0a1a87606/i/m/img_4901-3v2.jpg
The original file still has the 92kb file size and is located in:
media/catalog/product/i/m/img_4901-3v2.jpg
Why & How could Magento be making the file bigger? Also why is it putting the cahed image in a thumbnail
directory, all the cached versions of this image are being put in the thumbnail directory, i.e.
media/catalog/product/cache/9/thumbnail/200x/1ac472b2e3bed24f4b7f75082897d970/i/m/img_4901-3v3.jpg
media/catalog/product/cache/9/thumbnail/535x/1ac472b2e3bed24f4b7f75082897d970/i/m/img_4901-3v3.jpg
Where in the code does Magento process images for the cache?
I've looked in lib/tcpdf/tcpdf.php at $img->setCompressionQuality($this->jpeg_quality);
. I've also checked template/catalog/product/view/media.phtml but couldn't find anything.