I am using magento-1.9.2 version, now I posted different size images (400 x 400)and (750 x 750) like that. How can I show these images in same size in frontend?
2 Answers
As per my understanding you want to show fixed height to both these images. If that is the case try this piece of code, for 400 height
:-
<?php echo $this->helper('catalog/image')->init($_product, 'image')
->constrainOnly(TRUE)
->keepAspectRatio(TRUE)
->keepFrame(FALSE)
->resize(null,400)
?>
<?php
$products = Mage::getModel('catalog/product')->load(1); //Product ID
echo "<pre>";
//print_r($products);
echo $products->getImage();
echo "<br>";
echo $products->getSmallImage();
echo "<br>";
echo $products->getThumbnail();
echo "<br>";
echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(163,100); // resize function is used to resize image
echo "<br>";
echo Mage::helper('catalog/image')->init($products, 'image')->resize(400,400);
?>