From 3b948c7b7e82b4de823d20115a4fb0dfc34d2eb0 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 Feb 2024 14:29:43 +0000 Subject: [PATCH] Add orientate to image upload Signed-off-by: snipe --- app/Http/Requests/ImageUploadRequest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.php index b3cd6e102c..09c8e3b583 100644 --- a/app/Http/Requests/ImageUploadRequest.php +++ b/app/Http/Requests/ImageUploadRequest.php @@ -109,10 +109,11 @@ class ImageUploadRequest extends Request \Log::debug('Trying to upload to: '.$path.'/'.$file_name); try { - $upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) { + $upload = Image::make($image->getRealPath())->setFileInfoFromPath($image->getRealPath())->resize(null, $w, function ($constraint) { $constraint->aspectRatio(); $constraint->upsize(); - }); + })->orientate(); + } catch(NotReadableException $e) { \Log::debug($e); $validator = \Validator::make([], []); @@ -138,10 +139,8 @@ class ImageUploadRequest extends Request $cleanSVG = $sanitizer->sanitize($dirtySVG); try { - \Log::debug('Trying to upload to: '.$path.'/'.$file_name); Storage::disk('public')->put($path.'/'.$file_name, $cleanSVG); } catch (\Exception $e) { - \Log::debug('Upload no workie :( '); \Log::debug($e); } }