Chrome Image EXIF的直接问题 [英] Chrome Image EXIF Orienation Issue

查看:101
本文介绍了Chrome Image EXIF的直接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个展示图片的网络应用程序。大多数照片都是由智能手机拍摄的,并具有EXIF旋转信息。
我正在公开一个url,它不会修改就返回图片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.

我注意到当我把这个URL放在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(和其他浏览器)将会允许开发人员为通过带有CSS图像旋转属性的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆