vue-file-agent icon indicating copy to clipboard operation
vue-file-agent copied to clipboard

Incorrect preview image orientation

Open justinas55 opened this issue 2 years ago • 3 comments

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:

  1. Go to demo page https://safrazik.github.io/vue-file-agent/
  2. Add JPG with rotation (example image https://github.com/recurser/exif-orientation-examples/blob/master/Landscape_6.jpg)
  3. See that preview image is rotated incorrectly

Expected behavior Preview image should have correct orientation.

Screenshots vue-file-agent preview in demo: image same image in Windows Photos preview: image

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.

justinas55 avatar Jun 08 '22 11:06 justinas55

image

It seems like Width is less than Height . Width = 1200px , height = 1800px. Therefore native browser functionality would be to rotate it when previewed.

image


  • Vue File Agent Team might have a solution for this.

jay-p-b-7span avatar Aug 23 '22 15:08 jay-p-b-7span

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.

justinas55 avatar Aug 26 '22 11:08 justinas55

Having the same issue, still not fixed?

edum18 avatar Jan 10 '24 11:01 edum18