You are here

function imageapi_optimize_processors in Image Optimize (or ImageAPI Optimize) 7.2

Loads all image processors from the database.

Return value

An array of all image processors.

See also

image_processor_load()

1 call to imageapi_optimize_processors()
imageapi_optimize_pipeline_processors in ./imageapi_optimize.module
Loads all the processors for an image pipeline.
2 string references to 'imageapi_optimize_processors'
imageapi_optimize_pipeline_flush in ./imageapi_optimize.module
Flushes cached media for a pipeline.
imageapi_optimize_processor_save in ./imageapi_optimize.module
Saves an image processor.

File

./imageapi_optimize.module, line 615

Code

function imageapi_optimize_processors() {
  $processors =& drupal_static(__FUNCTION__);
  if (!isset($processors)) {
    $processors = array();

    // Add database image processors.
    $result = db_select('imageapi_optimize_processors', NULL, array(
      'fetch' => PDO::FETCH_ASSOC,
    ))
      ->fields('imageapi_optimize_processors')
      ->orderBy('imageapi_optimize_processors.weight', 'ASC')
      ->execute();
    foreach ($result as $processor) {
      $processor['data'] = unserialize($processor['data']);
      $definition = imageapi_optimize_processor_definition_load($processor['name']);

      // Do not load image processors whose definition cannot be found.
      if ($definition) {
        $processor = array_merge($definition, $processor);
        $processors[$processor['ieid']] = $processor;
      }
    }
  }
  return $processors;
}