function image_effects

7.x image.module image_effects()

Loads all image effects from the database.

Return value

An array of all image effects.

See also

image_effect_load()

1 call to image_effects()
image_style_effects in drupal-7.x/modules/image/image.module
Loads all the effects for an image style.
8 string references to 'image_effects'
image_default_style_revert in drupal-7.x/modules/image/image.module
Reverts the changes made by users to a default image style.
image_effect_delete in drupal-7.x/modules/image/image.module
Deletes an image effect.
image_effect_save in drupal-7.x/modules/image/image.module
Saves an image effect.
image_schema in drupal-7.x/modules/image/image.install
Implements hook_schema().
image_style_delete in drupal-7.x/modules/image/image.module
Deletes an image style.

... See full list

File

drupal-7.x/modules/image/image.module, line 1217
Exposes global functionality for creating image styles.

Code

function image_effects() {
  $effects = &drupal_static(__FUNCTION__);

  if (!isset($effects)) {
    $effects = array();

    // Add database image effects.
    $result = db_select('image_effects', NULL, array('fetch' => PDO::FETCH_ASSOC))
      ->fields('image_effects')
      ->orderBy('image_effects.weight', 'ASC')
      ->execute();
    foreach ($result as $effect) {
      $effect['data'] = unserialize($effect['data']);
      $definition = image_effect_definition_load($effect['name']);
      // Do not load image effects whose definition cannot be found.
      if ($definition) {
        $effect = array_merge($definition, $effect);
        $effects[$effect['ieid']] = $effect;
      }
    }
  }

  return $effects;
}