You are here

function animgif_support_do_effect in Animated gif support for image styles 7

Effect callback common function for overridden effects.

4 calls to animgif_support_do_effect()
animgif_support_image_crop_effect in ./animgif_support.module
Provides image_crop effect callback for animated GIFs.
animgif_support_image_resize_effect in ./animgif_support.module
Provides image_resize effect callback for animated GIFs.
animgif_support_image_scale_and_crop_effect in ./animgif_support.module
Provides image_scale_and_crop effect callback for animated GIFs.
animgif_support_image_scale_effect in ./animgif_support.module
Provides image_scale effect callback for animated GIFs.

File

./animgif_support.module, line 113
Provides animated gif resizing support for the image styles.

Code

function animgif_support_do_effect(&$image, $data, $original_effect) {
  $definitions = image_effect_definitions();
  if (!empty($definitions[$original_effect]['original effect callback'])) {
    if (animgif_support_is_gif($image->info)) {

      // Run gif effect instead of the original.
      // todo: check if it is not an animgif. Dunno how...
      $gif_effect = $definitions[$original_effect]['gif effect'];
      $func = 'animgif_support_' . $gif_effect . '_func';
      $func($image, $data);
    }
    else {

      // Call the original effect callback.
      $func = $definitions[$original_effect]['original effect callback'];
      $func($image, $data);
    }
  }
}