From 6e4f17176feb2b688ac0be2beb17c8dd3c59e17c Mon Sep 17 00:00:00 2001 From: noreff Date: Sat, 23 Feb 2019 12:21:30 +0100 Subject: [PATCH] Fix images not orrientated when uploaded through VoyagerController@upload (#3906) --- src/Http/Controllers/VoyagerController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/VoyagerController.php b/src/Http/Controllers/VoyagerController.php index 1f7e6852a7..0567488613 100644 --- a/src/Http/Controllers/VoyagerController.php +++ b/src/Http/Controllers/VoyagerController.php @@ -51,8 +51,11 @@ public function upload(Request $request) ->resize($resizeWidth, $resizeHeight, function (Constraint $constraint) { $constraint->aspectRatio(); $constraint->upsize(); - }) - ->encode($file->getClientOriginalExtension(), 75); + }); + if ($ext !== 'gif') { + $image->orientate(); + } + $image->encode($file->getClientOriginalExtension(), 75); // move uploaded file from temp to uploads directory if (Storage::disk(config('voyager.storage.disk'))->put($fullPath, (string) $image, 'public')) {