You are here

function imagecache_generate_action in ImageCache 6.2

Generate imagecache presets for the given node and presets.

Parameters

$node: A node object.

$context: Contains values from the calling action.

See also

imagecache_action_info()

imagecache_generate_action_form()

File

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

Code

function imagecache_generate_action(&$node, $context) {
  $files = imagecache_get_images_in_node($node);
  if (!empty($files) && !empty($context['imagecache_presets'])) {
    foreach ($files as $file) {
      foreach ($context['imagecache_presets'] as $presetname) {
        imagecache_generate_image($presetname, $file['filepath']);
      }
    }
  }
}