I am using these two functions to get two different sizes of the same image (thumbnail and normal):

$thumb = Mage::helper('catalog/image')->init($_product, 'image', $image->getFile())->resize(100, 100);
$big = Mage::helper('catalog/image')->init($_product, 'image', $image->getFile());

But, when I want to call $thumb with an echo, it shows the $big value. If I turn $thumb and $big around, it does show the $thumb value, but not the $big value.

How do I sove this?

2 Answers 2


Pretty sure you need to turn those into strings in order to be able to use them properly because the helper returns itself by default:

$thumb = (string)Mage::helper('catalog/image')->init($_product, 'image', $image->getFile())->resize(100, 100);
$big = (string)Mage::helper('catalog/image')->init($_product, 'image', $image->getFile());

I tried the below code it helped me might help you

$_product = Mage::getModel('catalog/product')->load(1);
echo $thumb = Mage::helper('catalog/image')->init($_product, 'image')->resize(100, 100);
echo $big = Mage::helper('catalog/image')->init($_product, 'thumbnail');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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