You are here

function _imageapi_optimize_exec in Image Optimize (or ImageAPI Optimize) 7

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

Saves result of a command into file.

2 calls to _imageapi_optimize_exec()
imageapi_optimize_binaries_jfifremove in binaries/jfifremove.inc
Jfifremove ImageAPI Optimize binary callback.
imageapi_optimize_binaries_jpegtran in binaries/jpegtran.inc
JPEGTran ImageAPI Optimize binary callback.

File

services/internal.inc, line 184
Internal ImageAPI Optimize service.

Code

function _imageapi_optimize_exec($cmd, $dst) {
  ob_start();
  passthru($cmd);
  $output = ob_get_contents();
  ob_end_clean();
  file_unmanaged_save_data($output, $dst, FILE_EXISTS_REPLACE);
}