$crop_width = min($width, ($crop_width + $feather * 2));
$crop_height = min($height, ($crop_height + $feather * 2));
$crop_x = max(0, ($crop_x - $feather));
$crop_y = max(0, ($crop_y - $feather));
$image->getCore()->cropImage($crop_width, $crop_height, $crop_x, $crop_y);