mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
fixed uploaded image default rotation
This commit is contained in:
@@ -13,20 +13,20 @@ class GenerateImageThumbnailAction
|
||||
{
|
||||
$localDisk = Storage::disk('local');
|
||||
|
||||
// Get image from disk
|
||||
$image = $localDisk->get("temp/$userId/$fileName");
|
||||
|
||||
// Get image width
|
||||
$imageWidth = getimagesize($localDisk->path("temp/$userId/$fileName"))[0];
|
||||
|
||||
collect(config("vuefilemanager.image_sizes.$execution"))
|
||||
->each(function ($size) use ($image, $userId, $fileName, $imageWidth) {
|
||||
->each(function ($size) use ($userId, $fileName, $imageWidth) {
|
||||
if ($imageWidth > $size['size']) {
|
||||
// Create intervention image
|
||||
$intervention = Image::make($image)->orientate();
|
||||
$intervention = Image::make(config('filesystems.disks.local.root') . "/temp/$userId/$fileName")
|
||||
->orientate();
|
||||
|
||||
// Generate thumbnail
|
||||
$intervention->resize($size['size'], null, fn ($constraint) => $constraint->aspectRatio())->stream();
|
||||
$intervention
|
||||
->resize($size['size'], null, fn ($constraint) => $constraint->aspectRatio())
|
||||
->stream();
|
||||
|
||||
// Store thumbnail to disk
|
||||
Storage::put("files/$userId/{$size['name']}-$fileName", $intervention);
|
||||
|
||||
Reference in New Issue
Block a user