-
Notifications
You must be signed in to change notification settings - Fork 27
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
Demo app: Images rotated if added from iOS / macOS photo library #30
Comments
#34 can help by providing a way to detect non-portrait orientation and then providing the user with a way to correct it. |
Update: This only happens in Safari, so I think it is just another case of the issue where Safari does not respect EXIF orientation information when loading images via See also whatwg/html#7210 (comment). |
Possibly related WebKit issues: https://bugs.webkit.org/show_bug.cgi?id=203482 (Orientation not preserved after image resizing) I should note that I have the "High efficiency" (HEIF/HEVC) option selected in the Camera Formats settings in iOS. |
An option for Safari might be to handle reading and applying the EXIF orientation data from the file ourselves, eg. using https://github.com/exif-js/exif-js, this is assuming that the relevant EXIF data is present. The orientation is preserved when dragging from Photos => the NanoJPEG demo app: https://github.com/evanw/skew-nanojpeg, so it looks like it is possible. |
I remember that I also had this problem a long time ago. My solution was then based on this code. Maybe it is helpful. But just reading the EXIF data should also do. |
Thanks. Those answers suggest it might be possible to read EXIF info with a smaller amount of code than the full EXIF JS. It would be even better if the issue was fixed in WebKit though! |
When loading an image into the web demo app directly from the iOS / macOS photo library, the images frequently end up rotated, though they are displayed in the correct orientation in the Photo Library itself. Due to #29, the OCR then doesn't work as expected. If I first export the image to a JPEG by dragging the image from Photos => Finder and then Finder => web app, it works as expected.
If the demo app automatically detected the orientation of the image and rotated it, that would solve the problem.
The text was updated successfully, but these errors were encountered: