Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Image placeholder selecting and resizing doesn’t work
 
Danker
Jr. Member
 
Total Posts:  29
Joined:  2008-05-17
 

I have this line from modern theme template:

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(170, 170); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
All normal images resizing is ok, but the placeholders are very small (50x50).

The first problem starts as the thumbnail.jpg is always chosen for placeholder instead of small_image.jpg though init($_product, ‘small_image’) defines to take it.

The second one is that placeholder isn’t resized to 170x170. It seems that resize function is being just ignored.

How should I make placeholders to behave in the way they should?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danker
Jr. Member
 
Total Posts:  29
Joined:  2008-05-17
 

Any ideas how to solve this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danker
Jr. Member
 
Total Posts:  29
Joined:  2008-05-17
 

All this stuff works well on default theme.... Maybe there are some xml options?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonaf
Jr. Member
 
Total Posts:  8
Joined:  2011-09-15
 

The easy cop-out is to just put a width/height attribute on your IMG tag in the HTML. It’s not ideal, but it’s less CPU expense, and you probably aren’t going to lose any quality, since the image will be scaled-up either way.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top