Pull in image effects exposed by modules implementing hook_image_effect_info().
An array of image effects to be used when transforming images.
image_effect_definition_load()
function image_effect_definitions() {
$language_interface = language(LANGUAGE_TYPE_INTERFACE);
// hook_image_effect_info() includes translated strings, so each language is
// cached separately.
$langcode = $language_interface->langcode;
$effects =& drupal_static(__FUNCTION__);
if (!isset($effects)) {
if ($cache = cache()
->get("image_effects:{$langcode}")) {
$effects = $cache->data;
}
else {
$effects = array();
include_once DRUPAL_ROOT . '/core/modules/image/image.effects.inc';
foreach (module_implements('image_effect_info') as $module) {
foreach (module_invoke($module, 'image_effect_info') as $name => $effect) {
// Ensure the current toolkit supports the effect.
$effect['module'] = $module;
$effect['name'] = $name;
$effect['data'] = isset($effect['data']) ? $effect['data'] : array();
$effects[$name] = $effect;
}
}
uasort($effects, '_image_effect_definitions_sort');
drupal_alter('image_effect_info', $effects);
cache()
->set("image_effects:{$langcode}", $effects);
}
}
return $effects;
}