Fixed: unline file after getting pdf filesize

This commit is contained in:
philipp lang 2021-10-31 15:04:00 +01:00
parent 4008643e5b
commit 58d4f260da
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class PdfCompressor extends Compressor
{ {
$filename = $this->extractImage($this->media->root()); $filename = $this->extractImage($this->media->root());
$size = getimagesize($filename); $size = getimagesize($filename);
@unlink($file); unlink($filename);
return $size; return $size;
} }

View File

@ -20,7 +20,7 @@ class PngCompressor extends Compressor {
public function make(string $path): array public function make(string $path): array
{ {
$output = "/tmp/".str_slug(microtime()); $output = $this->tmpPath();
$mimetype = mime_content_type($path); $mimetype = mime_content_type($path);
system('imagemin '.escapeshellarg($path).' --plugin=pngquant > '.escapeshellarg($output)); system('imagemin '.escapeshellarg($path).' --plugin=pngquant > '.escapeshellarg($output));