1. drupal
    1. 8
    2. 7
7 – 8 hook_image_effect_info()

Define information about image effects provided by a module.

This hook enables modules to define image manipulation effects for use with an image style.

Return value

An array of image effects. This array is keyed on the machine-readable effect name. Each effect is defined as an associative array containing the following items:

  • "label": The human-readable name of the effect.
  • "effect callback": The function to call to perform this image effect.
  • "help": (optional) A brief description of the effect that will be shown when adding or configuring this image effect.
  • "form callback": (optional) The name of a function that will return a $form array providing a configuration form for this image effect.
  • "summary theme": (optional) The name of a theme function that will output a summary of this image effect's configuration.

See also


Related topics


modules/image/image.api.php, line 34

function hook_image_effect_info() {
  $effects = array();

  $effects['mymodule_resize'] = array(
    'label' => t('Resize'), 
    'help' => t('Resize an image to an exact set of dimensions, ignoring aspect ratio.'), 
    'effect callback' => 'mymodule_resize_image', 
    'form callback' => 'mymodule_resize_form', 
    'summary theme' => 'mymodule_resize_summary',

  return $effects;