mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
update image upload preview generator settings
Some checks are pending
Docker / build (push) Waiting to run
Some checks are pending
Docker / build (push) Waiting to run
This commit is contained in:
parent
ea140671bc
commit
e1235a7232
4 changed files with 141 additions and 5 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue