This commit is contained in:
2024-06-07 16:26:15 +02:00
parent d01c7d3868
commit 154e79aacd
11 changed files with 153 additions and 29 deletions

View File

@@ -33,16 +33,11 @@ class GenerateFullscreen implements ShouldQueue
return;
}
$image = InterventionImage::read($this->source);
if($image->width() >= $image->height()) {
// landscape
$image->scaleDown(width: config('gallery.image.fullscreen.maxWidth', 2000));
} else {
// portrait
$image->scaleDown(height: config('gallery.image.fullscreen.maxHeight', 2000));
}
$lightbox = InterventionImage::read($this->source);
$lightbox = $lightbox->scaleDown(height: config('gallery.image.fullscreen.height', 2000));
Storage::disk('images')->put($this->destination, $image->toAvif(config('gallery.image.quality', 80)));
Storage::disk('images')->put($this->destination, $lightbox->toAvif(config('gallery.image.quality', 80)));
$this->image->setLightboxSize($lightbox->width(), $lightbox->height());
}
public function failed(?Throwable $exception): void