function image_effect_load

Loads a single image effect.

Parameters

$ieid: The image effect ID.

$style_name: The image style name.

Return value

An image effect array, consisting of the following keys:

  • "ieid": The unique image effect ID.
  • "weight": The weight of this image effect within the image style.
  • "name": The name of the effect definition that powers this image effect.
  • "data": An array of configuration options for this image effect.

Besides these keys, the entirety of the image definition is merged into the image effect array. Returns FALSE if the specified effect cannot be found.

See also

image_effect_definition_load()

2 calls to image_effect_load()
ImageEffectDeleteForm::buildForm in drupal/core/modules/image/lib/Drupal/image/Form/ImageEffectDeleteForm.php
Implements \Drupal\Core\Form\FormInterface::buildForm().
image_help in drupal/core/modules/image/image.module
Implements hook_help().

File

drupal/core/modules/image/image.module, line 913
Exposes global functionality for creating image styles.

Code

function image_effect_load($ieid, $style_name) {
  if (($style = entity_load('image_style', $style_name)) && isset($style->effects[$ieid])) {
    $effect = $style->effects[$ieid];
    $definition = image_effect_definition_load($effect['name']);
    $effect = array_merge($definition, $effect);

    // @todo The effect's key name within the style is unknown. It *should* be
    //   identical to the ieid, but that is in no way guaranteed. And of course,
    //   the ieid key *within* the effect is senseless duplication in the first
    //   place. This problem can be eliminated in many places, but especially
    //   for loaded menu arguments like %image_effect, the actual router
    //   callbacks don't have access to 'ieid' anymore (unless resorting to
    //   dirty %index and %map tricks).
    $effect['ieid'] = $ieid;
    return $effect;
  }
  return FALSE;
}