mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6393 from webbuilders-group/imagick-crop-function
NEW: Added ImagickBackend::crop() for compatibility with GDBackend
This commit is contained in:
commit
149d260be6
@ -265,6 +265,21 @@ class ImagickBackend extends Imagick implements Image_Backend {
|
||||
$new->ThumbnailImage($width,$height,true);
|
||||
return $new;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crop's part of image.
|
||||
* @param int $top y position of left upper corner of crop rectangle
|
||||
* @param int $left x position of left upper corner of crop rectangle
|
||||
* @param int $width rectangle width
|
||||
* @param int $height rectangle height
|
||||
* @return Image_Backend
|
||||
*/
|
||||
public function crop($top, $left, $width, $height) {
|
||||
$new = clone $this;
|
||||
$new->cropImage($width, $height, $left, $top);
|
||||
|
||||
return $new;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Image $frontend
|
||||
|
Loading…
Reference in New Issue
Block a user