Данные EXIF в TIFF (и другие файлы на основе TIFF, такие как Nikon RAW и многие другие) имеют древовидную структуру. Фактически данные TIFF имеют древовидную структуру, а EXIF представляет собой один узел в дереве. Например, вот дамп метаданных из одного из файлов RAW непосредственно с моей камеры:
TIFF image file directory 1, 27 entries:
New subfile type: 1 (reduced)
image_width = 160
image_length = 120
bits_per_sample, count 3:
8 8 8
Compression: 1 (none)
Photometric interpetation: 2 (RGB)
make = "NIKON CORPORATION"
model = "NIKON D3S"
strip_offsets = 118478
orientation = 1
samples_per_pixel = 3
rows_per_strip = 120
strip_byte_counts = 57600
x_resolution = 300.00
y_resolution = 300.00
Planar configuration: 1 (whole pixels together)
Resolution unit: 2 (inch)
software = "Ver.1.01"
date_time = "2012:08:12 11:43:03"
artist = ""
subIFD, count 2:
176320 176440
reference_black_white, count 6:
0.0000 255.00 0.0000 255.00 0.0000 255.00
Copyright: ""
EXIF IFD = 600
EXIF exposure time: 4.00 ms, 1/250 s
EXIF aperture: f/8.00
EXIF exposure program ID: 3 (Aperture priority)
EXIF film speed iso: 400
EXIF date/time original: 2012:08:12 11:43:03
EXIF date/time digitized: 2012:08:12 11:43:03
EXIF APEX exposure bias: 0.00
EXIF APEX max lens aperture: f/4.00
EXIF metering mode ID: 5 (Pattern)
EXIF light source type ID: 0 (Unknown)
EXIF flash status: 0000h
Did not fire
No strobe return detetction function
Flash mode unknown
Flash function present
No red-eye reduction mode or unknown
EXIF lens physical focal length: 40.0 mm
EXIF manufacturer info, length 117346:
78 105 107 111 110 0 2 16 ...
EXIF user comment, character set ASCII:
EXIF sec fraction date/time: 0.140
EXIF sec fraction date/time original: 0.140
EXIF sec fraction date/time digitized: 0.140
EXIF sensing method ID: 2 (One-chip color area sensor)
EXIF file source equipment type ID: 3 (Digital still camera)
EXIF scene type ID: 1 (Directly photographed)
EXIF sensor color pattern, 2 x 2:
red grn
grn blu
EXIF custom rendering ID: 0 (Normal)
EXIF exposure mode ID: 0 (Auto)
EXIF white ballance ID: 0 (Auto)
EXIF digital zoom ratio: 1.00
EXIF 35mm equivalent focal length: 40 mm
EXIF scene capture type ID: 0 (Standard)
EXIF gain control ID: 1 (Low gain up)
EXIF applied contrast ID: 0 (Normal)
EXIF applied saturation ID: 0 (Normal)
EXIF applied sharpness ID: 0 (Normal)
EXIF distance range ID: 0 (Unknown)
GPS info IFD = 176078
GPS version: 2,2,0,0
GPS latitude reference: N
GPS latitude: 33.00000 deg 22.7547 min 0.0000 sec, = 33.37924
GPS longitude reference: W
GPS longitude: 113.00000 deg 30.9130 min 0.0000 sec, =-113.51522
GPS altitude reference: 0
GPS altitude: 412.0 meters (1351 feet)
GPS time: 18.00 43.00 3.00 (18:43:03.000 UTC)
GPS sat: 08
GPS map datum:
GPS date: 2012:08:12
Original creation date/time: 2012:08:12 11:43:03
TIFF/EP version ID: 1.0.0.0
Reading subdirectory at 176320, 8 entries:
New subfile type: 1 (reduced)
Compression: 6
x_resolution = 300.00
y_resolution = 300.00
Resolution unit: 2 (inch)
jpeg_interchange_fmt = 179968
jpeg_interchange_fmt_len = 1545395
ycbcr_positioning = 2
Reading subdirectory at 176440, 17 entries:
New subfile type: 0 (normal image)
image_width = 4288
image_length = 2844
bits_per_sample = 14
Compression: 1 (none)
Photometric interpetation: 32803 (CFA, color filter array)
strip_offsets, count 407:
1725376 1785408 1845440 1905472 1965504 2025536 2085568 2145600 ...
samples_per_pixel = 1
rows_per_strip = 7
strip_byte_counts, count 407:
60032 60032 60032 60032 60032 60032 60032 60032 ...
x_resolution = 300.00
y_resolution = 300.00
Planar configuration: 1 (whole pixels together)
Resolution unit: 2 (inch)
CFA repeating pattern size: 2 x 2
CFA pattern, count 4:
red grn
grn blu
Sensor layout type: 2 (1-chip color area)
Данные TIFF хранятся в «каталогах» или «IFD», которые могут иметь древовидную структуру. Моя программа, которая выводит эту информацию, использует отступ, чтобы показать древовидную структуру. Обратите внимание, что все данные EXIF находятся в одном каталоге (IFD), и добавлена информация GPS, потому что у меня был подключен приемник GPS, когда снимок был сделан в другом отдельном IFD.
Теги TIFF и EXIF являются стандартными и задокументированы там. Иногда производители добавляют свою личную информацию, используя личные теги. Обратите внимание на тег «Информация производителя EXIF». Это собственность Nikon, и, по-видимому, она содержит некоторую информацию о цветовом балансе.