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

How do I change the default size for base product images? 
 
David Edwards
Jr. Member
 
Total Posts:  3
Joined:  2008-07-03
 

I think I’m referering to ‘base’ images here. In the product view template, they are rendered like this:

<class="main-product-img">
    <
img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
</
p>

Which produces HTML like this:

<img src="http://domain.com/media/catalog/product/cache/1/image//265x/placeholder/default/file.jpg">

So all base images are resized to 265 pixels wide. How do I change this value?

 
Magento Community Magento Community
Magento Community
Magento Community
 
David Edwards
Jr. Member
 
Total Posts:  3
Joined:  2008-07-03
 

After digging around in the code, I found the bit I wanted was only a few lines down from the snippet I posted above:

<img id="image" src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(265); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

Change the parameter passed to resize() and it changes the size of your base images in the product view.

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