Magento: Crop image

Here is a quick tip to crop image to any degree of your choice in Magento. The crop function of Varien_Image does the magic :) Here goes the code: $mainImage = Mage::getBaseDir('media') . DS . 'test' . DS . 'image.jpg'; $image = new Varien_Image($mainImage); // crop image // crop($top=0, $left=0, $right=0, $bottom=0) $image->crop(10, 10, 10, … Read more