diff --git a/compressors/JpgCompressor.php b/compressors/JpgCompressor.php index ba80b48..abceb24 100644 --- a/compressors/JpgCompressor.php +++ b/compressors/JpgCompressor.php @@ -2,13 +2,12 @@ namespace Aweos\Resizer\Compressors; -use Aweos\Resizer\Exceptions\ResizerException; use Illuminate\Support\Collection; use Intervention\Image\ImageManager; use Storage; -class JpgCompressor extends Compressor { - +class JpgCompressor extends Compressor +{ public function getExtensionRegex(): string { return 'jpg'; @@ -24,7 +23,7 @@ class JpgCompressor extends Compressor { $output = $this->tmpPath(); system('imagemin '.escapeshellarg($path).' --plugin=jpegtran --plugin=mozjpeg --plugin.mozjpeg.quality=70 > '.escapeshellarg($output)); - system("mv ".escapeshellarg($output)." ".escapeshellarg($path)); + system('mv '.escapeshellarg($output).' '.escapeshellarg($path)); return [ $path => [$path], @@ -64,12 +63,9 @@ class JpgCompressor extends Compressor { public function start(): void { - // } public function end(): void { - // } - } diff --git a/compressors/PdfCompressor.php b/compressors/PdfCompressor.php index 9110602..4626f2f 100644 --- a/compressors/PdfCompressor.php +++ b/compressors/PdfCompressor.php @@ -9,7 +9,6 @@ use Storage; class PdfCompressor extends Compressor { - private string $originalImage; public function getExtensionRegex(): string @@ -28,7 +27,7 @@ class PdfCompressor extends Compressor $mimetype = mime_content_type($path); system('imagemin '.escapeshellarg($path).' --plugin=jpegtran --plugin=mozjpeg --plugin.mozjpeg.quality=70 > '.escapeshellarg($output)); - system("mv ".escapeshellarg($output)." ".escapeshellarg($path)); + system('mv '.escapeshellarg($output).' '.escapeshellarg($path)); return [ $path => [$path], @@ -78,7 +77,7 @@ class PdfCompressor extends Compressor public function resize(Collection $size, bool $update, callable $callback): void { - $tempBefore = PATHINFO($this->originalImage, PATHINFO_FILENAME).'compiled.'.pathinfo($this->originalImage, PATHINFO_EXTENSION); + $tempBefore = pathinfo($this->originalImage, PATHINFO_FILENAME).'compiled.'.pathinfo($this->originalImage, PATHINFO_EXTENSION); $r = app(ImageManager::class)->make($this->originalImage) ->fit($size->get('width'), $size->get('height')) @@ -91,5 +90,4 @@ class PdfCompressor extends Compressor unlink($tempBefore); call_user_func($callback, $this->media, Storage::path($versionFilename)); } - }