I’m trying to upload a wide screen image as a product image in my shop. The image is really big (800x600) and I’m trying to display it in the format 250x400.
So I modified the media.phtml in my template to the following:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'image')->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(TRUE)->resize(250, 400);?>" alt='' title="<?php echo $this->htmlEscape($this->getImageLabel());?>" />
The problem here is: When I set keepAspectRatio to true, the image gets not distorted, but there is a white border at the top and bottom (so that it actually gets 400 pixels heigh). When I set keepAspectRatio to false, the image gets distorted, but it is 400px heigh.
But I want to achieve, that magento zooms the picture in, so that it gets not distorted, but it gets the required height and width. I found an excention that seems to do that (http://www.magentocommerce.com/magento-connect/alphanono/extension/153/direct-resize), but I tried that and it seems like that this extension does not work with magento 1.7. correctly.
How can I achieve that now?