You are here

function _imagecache_apply_action in ImageCache 6.2

Same name and namespace in other branches
  1. 5.2 imagecache.module \_imagecache_apply_action()

Apply an action to an image.

Parameters

$action: Action array

$image: Image object

Return value

Boolean, TRUE indicating success and FALSE failure.

1 call to _imagecache_apply_action()
imagecache_build_derivative in ./imagecache.module
Create a new image based on an image preset.

File

./imagecache.module, line 503
Dynamic image resizer and image cacher.

Code

function _imagecache_apply_action($action, &$image) {
  if (imagecache_action_definition($action['action'])) {
    $function = $action['action'] . '_image';
    if (function_exists($function)) {
      return $function($image, $action['data']);
    }
  }

  // skip undefined actions.. module probably got uninstalled or disabled.
  watchdog('imagecache', 'non-existant action %action', array(
    '%action' => $action['action'],
  ), WATCHDOG_NOTICE);
  return TRUE;
}