update image upload preview generator settings
Some checks are pending
Docker / build (push) Waiting to run

This commit is contained in:
yuriko 🦊 2025-07-26 15:27:28 -04:00
parent ea140671bc
commit e1235a7232
4 changed files with 141 additions and 5 deletions

View file

@ -48,12 +48,12 @@ class Upload extends Component
$fullImg = Storage::get("posts/$post->id/full");
// Create thumbnail preview
$thumb = Image::read($fullImg)->scaleDown(width: 512, height: 512);
Storage::put("posts/$post->id/thumb", $thumb->encodeByExtension($post->extension, quality: 70));
$thumb = Image::read($fullImg)->cover(width: 512, height: 512);
Storage::put("posts/$post->id/thumb", $thumb->encodeByMediaType());
// Create smaller preview image
$preview = Image::read($fullImg)->scaleDown(width: 1280, height: 720);
Storage::put("posts/$post->id/preview", $preview->encodeByExtension($post->extension, quality: 70));
Storage::put("posts/$post->id/preview", $preview->encodeByMediaType());
return $this->redirect("/posts/$post->id");
}