Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}