1 image.effects.inc image_desaturate_effect(&$image, $data)

Image effect callback; Desaturate (grayscale) an image resource.

Parameters

$image: An image object returned by image_load().

$data: An array of attributes to use when performing the desaturate effect.

Return value

TRUE on success. FALSE on failure to desaturate image.:

See also

image_desaturate()

File

core/modules/image/image.effects.inc, line 234
Functions needed to execute image effects provided by Image module.

Code

function image_desaturate_effect(&$image, $data) {
  if (!image_desaturate($image)) {
    watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
    return FALSE;
  }
  return TRUE;
}