You are here

function imagecache_customactions_image in ImageCache Actions 6.2

Same name and namespace in other branches
  1. 6 imagecache_customactions.module \imagecache_customactions_image()

Implementation of hook_image()

Parameters

$image:

$action:

File

customactions/imagecache_customactions.module, line 134
Allow advanced users to code their own PHP image manipulation routines as part of imagecache processing.

Code

function imagecache_customactions_image($image, $action) {

  // Pull the images $width and $height out to play
  @extract($image->info);

  // And maybe the owner node data could be useful
  if (function_exists('imagecache_actions_node_from_filepath')) {
    $node = imagecache_actions_node_from_filepath($image->source);
  }

  // To get clever and do things post-process, let the process know what the final filename will be.
  // It seems we cannot see what $dst or even our onwing presetname is.
  // But we do know what the URL was the invoked this action! that's out filename-to-be!
  $dst = $_REQUEST['q'];
  $result = eval($action['text']);
  return $result;
}