You are here

class ImageAPIOptimizeProcessorJfifRemove in Image Optimize (or ImageAPI Optimize) 7.2

Hierarchy

Expanded class hierarchy of ImageAPIOptimizeProcessorJfifRemove

1 string reference to 'ImageAPIOptimizeProcessorJfifRemove'
imageapi_optimize_imageapi_optimize_processor_info in ./imageapi_optimize.imageapi_optimize.inc
Implements hook_imageapi_optimize_processor_info().

File

plugins/imageapi_optimize/ImageAPIOptimizeProcessorJfifRemove.inc, line 3

View source
class ImageAPIOptimizeProcessorJfifRemove extends ImageAPIOptimizeProcessorBinary implements ImageAPIOptimizeProcessorInterface {
  protected function executableName() {
    return 'jfifremove';
  }
  public function process($image, $destination) {
    $cmd = $this
      ->getFullPathToBinary();
    if (empty($cmd)) {
      return FALSE;
    }
    $dst = $this
      ->sanitizeFilename($destination);
    if ($image->info['mime_type'] == 'image/jpeg') {
      $options = array();
      $arguments = array(
        $dst,
      );
      $option_string = implode(' ', $options);
      $argument_string = implode(' ', array_map('escapeshellarg', $arguments));
      $this
        ->saveCommandStdoutToFile("{$cmd} " . $option_string . ' < ' . $argument_string, $dst);
    }
    return;
  }

}

Members