Product Thumbnail sizes in Magento

Since I’ve just moved all X-Cart product data over and the thumbnails were 150×150 Magento was upscaling the images and distorting them in the product listing pages.  I searched all over the admin area thinking surely this was a variable that could be set.  Well after searching to no availability, I started searching around and found that it is a hard set value in the template files themselves. For example:

/app/design/frontend/yourview/yourtemplate/template/catalog/product/list.phtml
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(150, 150); ?>" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>

You’ll notice a call to the helper resize(width, height), that by default is set to 170×170 I believe. 

The only reason I can attribute to Magento not putting a width and height variable inside of the admin area is to allow template designers the ability to size the product thumbnails as they see fit for their designs. However, perhaps there should be a default value set in the admin for all product thumbnails and an override that can be called in the templates to change them if a template calls for a particular size that isn’t defaulted. However looking at the helper in /app/code/core/Mage/Catalog/Helper/Image.php you’ll notice if you can just call resize() without a width or height, and it appears it will determine the best dimensions to calculate. If you look at bit closer at the Model controlling the Image helper at: /app/code/core/Mage/Catalog/Model/Product/Image.php: setSize();

    /**
     * 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;
    }

arrow Magento – thumbnail size of “New Products” – ‘How do I’ Questions – eCommerce Software for Growth.