Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image upload orientation data not taken into account #1162

Closed
CouchersBot opened this issue Apr 29, 2021 · 6 comments · Fixed by #1252
Closed

Image upload orientation data not taken into account #1162

CouchersBot opened this issue Apr 29, 2021 · 6 comments · Fixed by #1252
Labels
backend This issue relates to the python backend bug tool User reported with bug reporting tool. bug This shouldn't be happening. good first issue mobile bug occurs in mobile web version priority: high High priority issue

Comments

@CouchersBot
Copy link
Member

Subject: Insert Profil Picture
Description:
I chose a picture as my profile picture. I'm using Firefox on an android device

Results:
There was no preview picture, and when I accepted the picture, it often was orientated in apperently random directions.

Backend version: develop-bf9caa27
Frontend version: develop-bf9caa27
User Agent: Mozilla/5.0 (Android 11; Mobile; rv:88.0) Gecko/88.0 Firefox/88.0
Page: https://app.couchers.org/
User (spoofable): leo (506)

@CouchersBot CouchersBot added the bug tool User reported with bug reporting tool. label Apr 29, 2021
@lucaslcode
Copy link
Member

I suspect this is due to rotation data on mobile not being applied?

@lucaslcode lucaslcode added backend This issue relates to the python backend good first issue priority: normal Normal priority issue labels Apr 29, 2021
@lucaslcode lucaslcode changed the title Insert Profil Picture Image upload orientation data not taken into account Apr 29, 2021
@lucaslcode lucaslcode added bug This shouldn't be happening. mobile bug occurs in mobile web version labels Apr 29, 2021
@thdk
Copy link
Member

thdk commented Apr 30, 2021

Be aware, some browsers will auto rotate the image for you, so if you add rotation to all images, you might end up with images being rotated twice.

see also: https://stackoverflow.com/a/61901892/681803

@Jakeii
Copy link
Contributor

Jakeii commented May 1, 2021

The 'soft' rotation in EXIF data can sometime be stripped away when manipulating images.

sample image that will be rotated after upload

@aapeliv
Copy link
Member

aapeliv commented May 3, 2021

We strip all EXIF data in the media uploader (on save, not on load), that might explain why browsers will not autorotate it and images are sideways.

Seems we should probably call this to autorotate ourselves before stripping that data

https://libvips.github.io/pyvips/vimage.html#pyvips.Image.autorot

@aapeliv aapeliv added priority: high High priority issue and removed priority: normal Normal priority issue labels May 13, 2021
@aapeliv
Copy link
Member

aapeliv commented May 13, 2021

@Hassan-Mallah: do you want to have a look at this one? It's not in the backend, it's in the media container, in //app/media

@Hassan-Mallah
Copy link
Contributor

@aapeliv sure, i'll check it

@Hassan-Mallah Hassan-Mallah linked a pull request May 17, 2021 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This issue relates to the python backend bug tool User reported with bug reporting tool. bug This shouldn't be happening. good first issue mobile bug occurs in mobile web version priority: high High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants