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 Answer 1

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); ?> 
8
  • Which page you want to need resize image? Commented Jun 27, 2017 at 7:34
  • in Product view page, you can see in link with same height and width & in link2 with different height and width..... Commented Jun 27, 2017 at 7:38
  • In which file you have put this code? Commented Jun 27, 2017 at 7:40
  • in view.phtml file..... Commented Jun 27, 2017 at 7:40
  • You need to write your code in app/design/frontend/YourTheme/ThemePackdge/template/catalog/product/view/media.phtml Commented Jun 27, 2017 at 7:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.