You are here

function imageapi_optimize_optimize_effect in Image Optimize (or ImageAPI Optimize) 7.2

Image effect callback for image optimize.

We actually just change the image toolkit to 'imageapi_optimize' so that when image_toolkit_invoke() is called by image_pipeline_create_derivative() our function image_imageapi_optimize_save() is called.

1 string reference to 'imageapi_optimize_optimize_effect'
imageapi_optimize_image_effect_info in ./imageapi_optimize.module
Implements hook_image_effect_info().

File

./imageapi_optimize.module, line 825

Code

function imageapi_optimize_optimize_effect(stdClass $image, $options) {
  if (!empty($options['pipeline']) && imageapi_optimize_pipeline_load($options['pipeline'])) {
    $image->imageapi_optimize_original_toolkit = $image->toolkit;
    $image->toolkit = 'imageapi_optimize';
    $image->imageapi_optimize_pipeline = $options['pipeline'];
  }
}