function image_effect_apply

image_effect_apply($image, $effect)

Applies an image effect to the image object.

Parameters

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

$effect: An image effect array.

Return value

TRUE on success. FALSE if unable to perform the image effect on the image.

File

modules/image/image.module, line 1339
Exposes global functionality for creating image styles.

Code

function image_effect_apply($image, $effect) {
  module_load_include('inc', 'image', 'image.effects');
  $function = $effect['effect callback'];
  if (function_exists($function)) {
    return $function($image, $effect['data']);
  }
  return FALSE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.module/function/image_effect_apply/7.x