This commit is contained in:
philipp lang 2022-09-10 19:58:24 +02:00
parent 347f056df0
commit 72597436a7
1 changed files with 1 additions and 5 deletions

View File

@ -8,12 +8,9 @@ use Aweos\Resizer\Lib\MediaPath;
use Aweos\Resizer\Models\Setting; use Aweos\Resizer\Models\Setting;
use Illuminate\Filesystem\FilesystemAdapter; use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use October\Rain\Resize\Resizer;
use Storage;
class ImageResizer class ImageResizer
{ {
private FilesystemAdapter $disk; private FilesystemAdapter $disk;
private string $uploadDir; private string $uploadDir;
private MediaPath $file; private MediaPath $file;
@ -94,7 +91,7 @@ class ImageResizer
private function generateVersions(): void private function generateVersions(): void
{ {
foreach ($this->possibleSizes() as $size) { foreach ($this->possibleSizes() as $size) {
$this->compressor->resize($size, $this->update, function($media, $file) { $this->compressor->resize($size, $this->update, function ($media, $file) {
if (!file_exists($file)) { if (!file_exists($file)) {
throw new ResizerException('File versions cannot be generated. Version file "'.$file.'" of "'.$this->file->root().'" doesnt exist.'); throw new ResizerException('File versions cannot be generated. Version file "'.$file.'" of "'.$this->file->root().'" doesnt exist.');
} }
@ -104,5 +101,4 @@ class ImageResizer
}); });
} }
} }
} }