You are here

function imageapi_optimize_binaries_advpng in Image Optimize (or ImageAPI Optimize) 7

AdvanceCOMP PNG Compression Utility ImageAPI Optimize binary callback.

File

binaries/advpng.inc, line 55
AdvanceCOMP PNG Compression Utility integration.

Code

function imageapi_optimize_binaries_advpng($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);
  }
}