WIP
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -33,16 +33,10 @@ class GenerateThumbnail implements ShouldQueue
|
||||
return;
|
||||
}
|
||||
|
||||
$image = InterventionImage::read($this->source);
|
||||
if($image->width() >= $image->height()) {
|
||||
// landscape
|
||||
$image->scaleDown(width: config('gallery.image.thumbnail.maxWidth', 150));
|
||||
} else {
|
||||
// portrait
|
||||
$image->scaleDown(height: config('gallery.image.thumbnail.maxHeight', 150));
|
||||
}
|
||||
$thumbnail = InterventionImage::read($this->source);
|
||||
$thumbnail = $thumbnail->scaleDown(height: config('gallery.image.thumbnail.height', 640), width: config('gallery.image.thumbnail.width', 640));
|
||||
|
||||
Storage::disk('images')->put($this->destination, $image->toAvif(config('gallery.image.quality', 80)));
|
||||
Storage::disk('images')->put($this->destination, $thumbnail->toAvif(config('gallery.image.quality', 80)));
|
||||
}
|
||||
|
||||
public function failed(?Throwable $exception): void
|
||||
|
||||
Reference in New Issue
Block a user