vue-file-agent
vue-file-agent copied to clipboard
Incorrect preview image orientation
Describe the bug Selecting/drag'n'dropping JPG image with rotation metadata results in incorrectly orientated preview image. (Uploaded image is correct)
To Reproduce Steps to reproduce the behavior:
- Go to demo page https://safrazik.github.io/vue-file-agent/
- Add JPG with rotation (example image https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_6.jpg)
- See that preview image is rotated incorrectly
Expected behavior Preview image should have correct orientation.
Screenshots
vue-file-agent preview in demo:
same image in Windows Photos preview:
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Chrome Version 102.0.5005.63 (Official Build) (64-bit)
- Version 1.7.0 (demo)
Additional context I see same issue already fixed here https://github.com/safrazik/vue-file-agent/issues/28 , but I guess there were some breaking changes in browser compatibility last years: https://paul.kinlan.me/correct-image-orientation-for-images-chrome-81/ .
Also viewing example JPG in Internet Explorer https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_6.jpg - orientation is not respected, though in current versions of Chrome, Edge - it is correctly rotated.
It seems like Width is less than Height . Width = 1200px , height = 1800px. Therefore native browser functionality would be to rotate it when previewed.
- Vue File Agent Team might have a solution for this.
Hello, thanks for answer.
I don't think it is related to width/height - it does not determine orientation of image, but EXIF metadata in JPEG does.
What I found and wrote in my report was that it seems not respecting EXIF orientation was normal in earlier browser versions (as Internet explorer still does that). But later and currently most browsers do rotate themselves (see https://paul.kinlan.me/correct-image-orientation-for-images-chrome-81/), so it is not needed to manually rotate by examining EXIF data.
In your screenshot it seems that preview in your file manager also does not respect EXIF orientation.
Again thanks for looking into this, and sharing this library.
Having the same issue, still not fixed?