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?
1 Answer
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.
-
Hello Keyul,thanks for your quick answer! But I don't know how to handle this php-code. In what file I have to write this code? Do you have an example? Sep 4, 2014 at 14:06
-
-
Oh thanks a lot!;) And one more thing: it is harmful at all to the loading time of the Magento Stores, when I add an image file with a big size of 4MB? Sep 4, 2014 at 14:35
-
when you use resize() function then Image automatic Comperes so don't worry Sep 4, 2014 at 16:14
-