Exif 是什么?
Exif就是用来记录拍摄图像时的各种信息:图像信息(厂商,分辨率等),相机拍摄记录(ISO,白平衡,饱和度,锐度等),缩略图(缩略图宽度,高度等),gps(拍摄时的经度,纬度,高度)等,将这些信息按照JPEG文件标准放在图像文件头部。
Exchangeable Image File(可交换图像文件)的缩写,
最初由日本电子工业发展协会(JEIDA --Japan Electronic Industry Development Association) 制订,目前的最新版本是2.21 版。国际标准化组织(ISO)正在制订的相机文件设计标准(DCF -- Design role for Camera File system)可能以Exif2.1为基础。
Exif 文件实际是JPEG文件的一种,遵从JPEG标准,只是在文件头信息中增加了有关拍摄信息的内容和索引图。所以你可以使用任何支持JPEG格式的图像工具软件观看或修改Exif文件,但打开时可能看不到Exif信息,一旦修改,Exif信息可能丢失。
简单来说,EXIF 信息就是由数码相机在拍摄过程中采集一系列的信息,然后把信息放置在我们熟知的 JPEG/TIFF 文件的头部, 也就是说 EXIF 信息是镶嵌在 JPEG/TIFF 图像文件格式内的一组拍摄参数,主要包括摄影时的光圈、快门、ISO、日期时间等各种与当时摄影条件相关的讯息,相机品牌型号,色彩编码,拍摄时录制的声音以及全球定位系统(GPS)等信息。
简单的说,它就好像是傻瓜相机的日期打印功能一样,只不过 EXIF 信息所记录的资讯更为详尽和完备。
最初由日本电子工业发展协会(JEIDA --Japan Electronic Industry Development Association) 制订,目前的最新版本是2.21 版。国际标准化组织(ISO)正在制订的相机文件设计标准(DCF -- Design role for Camera File system)可能以Exif2.1为基础。
Exif 文件实际是JPEG文件的一种,遵从JPEG标准,只是在文件头信息中增加了有关拍摄信息的内容和索引图。所以你可以使用任何支持JPEG格式的图像工具软件观看或修改Exif文件,但打开时可能看不到Exif信息,一旦修改,Exif信息可能丢失。
简单来说,EXIF 信息就是由数码相机在拍摄过程中采集一系列的信息,然后把信息放置在我们熟知的 JPEG/TIFF 文件的头部, 也就是说 EXIF 信息是镶嵌在 JPEG/TIFF 图像文件格式内的一组拍摄参数,主要包括摄影时的光圈、快门、ISO、日期时间等各种与当时摄影条件相关的讯息,相机品牌型号,色彩编码,拍摄时录制的声音以及全球定位系统(GPS)等信息。
简单的说,它就好像是傻瓜相机的日期打印功能一样,只不过 EXIF 信息所记录的资讯更为详尽和完备。
如何查看Exif信息
在window系统中可以通过右键查找图片信息中获得较为详细的Exif信息。
要想获得全部的标准的Exif信息,可以使用其他专业的软件,就是CADsee可以,但是没有试过,这里使用一个Exif查看工具
Opanda PowerExif,
可以更加全面的查看相关的属性。
实例
分析
:PICT0021.JPG
00 FF D8 FF E1 3A 59 45 78 69 66 00 00 4D 4D 00 2A
10 00 00 00 08 00 0C 01 0E 00 02 00 00 00 0E 00 00
20 03 F4 01 0F 00 02 00 00 00 20 00 00 04 02 01 10
30 00 02 00 00 00 20 00 00 04 22 01 12 00 03 00 00
40 00 01 00 01 00 00 01 1A 00 05 00 00 00 01 00 00
50 04 42 01 1B 00 05 00 00 00 01 00 00 04 4A 01 28
60 00 03 00 00 00 01 00 02 00 00 01 31 00 02 00 00
70 00 20 00 00 04 52 01 32 00 02 00 00 00 14 00 00
80 04 72 02 13 00 03 00 00 00 01 00 01 00 00 87 69
90 00 04 00 00 00 01 00 00 00 9E 88 25 00 04 00 00
A0 00 01 00 00 02 A2 00 00 02 E4 00 28 82 9A 00 05
B0 00 00 00 01 00 00 04 86 82 9D 00 05 00 00 00 01
C0 00 00 04 8E 88 22 00 03 00 00 00 01 00 02 00 00
D0 88 27 00 03 00 00 00 01 00 C8 00 00 90 00 00 07
E0 00 00 00 04 30 32 32 31 90 03 00 02 00 00 00 14
F0 00 00 04 96 90 04 00 02 00 00 00 14 00 00 04 AA
100 91 01 00 07 00 00 00 04 01 02 03 00 91 02 00 05
110 00 00 00 01 00 00 04 BE 92 01 00 0A 00 00 00 01
120 00 00 04 C6 92 02 00 05 00 00 00 01 00 00 04 CE
130 92 04 00 0A 00 00 00 01 00 00 04 D6 92 05 00 05
140 00 00 00 01 00 00 04 DE 92 06 00 05 00 00 00 01
150 00 00 04 E6 92 07 00 03 00 00 00 01 00 02 00 00
160 92 08 00 03 00 00 00 01 00 00 00 00 92 09 00 03
170 00 00 00 01 00 20 00 00 92 0A 00 05 00 00 00 01
180 00 00 04 EE 92 7C 00 07 00 00 00 40 00 00 04 F6
190 A0 00 00 07 00 00 00 04 30 31 30 30 A0 01 00 03
1A0 00 00 00 01 00 01 00 00 A0 02 00 04 00 00 00 01
1B0 00 00 12 00 A0 03 00 04 00 00 00 01 00 00 0D 80
1C0 A0 05 00 04 00 00 00 01 00 00 02 84 A2 15 00 05
1D0 00 00 00 01 00 00 05 36 A2 17 00 03 00 00 00 01
1E0 00 02 00 00 A3 00 00 07 00 00 00 01 03 00 00 00
1F0 A3 01 00 07 00 00 00 01 01 00 00 00 A4 01 00 03
200 00 00 00 01 00 00 00 00 A4 02 00 03 00 00 00 01
210 00 00 00 00 A4 03 00 03 00 00 00 01 00 00 00 00
220 A4 04 00 05 00 00 00 01 00 00 05 3E A4 05 00 03
230 00 00 00 01 00 29 00 00 A4 06 00 03 00 00 00 01
240 00 00 00 00 A4 07 00 03 00 00 00 01 00 00 00 00
250 A4 08 00 03 00 00 00 01 00 00 00 00 A4 09 00 03
260 00 00 00 01 00 00 00 00 A4 0A 00 03 00 00 00 01
270 00 00 00 00 A4 0B 00 07 00 00 00 04 00 00 00 00
280 A4 0C 00 03 00 00 00 01 00 00 00 00 00 00 00 00
290 00 02 00 01 00 02 00 00 00 04 52 39 38 00 00 02
2A0 00 07 00 00 00 04 30 31 30 30 00 00 00 00 00 05
2B0 00 00 00 01 00 00 00 04 02 02 00 00 00 01 00 02
2C0 00 00 00 02 4E 00 00 00 00 02 00 05 00 00 00 03
2D0 00 00 05 46 00 03 00 02 00 00 00 02 45 00 00 00
2E0 00 04 00 05 00 00 00 03 00 00 05 5E 00 00 00 00
2F0 00 06 01 03 00 03 00 00 00 01 00 06 00 00 01 1A
300 00 05 00 00 00 01 00 00 05 76 01 1B 00 05 00 00
310 00 01 00 00 05 7E 01 28 00 03 00 00 00 01 00 02
320 00 00 02 01 00 04 00 00 00 01 00 00 07 F4 02 02
330 00 04 00 00 00 01 00 00 32 5D 00 00 00 00 00 00
FF D8 SOI
FF E1 APP1
3A 59 APP1 LENGTH
45 78 69 66 00 00 Exif ASCII结束符两个
4D 4D MM big endian TIFF Header (注意小端的为:49492A00 08000000)
00 2A fixed
00 00 00 08 IFD0 offset
00 0C IFD0: number of TAGs 12个tag,每个12字节。
01 0E TAG Image title
00 02 TYPE ASCII
00 00 00 0E count 最多13个字符
00 00 03 F4 offset +0C=0x400 可以看到DCIM\100MEDIA (0x0c from the start of the TIFF header 4D4D MM)
01 0F TAG Image input equipment manuf
00 02 TYPE ASCII
00 00 00 20 count 最多31个字符
00 00 04 02 offset +0c=0x040E 可以看到TCL
01 10 TAG Image input equipment model
00 02 TYPE ASCII
00 00 00 20 count
00 00 04 22 offset +0c=0x042E 可以看到SDV05
01 12 TAG Orientation of image
00 03 SHORT 00 01
00 00 00 01 count
00 01 00 00 value
01 1A TAG Image resolution in width 0x0442+0c=0x44E,可以看到00 00 00 48/00 00 00 01
00 05 RATIONAL
00 00 00 01 count
00 00 04 42 offset +0c=0x44E,可以看到00 00 00 48/00 00 00 01
01 1B TAG Image resolution in height
00 05 RATIONAL
00 00 00 01
00 00 04 4A offset+0c=0x456 可以看到00 00 00 48/00 00 00 01
01 28 Unit of X and Y resolution
00 03 SHORT 00 02
00 00 00 01
00 02 00 00
01 31 Software used
00 02 ASCII
00 00 00 20 count
00 00 04 52 offset +0c =0x45E 可以看到0.0.2
01 32 DateTime
00 02 ASCII
00 00 00 14 20字节
00 00 04 72 offset+0c=0x47E,可以看到2012:07:29 21:28:18
02 13 YCbCrPositioning
00 03 SHORT 00 01
00 00 00 01
00 01 00 00
87 69 Exif IFD Pointer
00 04 LONG
00 00 00 01 count
00 00 00 9E offset+0c=0xAA
88 25 GPS Info IFD Pointer
00 04 LONG
00 00 00 01 count
00 00 02 A2 offset+0c=0x02AE
00 00 02 E4 nextIFD IFD1 offset
00 28 Exif IFD number of TAGs
82 9A ExposureTime
00 05 RATIONAL
00 00 00 01 count
00 00 04 86 offset+0c=0x0492
...
00 05 count of TAGs
00 00 GPSVersionID
00 01 BYTE
00 00 00 04 count
02 02 00 00 value 2.2.0.0
00 01 GPSLatitudeRef
00 02 ASCII
00 00 00 02 count
4E 00 00 00 N North
00 02 GPSLatitude
00 05 RATIONAL 前4字节为分子,后4字节为分母,十六进制先转为十进制
00 00 00 03 count
00 00 05 46 offset+0c=0x552 16 00 00 00 01 00 00 00 22 00 00 00 01 00 00 00 51 00 00 00 04 00 00 00
22/1=22 34/1=34 81/4= 20.25
通过windows的右键属性看详细 信息 :22;34;20.249999999999915
00 03 GPSLongitudeRef
00 02
00 00 00 02 count
45 00 00 00 East
00 04 GPSLongitude
00 05 RATIONAL
00 00 00 03 count
00 00 05 5E offset+0c=0x56A 71 00 00 00 01 00 00 00 37 00 00 00 01 00 00 00 6C 00 00 00 04 00
113/1=113 55/1=55 108/4=27
通过windows的右键属性看详细 信息 :113;55;27.000000000000171
550 04 00 16 00 00 00 01 00 00 00 22 00 00 00 01 00
560 00 00 51 00 00 00 04 00 00 00 71 00 00 00 01 00
570 00 00 37 00 00 00 01 00 00 00 6C 00 00 00 04 00
580 00 00 00 00 00 48 00 00 00 01 00 00 00 48 00 00
590 00 01 00 00 00 00 00 00
00 FF D8 FF E1 3A 59 45 78 69 66 00 00 4D 4D 00 2A
10 00 00 00 08 00 0C 01 0E 00 02 00 00 00 0E 00 00
20 03 F4 01 0F 00 02 00 00 00 20 00 00 04 02 01 10
30 00 02 00 00 00 20 00 00 04 22 01 12 00 03 00 00
40 00 01 00 01 00 00 01 1A 00 05 00 00 00 01 00 00
50 04 42 01 1B 00 05 00 00 00 01 00 00 04 4A 01 28
60 00 03 00 00 00 01 00 02 00 00 01 31 00 02 00 00
70 00 20 00 00 04 52 01 32 00 02 00 00 00 14 00 00
80 04 72 02 13 00 03 00 00 00 01 00 01 00 00 87 69
90 00 04 00 00 00 01 00 00 00 9E 88 25 00 04 00 00
A0 00 01 00 00 02 A2 00 00 02 E4 00 28 82 9A 00 05
B0 00 00 00 01 00 00 04 86 82 9D 00 05 00 00 00 01
C0 00 00 04 8E 88 22 00 03 00 00 00 01 00 02 00 00
D0 88 27 00 03 00 00 00 01 00 C8 00 00 90 00 00 07
E0 00 00 00 04 30 32 32 31 90 03 00 02 00 00 00 14
F0 00 00 04 96 90 04 00 02 00 00 00 14 00 00 04 AA
100 91 01 00 07 00 00 00 04 01 02 03 00 91 02 00 05
110 00 00 00 01 00 00 04 BE 92 01 00 0A 00 00 00 01
120 00 00 04 C6 92 02 00 05 00 00 00 01 00 00 04 CE
130 92 04 00 0A 00 00 00 01 00 00 04 D6 92 05 00 05
140 00 00 00 01 00 00 04 DE 92 06 00 05 00 00 00 01
150 00 00 04 E6 92 07 00 03 00 00 00 01 00 02 00 00
160 92 08 00 03 00 00 00 01 00 00 00 00 92 09 00 03
170 00 00 00 01 00 20 00 00 92 0A 00 05 00 00 00 01
180 00 00 04 EE 92 7C 00 07 00 00 00 40 00 00 04 F6
190 A0 00 00 07 00 00 00 04 30 31 30 30 A0 01 00 03
1A0 00 00 00 01 00 01 00 00 A0 02 00 04 00 00 00 01
1B0 00 00 12 00 A0 03 00 04 00 00 00 01 00 00 0D 80
1C0 A0 05 00 04 00 00 00 01 00 00 02 84 A2 15 00 05
1D0 00 00 00 01 00 00 05 36 A2 17 00 03 00 00 00 01
1E0 00 02 00 00 A3 00 00 07 00 00 00 01 03 00 00 00
1F0 A3 01 00 07 00 00 00 01 01 00 00 00 A4 01 00 03
200 00 00 00 01 00 00 00 00 A4 02 00 03 00 00 00 01
210 00 00 00 00 A4 03 00 03 00 00 00 01 00 00 00 00
220 A4 04 00 05 00 00 00 01 00 00 05 3E A4 05 00 03
230 00 00 00 01 00 29 00 00 A4 06 00 03 00 00 00 01
240 00 00 00 00 A4 07 00 03 00 00 00 01 00 00 00 00
250 A4 08 00 03 00 00 00 01 00 00 00 00 A4 09 00 03
260 00 00 00 01 00 00 00 00 A4 0A 00 03 00 00 00 01
270 00 00 00 00 A4 0B 00 07 00 00 00 04 00 00 00 00
280 A4 0C 00 03 00 00 00 01 00 00 00 00 00 00 00 00
290 00 02 00 01 00 02 00 00 00 04 52 39 38 00 00 02
2A0 00 07 00 00 00 04 30 31 30 30 00 00 00 00 00 05
2B0 00 00 00 01 00 00 00 04 02 02 00 00 00 01 00 02
2C0 00 00 00 02 4E 00 00 00 00 02 00 05 00 00 00 03
2D0 00 00 05 46 00 03 00 02 00 00 00 02 45 00 00 00
2E0 00 04 00 05 00 00 00 03 00 00 05 5E 00 00 00 00
2F0 00 06 01 03 00 03 00 00 00 01 00 06 00 00 01 1A
300 00 05 00 00 00 01 00 00 05 76 01 1B 00 05 00 00
310 00 01 00 00 05 7E 01 28 00 03 00 00 00 01 00 02
320 00 00 02 01 00 04 00 00 00 01 00 00 07 F4 02 02
330 00 04 00 00 00 01 00 00 32 5D 00 00 00 00 00 00
FF D8 SOI
FF E1 APP1
3A 59 APP1 LENGTH
45 78 69 66 00 00 Exif ASCII结束符两个
4D 4D MM big endian TIFF Header (注意小端的为:49492A00 08000000)
00 2A fixed
00 00 00 08 IFD0 offset
00 0C IFD0: number of TAGs 12个tag,每个12字节。
01 0E TAG Image title
00 02 TYPE ASCII
00 00 00 0E count 最多13个字符
00 00 03 F4 offset +0C=0x400 可以看到DCIM\100MEDIA (0x0c from the start of the TIFF header 4D4D MM)
01 0F TAG Image input equipment manuf
00 02 TYPE ASCII
00 00 00 20 count 最多31个字符
00 00 04 02 offset +0c=0x040E 可以看到TCL
01 10 TAG Image input equipment model
00 02 TYPE ASCII
00 00 00 20 count
00 00 04 22 offset +0c=0x042E 可以看到SDV05
01 12 TAG Orientation of image
00 03 SHORT 00 01
00 00 00 01 count
00 01 00 00 value
01 1A TAG Image resolution in width 0x0442+0c=0x44E,可以看到00 00 00 48/00 00 00 01
00 05 RATIONAL
00 00 00 01 count
00 00 04 42 offset +0c=0x44E,可以看到00 00 00 48/00 00 00 01
01 1B TAG Image resolution in height
00 05 RATIONAL
00 00 00 01
00 00 04 4A offset+0c=0x456 可以看到00 00 00 48/00 00 00 01
01 28 Unit of X and Y resolution
00 03 SHORT 00 02
00 00 00 01
00 02 00 00
01 31 Software used
00 02 ASCII
00 00 00 20 count
00 00 04 52 offset +0c =0x45E 可以看到0.0.2
01 32 DateTime
00 02 ASCII
00 00 00 14 20字节
00 00 04 72 offset+0c=0x47E,可以看到2012:07:29 21:28:18
02 13 YCbCrPositioning
00 03 SHORT 00 01
00 00 00 01
00 01 00 00
87 69 Exif IFD Pointer
00 04 LONG
00 00 00 01 count
00 00 00 9E offset+0c=0xAA
88 25 GPS Info IFD Pointer
00 04 LONG
00 00 00 01 count
00 00 02 A2 offset+0c=0x02AE
00 00 02 E4 nextIFD IFD1 offset
00 28 Exif IFD number of TAGs
82 9A ExposureTime
00 05 RATIONAL
00 00 00 01 count
00 00 04 86 offset+0c=0x0492
...
Exif的相关信息这里先不做分析,请大家参照上面的文档自己分析了。
这里主要是分析GPS相关信息
GPS Info IFD Pointer 0x02AE 从上面数据2A0行的后面看数据00 05 count of TAGs
00 00 GPSVersionID
00 01 BYTE
00 00 00 04 count
02 02 00 00 value 2.2.0.0
00 01 GPSLatitudeRef
00 02 ASCII
00 00 00 02 count
4E 00 00 00 N North
00 02 GPSLatitude
00 05 RATIONAL 前4字节为分子,后4字节为分母,十六进制先转为十进制
00 00 00 03 count
00 00 05 46 offset+0c=0x552 16 00 00 00 01 00 00 00 22 00 00 00 01 00 00 00 51 00 00 00 04 00 00 00
22/1=22 34/1=34 81/4= 20.25
通过windows的右键属性看详细 信息 :22;34;20.249999999999915
00 03 GPSLongitudeRef
00 02
00 00 00 02 count
45 00 00 00 East
00 04 GPSLongitude
00 05 RATIONAL
00 00 00 03 count
00 00 05 5E offset+0c=0x56A 71 00 00 00 01 00 00 00 37 00 00 00 01 00 00 00 6C 00 00 00 04 00
113/1=113 55/1=55 108/4=27
通过windows的右键属性看详细 信息 :113;55;27.000000000000171
550 04 00 16 00 00 00 01 00 00 00 22 00 00 00 01 00
560 00 00 51 00 00 00 04 00 00 00 71 00 00 00 01 00
570 00 00 37 00 00 00 01 00 00 00 6C 00 00 00 04 00
580 00 00 00 00 00 48 00 00 00 01 00 00 00 48 00 00
590 00 01 00 00 00 00 00 00