From 3f94e2bfa0f0860021fb1a31d43012be9e27a9cf Mon Sep 17 00:00:00 2001 From: Oanh Nguyen Date: Wed, 25 Jan 2017 11:49:14 +0700 Subject: [PATCH] Correct image orientation according to Exif data When using mobile, take a photo and upload it as avatar, it's orientation is incorrect. This commit will fix this problem. --- framework/core/src/Core/Command/UploadAvatarHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/src/Core/Command/UploadAvatarHandler.php b/framework/core/src/Core/Command/UploadAvatarHandler.php index 6045cb88f..e0fed57d1 100644 --- a/framework/core/src/Core/Command/UploadAvatarHandler.php +++ b/framework/core/src/Core/Command/UploadAvatarHandler.php @@ -101,7 +101,7 @@ class UploadAvatarHandler $manager = new ImageManager; // Explicitly tell Intervention to encode the image as JSON (instead of having to guess from the extension) - $encodedImage = $manager->make($tmpFile)->fit(100, 100)->encode('jpg', 100); + $encodedImage = $manager->make($tmpFile)->orientate()->fit(100, 100)->encode('jpg', 100); file_put_contents($tmpFile, $encodedImage); $this->events->fire(