You are here

function scald_image_scald_transcoders in Scald: Media Management made easy 7

Implements hook_scald_transcoders().

File

modules/providers/scald_image/scald_image.module, line 133
Scald Image is a Scald Atom Provider for images.

Code

function scald_image_scald_transcoders() {
  $transcoders = array();
  foreach (image_styles() as $name => $style) {
    $label = isset($style['label']) ? $style['label'] : $style['name'];
    $transcoders['style-' . $name] = array(
      'title' => t('@style (Image style)', array(
        '@style' => $label,
      )),
      'description' => t('Use the Image style @style to prepare the image', array(
        '@style' => $label,
      )),
      'formats' => array(
        'image' => 'passthrough',
      ),
    );
  }
  if (module_exists('picture')) {
    foreach (picture_mapping_load_all() as $name => $style) {
      $transcoders['group-' . $name] = array(
        'title' => t('@group (Picture group)', array(
          '@group' => $name,
        )),
        'description' => t('Use the Picture group @group to prepare the image', array(
          '@group' => $name,
        )),
        'formats' => array(
          'image' => 'passthrough',
        ),
      );
    }
  }
  return $transcoders;
}