You are here

function image_imagick_load in Imagick 7

Imagick helper function to create an image resource from a file.

Parameters

$image: An image object. The $image->resource value will populated by this call.

Return value

TRUE or FALSE, based on success.

See also

image_load()

File

./imagick.module, line 208
Imagick toolkit for image manipulation within Drupal.

Code

function image_imagick_load(stdClass $image) {
  try {
    $source = drupal_realpath($image->source);
    $res = new Imagick($source);
    $image->resource = $res;
    return TRUE;
  } catch (ImagickExeception $e) {
    return FALSE;
  }
}