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

Fix uploaded image orientation in some browsers #13493

Merged

Conversation

ClearlyClaire
Copy link
Contributor

Some browsers (at least recent Chrome versions) automatically take
image metadata into account when drawing images into a canvas.
There seem to be no way to prevent that behavior, and the only
way to detect it seems to compare with a known image.

See: w3c/csswg-drafts#4666
Solution adapted from: blueimp/JavaScript-Load-Image@1e4df70 (my understanding is that it's fine for us to reuse that code this way, it being licensed under MIT, but tagging @blueimp nevertheless just in case)

@ClearlyClaire ClearlyClaire added the browser compatibility Front-end incompatibilities with browsers label Apr 18, 2020
Some browsers (at least recent Chrome versions) automatically take
image metadata into account when drawing images into a canvas.
There seem to be no way to prevent that behavior, and the only
way to detect it seems to compare with a known image.

See: w3c/csswg-drafts#4666
Solution adapted from: blueimp/JavaScript-Load-Image@1e4df70
@Gargron Gargron merged commit a1ce9cb into mastodon:master Apr 18, 2020
@SuperSandro2000
Copy link
Contributor

Maybe we should strip exif data when uploading images?

@Gargron
Copy link
Member

Gargron commented Apr 18, 2020

EXIF data is stripped by the server. The code in question runs before the upload.

@blueimp
Copy link

blueimp commented Apr 18, 2020

Thanks for tagging me @ThibG.
Since the code is not a substantial portion of my library, I'm ok with you using it like that with just the link to the relevant commit as attribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser compatibility Front-end incompatibilities with browsers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants