Thumbnails in Magento Commerce, variable height?

Vendors don't always have their photos in the same format..

When I upload a photo that's 135px width , but not 135px height, for example lets say it's 135px wide by 110px high, magento will actually fill in the other 25px of vertical space with white.. The actual picture will have a new size of 135px by 135px after the image is imported.

Is this a setting I can change? Is there a downside to messing with this feature?

I wanted to have a nice looking background, but it looks really cheezy when my pictures have filler space.

I'm am importing the pictures via a csv file.

Who is Participating?
miked2004Connect With a Mentor Commented:
Magento will take the images you upload and resize them according to information in you template files.
If you images are not square just adjust the code in the template file to resize how you would like it. The code snippet attached is from /app/design/frontend/default/default/template/catalog/product/list.phtml.

If you change "resize(135, 135)" to what ever you want your images to be, when Magento creates its image cache it will create what ever size you enter here.

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="100" height="100" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />

Open in new window

You can have a PHP script to use ImageMagik to resize all images to size you want. You can do that as soon as people upload or you can write a PHP script which you can give a PHP directory as a parameter and it will convert all images in that folder to size you need. You need to send these type of questions in PHP section.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.