misskey-dev / misskey

🌎 An interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.66k stars 1.29k forks source link

Image upload from iOS 13 ignores image rotation metadata #5965

Open cortices opened 4 years ago

cortices commented 4 years ago

💡 Summary

When uploading an image to misskey web (v11.37.1), image rotation is ignored. iOS sets JPEG rotation metadata instead of rotating the pixels when taking photos in different orientations, and misskey appears to ignore & strip this metadata.

🙂 Expected Behavior

Image is uploaded and displays in the orientation shown in iOS Photos app and camera.

☚ī¸ Actual Behavior

The image uploads and goes to a different orientation (the actual pixel orientation in JPEG file).

📝 Steps to Reproduce

  1. Open new note in misskey on iOS
  2. Tap 'upload'/image button
  3. Select images taken in different phone orientations
  4. When images upload, the previews are rotated wrong. They also display wrong on the timeline when viewed from any devices.

📌 Environment

Web client, iOS.

mei23 commented 4 years ago

Misskey rotates images to respect orientation. I checked the image with some orientation, but there was no problem.

@cortices Do you have a sample image where the problem occurs?

cortices commented 4 years ago

Re tested in the same site and same exact photos, and problem disappeared! very strange. Closing as I can't reproduce anymore.

acid-chicken commented 4 years ago

I guessed that the feature of image compression removes rotation metadata. Could you try again?

cortices commented 4 years ago

@acid-chicken Just tested and you're right. The iOS image compression feature causes the rotation to be incorrect in any setting other than "Full Size" (original file). see the attached image. Left was uploaded with compression set to "Medium", right was uploaded with compression set to "Full Size". Right is the correct orientation. Does this mean it's an iOS bug?

image