1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 23:31:17 +02:00

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.
This commit is contained in:
Oanh Nguyen
2017-01-25 11:49:14 +07:00
committed by GitHub
parent c89def0d78
commit 3f94e2bfa0

View File

@@ -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(