Chrome Image EXIF ​​Orientation Image Problem

I am creating a web application that displays photos. Most photos were taken using smartphones and have EXIF ​​rotation information. I am viewing a url that returns an image unchanged.

I noticed that when I put this url in the img tag, Chrome does not respect the EXIF ​​orientation data, but when I put the url in the Chrome address bar, it shows the image page and then it respects the EXIF ​​orientation.

Sorry, I cannot share the image, I will try to find another example that I can provide.

Has anyone noticed this problem?

+5
source share
1 answer

The reason for this behavior is that Chrome automatically rotates images based on EXIF ​​data only if they are displayed directly on the browser tab as the main document.

The relevant chrome issue tracking this implementation is this: https://bugs.chromium.org/p/chromium/issues/detail?id=56845

In the future, Chrome (and other browsers) will allow developers to enable automatic rotation also for images displayed using img tags using the CSS image rotation property: https://bugs.chromium.org/p/chromium/issues/detail?id = 158753

+5
source

Source: https://habr.com/ru/post/978482/


All Articles