Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from Hoosk/master
Browse files Browse the repository at this point in the history
Added MozJpeg Tool.
  • Loading branch information
bensquire authored Apr 17, 2017
2 parents f270a8f + 6d62021 commit 8cea9ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/PHPImageOptim/Tools/Jpeg/MozJpeg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Classes;

use Exception;
use PHPImageOptim\Tools\Common;
use PHPImageOptim\Tools\ToolsInterface;

class MozJpeg extends Common implements ToolsInterface
{
public function optimise()
{
exec($this->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);
}
}

0 comments on commit 8cea9ab

Please sign in to comment.