exif

来源:互联网 发布:access的数据库类型是 编辑:程序博客网 时间:2024/05/01 19:07

 

非压缩格式使用tiff结构, 包含0/1 ifd.

压缩格式的使用app1/2来包含exif属性信息。app1包含tiff结构的信息, app2包含flashpix扩展。一个app的长度不超过64kb, 多个app2用于表示超过64kb的数据。

 

ifd由12字节的tag域组成

tag id (2b)

type(2b)

count(4b)

offset(4b)

 

 

Type
The following types are used in Exif:
1 = BYTE An 8-bit unsigned integer.,
2 = ASCII An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.,
3 = SHORT A 16-bit (2-byte) unsigned integer,
4 = LONG A 32-bit (4-byte) unsigned integer,
5 = RATIONAL Two LONGs. The first LONG is the numerator and the second LONG expresses the
denominator.,
7 = UNDEFINED An 8-bit byte that can take any value depending on the field definition,
9 = SLONG A 32-bit (4-byte) signed integer (2's complement notation),
10 = SRATIONAL Two SLONGs. The first SLONG is the numerator and the second SLONG is the
denominator.

 

 

count记录value的数量, 和type一起决定tag的value的长度

value offset是相对于tiff header到value被记录的位置。

In
cases where the value fits in 4 bytes, the value itself is recorded. If the value is smaller than 4 bytes, the value is
stored in the 4-byte area starting from the left, i.e., from the lower end of the byte offset area. For example, in big
endian format, if the type is SHORT and the value is 1, it is recorded as 00010000.H.

 

 

 

exif ifd: tag:0x8769(exif属性)

gps ifd: tag:0x8825

Interoperability IFD: tag:0xa005(在exif ifd中)

 

 

mpo的由多个有soi/eoi组成的image组成。每个里面包含app1/app2和image, app1包含exif属性, app2包含mp扩展信息。

第一张soi/eoi的app2包含mp index ifd, 指出后面的image的偏移量, 其他image只包含mp attribute ifd,

 

 

比较重要的tag有w,h, 方向, makernote, 等。

 offset往往是相对于相应的header来讲的。

 

除第一张以外的其它image的offset是相对于第一张图的app2的marker之后的字节开始的。