LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
885 stars 332 forks source link

[Bug]: Uploading a photo in portrait orientation automatically rotates it to landscape orientation after upload #1329

Open ManikandanUV opened 1 year ago

ManikandanUV commented 1 year ago

Requirements

Summary

https://lemmy.world/post/103993

Here's an example. I uploaded two photos, and they both got rotated automatically. You can check the linked imgur album to see how they appear normally.

Steps to Reproduce

  1. Create a post
  2. Upload a portrait oriented photo
  3. Click preview
  4. ???
  5. Profit

Technical Details

None that I know of

Version

BE: 0.17.4

Lemmy Instance URL

lemmy.world

alectrocute commented 1 year ago

I think this is because we're stripping metadata off the image upon upload.

Can you share the file directly to your GitHub comment so we can compare?

ManikandanUV commented 1 year ago

IMG_9468

Here you go

Naomikho commented 1 year ago

I think this is because we're stripping metadata off the image upon upload.

Can you share the file directly to your GitHub comment so we can compare?

Someone in my community managed to reproduce the issue too, and it does seem to be due to the metadata. I hope this can help too Before upload: IMG_20230612_134408

After upload: 2d5c712f-69cb-4323-9760-0b0ae0b908c9 I checked the metadata of this image and the width and height are flipped. In the first image it's the other way round(as it should be). 94d99c63-798e-4a41-b417-0ab9a6180334

Naomikho commented 1 year ago

@alectrocute Sorry I forgot to mentioned in my previous comment, hope the stuff I posted helps. I'm not familiar with rust, pict-rs or magick so I can't figure out the reason behind this behaviour.😅

Naomikho commented 1 year ago

Issue seems fixed with the latest lemmy update which is using pict-rs 4.0 :D

KAMiKAZOW commented 1 year ago

Issue seems fixed with the latest lemmy update which is using pict-rs 4.0 :D

Apparently not: https://lemmy.world/post/3097282

Uploaded after the 0.18.4 upgrade.