diff --git a/code/FPImagickBackend.php b/code/FPImagickBackend.php index 863346c..856a1be 100644 --- a/code/FPImagickBackend.php +++ b/code/FPImagickBackend.php @@ -1,18 +1,20 @@ cropImage($width, $height, $left, $top); - - return $new; +if(class_exists('Imagick')) { + class FPImagickBackend extends ImagickBackend { + /** + * Crop's part of image. + * @param top y position of left upper corner of crop rectangle + * @param left x position of left upper corner of crop rectangle + * @param width rectangle width + * @param height rectangle height + * @return ImagickBackend + */ + public function crop($top, $left, $width, $height) { + $new = clone $this; + $new->cropImage($width, $height, $left, $top); + + return $new; + } } } -?> \ No newline at end of file +?>