private function _cropWithPath($path, $x1, $x2, $y1, $y2)
{
try {
$image = craft()->images->loadImage($path);
$filename = basename($path);
// Make sure that image quality isn't messed with for cropping
$image->setQuality(craft()->imageResizer->getImageQuality($filename, 100));
// Do the cropping
$image->crop($x1, $x2, $y1, $y2);
$image->saveAs($path);
return true;
} catch (\Exception $e) {
ImageResizerPlugin::log($e->getMessage(), LogLevel::Error, true);
return false;
}
}