diff --git a/compressors/PdfCompressor.php b/compressors/PdfCompressor.php index 726b7da..41bc23a 100644 --- a/compressors/PdfCompressor.php +++ b/compressors/PdfCompressor.php @@ -50,7 +50,7 @@ class PdfCompressor extends Compressor { $filename = $this->extractImage($this->media->root()); $size = getimagesize($filename); - @unlink($file); + unlink($filename); return $size; } diff --git a/compressors/PngCompressor.php b/compressors/PngCompressor.php index c41880e..a185926 100644 --- a/compressors/PngCompressor.php +++ b/compressors/PngCompressor.php @@ -20,7 +20,7 @@ class PngCompressor extends Compressor { public function make(string $path): array { - $output = "/tmp/".str_slug(microtime()); + $output = $this->tmpPath(); $mimetype = mime_content_type($path); system('imagemin '.escapeshellarg($path).' --plugin=pngquant > '.escapeshellarg($output));