You are here

function imagick_crop in Imagick 7

Implements the imagick crop effect.

Parameters

$image: An image object

array $data: The data passed from the form

2 string references to 'imagick_crop'
imagick_image_effect_info in ./imagick.module
Implements hook_image_effect_info()
_imagick_alter_existing_effect_names in ./imagick.install
Helper function to alter existing effect names

File

effects/imagick.crop.inc, line 52

Code

function imagick_crop($image, $data = array()) {
  list($x, $y) = explode('-', $data['anchor']);
  $x = image_filter_keyword($x, $image->info['width'], $data['width']);
  $y = image_filter_keyword($y, $image->info['height'], $data['height']);
  $data = array_merge(array(
    'x' => $x,
    'y' => $y,
  ), $data);
  image_toolkit_invoke('crop', $image, $data);
}