]> cat aescling's git repositories - mastodon.git/commit
Fix uploaded image orientation in some browsers (#13493)
authorThibG <thib@sitedethib.com>
Sat, 18 Apr 2020 13:37:03 +0000 (15:37 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Apr 2020 13:37:03 +0000 (15:37 +0200)
commita1ce9cbb67facf705379355b9c8ec19c521b419c
tree5236f286b15a227ae1370e93257344e2e97e8830
parente12a5635da7de5a1c3b08b2ce420ee8a56ae4aff
Fix uploaded image orientation in some browsers (#13493)

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: https://github.com/w3c/csswg-drafts/issues/4666
Solution adapted from: https://github.com/blueimp/JavaScript-Load-Image/commit/1e4df707821a0afcc11ea0720ee403b8759f3881
app/javascript/mastodon/utils/resize_image.js