Chrome Image EXIF方向问题 [英] Chrome Image EXIF Orientation Issue
问题描述
我正在构建一个显示图片的网络应用。大多数照片是由智能手机拍摄的,并且具有EXIF旋转信息。
我公开了一个网址,该网址返回了未经修改的图像blob。
I'm building a web app that shows pictures. Most of the pictures were taken by smart phones and have EXIF rotation information. I'm exposing a url which return the image blob without modification.
我注意到,当我将此网址放入img标签时,Chrome浏览器不尊重EXIF方向数据,但是当我将网址放在chrome地址栏中时,它会显示带有图片的页面,然后它确实尊重EXIF方向。
I've notice that when I put this url in img tag Chrome does not respect the EXIF orientation data but when I put the url in chrome address bar it show a page with the image and then it does respect the EXIF orientation.
对不起,我不能共享图像,我将尝试找到另一个可以共享的示例。
Sorry I can't share the image, I'll try to find another example that I can share.
有人注意到这个问题吗?
Has anyone notice this problem?
推荐答案
出现这种情况的原因是,仅当将图片直接显示在浏览器选项卡中作为主文档时,Chrome才会根据EXIF数据自动旋转图片。
The reason for this behavior is that Chrome auto-rotates pictures based on EXIF data only if they are displayed directly in a browser tab as the main document.
跟踪该实现的相关铬问题如下:
https://bugs.chromium.org/p/chromium/issues/detail?id=56845
The relevant chromium issue that tracked this implementation is the following: https://bugs.chromium.org/p/chromium/issues/detail?id=56845
未来,Chrome(和其他浏览器)将允许开发人员s也可以为具有CSS image-rotation属性的img标签显示的图像启用自动旋转:
https://bugs.chromium.org/p/chromium/issues/detail?id=158753
In the future, Chrome (and other browsers) will allow developers to enable auto-rotation also for images displayed via img tags with the CSS image-rotation property: https://bugs.chromium.org/p/chromium/issues/detail?id=158753
这篇关于Chrome Image EXIF方向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!