You are here

function _imageapi_optimize_optimize in Image Optimize (or ImageAPI Optimize) 7

Same name and namespace in other branches
  1. 6 imageapi_optimize.module \_imageapi_optimize_optimize()

Optimizes image with external commands.

1 call to _imageapi_optimize_optimize()
image_imageapi_optimize_save in ./imageapi_optimize.module
Save callback for the imageapi_optimize image toolkit.

File

./imageapi_optimize.module, line 236
Image optimize functionalities.

Code

function _imageapi_optimize_optimize($image, $dst) {
  $info = imageapi_optimize_info();
  $service = variable_get('imageapi_optimize_service', 'internal');
  if (isset($info['services'][$service])) {
    $service = $info['services'][$service];
    if (isset($service['file'])) {
      include_once $service['file'];
    }
    $service['callbacks']['process']($image, $dst);
  }

  // If optimize service fails, there is no problem. Original image is saved.
  return TRUE;
}