2

How to allow AUTO height in resize function?

Mage::helper('catalog/image')->init($product, 'image')->resize();
1

Use:

Mage::helper('catalog/image')->init($product, 'image')->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize(600,null);

Using this width will be 600px and the height will auto adjust to aspect ratio.

Please up-vote and mark as answer if helpful. Thanks

  • Could you please mark this answer as accepted, if it helped.? Thanks – Muhammad Mannan Masood Dec 26 '18 at 15:41
0

Try & check:

Mage::helper('catalog/image')->init($product, 'image')->resize(600,null);

600 = Your image width & null is height

  • 1
    I tired, But no any effect. – Ravi Soni Jun 9 '17 at 11:13

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.