Home » Magento23 March 2010

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:

Code Explanation

In the code above, you can see that I have an image named image.jpg inside media/test/ directory.

At first, I have cropped the image by 10px from top, left, bottom, and right side.
The new cropped image is saved inside media/test/ directory as new.jpg.

Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed