public static function optimizeCjpeg($path)
{
$bin = \Pimcore\Tool\Console::getExecutable("cjpeg");
if ($bin) {
$newFile = self::getTempFile("jpg");
Console::exec($bin . " -outfile " . $newFile . " " . escapeshellarg($path), null, 60);
if (file_exists($newFile)) {
return $newFile;
}
}
return null;
}