/**
* Crops a given image according to given parameters.
*
* @param ImageInterface $image The image to crop
* @param array $cropParameters The parameters which define the area to crop
*
* @return ImageInterface The cropped image
*/
private function applyFormatCrop(ImageInterface $image, array $cropParameters)
{
return $this->modifyAllLayers($image, function (ImageInterface $layer) use($cropParameters) {
return $this->cropper->crop($layer, $cropParameters['x'], $cropParameters['y'], $cropParameters['width'], $cropParameters['height']);
});
}