Safari Mobile中的EXIF方向问题 [英] EXIF Orientation Issue in Safari Mobile

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

问题描述

我在生产环境中有一个Angle 2应用程序,可让您选择个人资料图片.最近,专门针对IOS 13.3.1版本(旧版本)和IOS 13.4.1(新版本)使用safari mobile执行测试.我注意到根据所使用的野生动物园浏览器版本,图像显示为旋转状态(

I have an angular 2 application in production environment that allows you to choose a profile picture. Recently, performing tests with safari mobile, specifically for IOS 13.3.1 version(older) and IOS 13.4.1(new) version. I noticed that the image is shown rotated depending of safari browser version used (I built a stackblitz for this that you can review):

IOS 13.3.1版本(旧)

IOS 13.4.1(新)

当我以肖像模式从iPhone拍摄图像并将图像上传到我的应用程序时,它显示为仅针对IOS 13.3.1版本(较旧)旋转.但是,我检查了来自每个设备的EXIF元信息图像,发现这两个图像的方向属性具有相同的值:

When I take images from an iPhone's in portrait mode and upload the image to my app it is shown rotated only for IOS 13.3.1 version(older). However, I examined the EXIF ​​meta-information images from each of my devices and found that both images have the same value in the orientation property:

IOS 13.3.1版本(旧)

IOS 13.4.1(新)

我的问题是.知道两种情况下EXIF方向的值都相同(6),为什么图像显示会根据IOS版本而改变?

My question is. Why does the image display change depending on the IOS version, knowing that in both cases the orientation EXIF is the same value (6)?

这是一个令我担心的主题,因为我已经通过根据EXIF方向值旋转图像以使其正确显示来解决此问题(例如,已创建exif.js通过检测exif方向标志来处理这种情况),但是现在新版本的IOS再次出现此问题.我可以用来使代码随着时间的推移可持续发展的代码示例是什么?浏览器之间是否没有共识来管理图像的方向?

This is a subject that worries me since I had already solved this problem by rotating the image depending of EXIF orientation value for its correct display (e.g. exif.js have been created to handle this situation by detecting the exif orientation flag), but this problem now appears again with the new version of IOS. What would be an example of code that I can use to make it sustainable over time? Is there not a consensus among the browsers to manage the orientation of the images?

这种不道德行为的解释是什么?

What is the explanation for this illogical behavior?

非常感谢您!

推荐答案

在您基于EXIF数据上传图像之前,webkit浏览器正在旋转图像,然后应用再次将其应用.我们能够在13.4的新版本(81)的Chrome和Mobile Safari上确认这一点.然后该应用将它们旋转得更远,并且会扭曲.

The webkit browser is rotating the images before you upload them based on the EXIF data then it gets applied again by your app. We were able to confirm this on new (81) version of Chrome and Mobile Safari on 13.4. then the app is rotating them further and it gets twisted.

这篇关于Safari Mobile中的EXIF方向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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