compress uploaded images in magento
Is it possible to compress the original product image on upload in magento? Magento saves the original uploaded i开发者_C百科mage in full size. The store admin have 3MB images and 20K products. I want to automatically resize the images to ~150K.
Thanks
Magento automatically re-compresses product images before displaying them on the frontend.
Due to the nature of compression techniques you cannot easily target a specific file size as it depends a lot on the amount of detail in a picture. A plain "large" (wide and tall) image can result in a smaller file than a complex "small" (narrow and short) image. First check the file sizes being served to customers and then decide if it's worth pursuing.
If you really have to do the resizing through the admin, you might be able to tie into the event observer for the product save and write a script to reduce the size of the original image.
It may be fastest to use Photoshop or some related to resize the images to the largest useful size for the store. This should be a relatively small JPG, and will largely obviate the issue. As a side benefit, uploading new images will be many times faster.
精彩评论