You are here

function coloractions_posterize_effect in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 coloractions/imagecache_coloractions.module \coloractions_posterize_effect()

Image effect callback for the posterize effect.

Parameters

stdClass $image:

array $data:

Return value

bool true on success, false otherwise.

1 string reference to 'coloractions_posterize_effect'
imagecache_coloractions_image_effect_info in coloractions/imagecache_coloractions.module
Implements hook_image_effect_info().

File

coloractions/imagecache_coloractions.module, line 757

Code

function coloractions_posterize_effect(stdClass $image, array $data) {
  if (!image_toolkit_invoke('posterize', $image, array(
    $data['colors'],
  ))) {
    watchdog('imagecache_actions', 'Image posterize 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;
}