You are here

function imagecache_subroutine_effect in ImageCache Actions 7

Same name and namespace in other branches
  1. 8 customactions/imagecache_customactions.module \imagecache_subroutine_effect()

Image effect callback for the subroutine effect.

Parameters

stdClass $image:

array $data:

Return value

boolean true on success, false otherwise.

1 string reference to 'imagecache_subroutine_effect'
imagecache_customactions_image_effect_info in customactions/imagecache_customactions.module
Implements hook_image_effect_info().

File

customactions/imagecache_customactions.module, line 273
Allows advanced users to code their own PHP image manipulation routines as part of image style processing.

Code

function imagecache_subroutine_effect(stdClass $image, array $data) {
  $result = FALSE;
  if ($style = image_style_load($data['subroutine_presetname'])) {
    $result = TRUE;
    foreach ($style['effects'] as $effect) {
      $result = $result && image_effect_apply($image, $effect);
    }
  }
  return $result;
}