Example #1
0
 public function perform(Zend_Image_Adapter_ImageMagick $adapter, Zend_Image_Action_Rotate $rotate)
 {
     $handle = $adapter->getHandle();
     $angle = $rotate->getAngle();
     $background = new ImagickPixel($rotate->getBackgroundColor(true));
     $handle->rotateImage($background, $angle);
     return $handle;
 }
Example #2
0
 public function perform(Zend_Image_Adapter_Gd $adapter, Zend_Image_Action_Rotate $rotate)
 {
     $handle = $adapter->getHandle();
     // By default GD turns 'the wrong way
     $angle = 360 - $rotate->getAngle();
     $color = $rotate->getBackgroundColor()->getRgb();
     $colorRes = imagecolorallocate($handle, $color['red'], $color['green'], $color['blue']);
     return imagerotate($handle, $angle, $colorRes);
 }