0

I am trying below code to resize height and width of image. If i give resize(350 ,250) instead of resizing , its displaying image 350px away from left and 250px away from top from its original position.

If i give same value for both height and width [ resize(250 ,250) ] , than only resize will work properly.

<?php $imageUrl = Mage::helper('catalog/image')->init($_product, 'image')->resize(250 ,250)->setQuality(100); ?>

Update

Issue is if we resize the Image with Different height & Width , than its adding background image to Product image.

1) resize(150 ,750) Image with differnet height and width: link

2) resize(750, 750) Image with same height and width: link2

1

You can resize image Height or Width by use below code

<?php $imageUrl = Mage::helper('catalog/image')->init($_product, 'image')->keepFrame(true)->resize(350 ,250)->setQuality(100); ?>
  • thanks, but still its giving me same result...... – Baby in Magento Jun 27 '17 at 7:33
  • Which page you want to need resize image? – Suresh Chikani Jun 27 '17 at 7:34
  • in Product view page, you can see in link with same height and width & in link2 with different height and width..... – Baby in Magento Jun 27 '17 at 7:38
  • In which file you have put this code? – Suresh Chikani Jun 27 '17 at 7:40
  • in view.phtml file..... – Baby in Magento Jun 27 '17 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.