From 313d713cb5ad43c5cb150fe9a3d214400ec3b475 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Mon, 20 Sep 2021 09:11:04 +0000 Subject: [PATCH] Remove filename after resolving PDFCompressor Size --- compressors/PdfCompressor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compressors/PdfCompressor.php b/compressors/PdfCompressor.php index 367911c..0519ef7 100644 --- a/compressors/PdfCompressor.php +++ b/compressors/PdfCompressor.php @@ -43,7 +43,11 @@ class PdfCompressor extends Compressor public function originalSize(): array { - return getimagesize($this->extractImage($this->media->root())); + $filename = $this->extractImage($this->media->root()); + $size = getimagesize($filename); + @unlink($file); + + return $size; } public function shouldGenerateVersions(): bool