Optimize product images before uploading?
-
12-12-2019 - |
Question
I'm using the Magento Store in version 1.7.0.2. I have a question about the product images. Is it necessary to optimize the product images before uploading or does optimize Magento the corresponding image sizes depending on the application screen size automatically?
Solution
Hello Image optimization you Magento Provide the good functionality for resize()
image so you can use that as per your requirement on when you want to use the Product Images.
<?php
$img=Mage::helper('catalog/image')->init($_product, 'small_image')->keepFrame(true)->resize( $imgSizeWidth, $imgSizeHeight );
?>
Hear
small_image
has two more property like image
& thumbnail
keepFrame(true)
means it will remove the white background when Image is crop.
resize(width,height)
means specify height & width.
For product Listing page refer the catalog/product/list.phtml
file.
For Detail Page refer catalog/product/view/media.phtml
file in your Theme folder.
Hope you got proper answer.