You are here

function imageapi_optimize_binaries_advdef in Image Optimize (or ImageAPI Optimize) 7

AdvanceCOMP Deflate Compression Utility ImageAPI Optimize binary callback.

File

binaries/advdef.inc, line 55
AdvanceCOMP Deflate Compression Utility integration.

Code

function imageapi_optimize_binaries_advdef($image, $dst, $cmd, $settings) {
  if ($image->info['mime_type'] == 'image/png') {
    $args = '';
    if ($settings['recompress']) {
      $args .= 'z';
    }
    $args .= $settings['mode'];
    exec("{$cmd} -" . $args . 'q ' . escapeshellarg($dst), $return, $output);
  }
}