I am using Magento 1.9 and the RWD theme. My product images are rectangle, being taller than they are wide, however Magento shows them as square. How do I change this?
My largest image size is 1000x600 (Height x Width)
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityLooking at Mage_Catalog_Helper_Image->resize
/**
* Schedule resize of the image
* $width *or* $height can be null - in this case, lacking dimension will be calculated.
*
* @see Mage_Catalog_Model_Product_Image
* @param int $width
* @param int $height
* @return Mage_Catalog_Helper_Image
*/
public function resize($width, $height = null)
{
$this->_getModel()->setWidth($width)->setHeight($height);
$this->_scheduleResize = true;
return $this;
}
So resize by ->keepFrame(true)->resize(null, 300)
->keepFrame(true)
before calling resize. Than the width is automatically calculated