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 resizing in Magento ver. 0.8.17240
 
jmayer
Jr. Member
 
Total Posts:  21
Joined:  2007-09-03
 

Hello,

The new image resizing function is great. I would like to customize the size of the images. How would I set the resize for the small image on the catalog page? I would like to ensure that any new images uploaded would be converted this new size.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_w
Sr. Member
 
Total Posts:  290
Joined:  2008-01-04
 

I haven’t really looked into the resize function in any great detail, and I don’t think that there’s an admin setting for defining the size for the resize. If you look in your_theme/template/catalog/product/list.phtml you should find two instances of

<img src="<?=$this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135);?>" width="135" height="135" alt="<?=$this->htmlEscape($_product->getName())?>"/>
. What’s in resize( ) sets the size of the image resize and then change the width and height to correspond to whatever values you put in the parentheses. Hope that helps.

Dan

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_w
Sr. Member
 
Total Posts:  290
Joined:  2008-01-04
 

Oh, by the way, I’m not sure if I understood what you meant by catalog. If you’re talking about the product listing view for a category, the above will work. If you are talking about the actual product view page, then all of the image source and gallery source has been moved to /template/catalog/product/view/media.phtml. Here you can use the function to resize your main product image, or change the height and width of the gallery view resized images.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jmayer
Jr. Member
 
Total Posts:  21
Joined:  2007-09-03
 

Dan,

You got it right the first time. I made the change as you suggested. It does it exactly what I wanted now.

Thanks a bunch

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark Robinson
Member
 
Total Posts:  40
Joined:  2008-04-08
 

Am I right in thinking this resize function doesn’t scale proportionally? Is there a way to scale proportionally?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
dan_w
Sr. Member
 
Total Posts:  290
Joined:  2008-01-04
 

Hi Mark,
The image function does not scale proportionately out-of-the-box. Check out this thread:
http://www.magentocommerce.com/boards/viewthread/5502/

I can confirm that the solution offered here works perfectly on our installation of v1.0

Dan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark Robinson
Member
 
Total Posts:  40
Joined:  2008-04-08
 

Many thanks dan

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