diff --git a/src/PHPImageOptim/Tools/Jpeg/MozJpeg.php b/src/PHPImageOptim/Tools/Jpeg/MozJpeg.php new file mode 100644 index 0000000..3160ede --- /dev/null +++ b/src/PHPImageOptim/Tools/Jpeg/MozJpeg.php @@ -0,0 +1,24 @@ +binaryPath . ' -quality 90 ' . escapeshellarg($this->imagePath), $aOutput, $iResult); + + if ($iResult !== 0) { + throw new Exception('MozJpeg was unable to optimise image.'); + } + return $this; + } + public function checkVersion() + { + exec($this->binaryPath . ' --version', $aOutput, $iResult); + } +} \ No newline at end of file