You are here

pngout.inc in Image Optimize (or ImageAPI Optimize) 7

PNGOUT integration.

File

binaries/pngout.inc
View source
<?php

/**
 * @file
 * PNGOUT integration.
 */

/**
 * Implements imageapi_optimize_TYPE_NAME_info().
 */
function imageapi_optimize_binaries_pngout_info() {
  return array(
    'title' => t('PNGOUT'),
    'url' => 'http://advsys.net/ken/utils.htm',
    'type' => 'png',
    'weight' => 5,
  );
}

/**
 * Pngquant ImageAPI Optimize binary callback.
 */
function imageapi_optimize_binaries_pngout($image, $dst, $cmd, $settings) {
  if ($image->info['mime_type'] == 'image/png') {
    exec("{$cmd} " . escapeshellarg($dst));
  }
}

Functions

Namesort descending Description
imageapi_optimize_binaries_pngout Pngquant ImageAPI Optimize binary callback.
imageapi_optimize_binaries_pngout_info Implements imageapi_optimize_TYPE_NAME_info().