From 6a532ec14e2259f34c2d20451dcdac61b0c59574 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. --- src/Core/Command/UploadAvatarHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Command/UploadAvatarHandler.php b/src/Core/Command/UploadAvatarHandler.php index 6045cb88f..e0fed57d1 100644 --- a/src/Core/Command/UploadAvatarHandler.php +++ b/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(