You are here

function imagecache_imagefilter in ImageCache Actions 6

Same name and namespace in other branches
  1. 5.3 imagecache_coloractions.module \imagecache_imagefilter()
  2. 5.2 imagecache_coloractions.module \imagecache_imagefilter()

Stub for the image toolkit.

Used by brightness and colorize

TODO: other toolkits unimplimented yet. Just forward the job to gdtoolkit for now

Parameters

$image handle on the image definition, including a gd image resource: to act upon

$data settings for this process.:

Return value

bool success

3 calls to imagecache_imagefilter()
imagecache_brightness_image in ./imagecache_coloractions.module
Implementation of hook_image()
imagecache_colorshift_image in ./imagecache_coloractions.module
Implementation of hook_image()
imagecache_inverse_image in ./imagecache_coloractions.module
Implementation of hook_image()

File

./imagecache_coloractions.module, line 211
Additional actions for imagecache processing.

Code

function imagecache_imagefilter($image, $data) {
  if ($image->toolkit != 'imageapi_gd') {
    drupal_set_message("Imagefilter is only currently supported for GD toolkit. Code welcome.", 'error');
    return FALSE;
  }
  if (!imagecache_gd_imagefilter($image, $data['filter'], $data['filter_arg1'], isset($data['filter_arg2']) ? $data['filter_arg2'] : NULL, isset($data['filter_arg3']) ? $data['filter_arg3'] : NULL)) {
    watchdog('imagecache', 'imagecache_imagefilter failed. image: %image, data: %data.', array(
      '%path' => $image,
      '%data' => print_r($data, TRUE),
    ), WATCHDOG_ERROR);
    return FALSE;
  }
  return TRUE;
}