public function perform(Zend_Image_Adapter_ImageMagick $adapter, Zend_Image_Action_Crop $crop) { $handle = $adapter->getHandle(); $x = $crop->getX(); $y = $crop->getY(); $width = $crop->getWidth(); $height = $crop->getHeight(); $handle->cropImage($width, $height, $x, $y); }
public function perform(Zend_Image_Adapter_Gd $adapter, Zend_Image_Action_Crop $crop) { $handle = $adapter->getHandle(); $targetWidth = $crop->getWidth(); $targetHeight = $crop->getHeight(); $im = imagecreatetruecolor($targetWidth, $targetHeight); imagecopy($im, $adapter->getHandle(), 0, 0, $crop->getX(), $crop->getY(), $targetWidth, $targetHeight); return $im; }