Helpful image library functions in magento

By

September 17, 2012MagentoNo comments

Magento Wraps PHP Image Library Functions in its library with its own wrapper functions. Magento Provides the general adapter for image manipulation. This gives us the flexibility to use any PHP libraries like GD2, imagemagik etc.

Some of the common wrapper functions are

  1. crop
  2. resize
  3. rotate

You can make use of these functions in your custom code. To Utilise these functions we need to create an object of type Varien_Image with image name along with the path.
Crop:
To Crop a Particular Image call the crop function with top,left,right,bottom coordinates

Rotate:

Example Code Snippet:

Leave a Reply