添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

相机拍摄的图片会有exif信息,有时候会给我们带来烦恼。图片放到windows上可以正常显示,但是mac下确不行。另一种情况是mac先显示正常,传到服务器上就不行了,这是怎么回事呢?原来是exif信息在某些情况下,mac会根据这些信息自动帮你旋转了,有时候反而不是你想要的结果。

图片显示旋转问题Orientation参数
exif信息 这张图真正的信息是649×953的一张图片,你看到是mac帮你旋转了,是根据方向8旋转的,也就是说在这张你看似正确的图片顺时针旋转90度后,才是你真正的图片

EXIF(Exchangeable Image File)是“可交换图像文件”的缩写,当中包含了专门为数码相机的照片而定制的元数据,可以记录数码照片的拍摄参数、缩略图及其他属性信息。
图像一旦被修改,Exif信息可能会永久丢失,故编辑 Exif 必须使用专门的软件。
可以理解成,用来记录照片属性和拍摄数据的。
(可以附加于jpeg等文件中,但png图片中不会有。)
Orientation
EXIF中,有一个 Orientation 参数,用于记录照片生成时的方向。
一共有8个值,分别是:1、2*、3、4*、5*、6、7*、8。
正常情况下,拍照只会出现是1、6、3、8这几个值。2、5、4、7相当于镜像,照像时不会出现这几种情况。1、6、3、8的效果分别是:
1:0度(比如正常情况下我是这样拍摄的)
6:逆时针90度回到正常
3:180度回到正常
8:顺时针90度回到正常
Mac上为什么会是正常的呢?
Mac之所以会显示正常,是因为Mac的图片“预览”功能会自动根据Orientation参数处理照片方向。但实际上,照片是旋转的。
实际参数查看方法:
用Mac的预览的 工具 – 显示检查器 查看图片的EXIF
这里可以看到方向是6(逆时针旋转90度将回到正常)
windows上默认的图片预览工具没有做处理,如果拍摄的时候是旋转的,那显示的也是旋转的。
在Mac上怎么转回来?
用Mac的“预览”功能打开,再Command + S保存,参数就改变了,上传的图片就正了。
于是, Orientation参数就从6(逆时针旋转90度回到正常)变为了1(正常)。
利用专业的修改EXIF的工具

To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.