You are here

function canvasactions_perspective_effect in ImageCache Actions 7

Image effect callback for the Perspective effect.

Parameters

stdClass $image: Image object containing the image to operate on.

array $data: The current configuration for this image effect, contains the keys: distortion, vanish, symmetry and opposite_distortion options.

Return value

bool True on success, false otherwise.

1 string reference to 'canvasactions_perspective_effect'
imagecache_canvasactions_image_effect_info in canvasactions/imagecache_canvasactions.module
Implements hook_image_effect_info().

File

canvasactions/canvasactions.inc, line 1439

Code

function canvasactions_perspective_effect(stdClass $image, array $data) {
  if (!image_toolkit_invoke('perspective', $image, array(
    $data,
  ))) {
    watchdog('imagecache_canvasactions', 'Image perspective transform failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array(
      '%toolkit' => $image->toolkit,
      '%path' => $image->source,
      '%mimetype' => $image->info['mime_type'],
      '%dimensions' => $image->info['height'] . 'x' . $image->info['height'],
    ), WATCHDOG_ERROR);
    return FALSE;
  }
  return TRUE;
}