mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 21:29:23 +02:00
NEW: Added ImagickBackend::crop() for compatibility with GDBackend
This commit is contained in:
parent
013e6bd636
commit
52cad6ce99
@ -266,6 +266,21 @@ class ImagickBackend extends Imagick implements Image_Backend {
|
|||||||
return $new;
|
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
|
* @param Image $frontend
|
||||||
* @return void
|
* @return void
|
||||||
|
Loading…
Reference in New Issue
Block a user