1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
package exif
type FieldName string
// UnknownPrefix is used as the first part of field names for decoded tags for
// which there is no known/supported EXIF field.
const UnknownPrefix = "UnknownTag_"
// Primary EXIF fields
const (
ImageWidth FieldName = "ImageWidth"
ImageLength FieldName = "ImageLength" // Image height called Length by EXIF spec
BitsPerSample FieldName = "BitsPerSample"
Compression FieldName = "Compression"
PhotometricInterpretation FieldName = "PhotometricInterpretation"
Orientation FieldName = "Orientation"
SamplesPerPixel FieldName = "SamplesPerPixel"
PlanarConfiguration FieldName = "PlanarConfiguration"
YCbCrSubSampling FieldName = "YCbCrSubSampling"
YCbCrPositioning FieldName = "YCbCrPositioning"
XResolution FieldName = "XResolution"
YResolution FieldName = "YResolution"
ResolutionUnit FieldName = "ResolutionUnit"
DateTime FieldName = "DateTime"
ImageDescription FieldName = "ImageDescription"
Make FieldName = "Make"
Model FieldName = "Model"
Software FieldName = "Software"
Artist FieldName = "Artist"
Copyright FieldName = "Copyright"
ExifIFDPointer FieldName = "ExifIFDPointer"
GPSInfoIFDPointer FieldName = "GPSInfoIFDPointer"
InteroperabilityIFDPointer FieldName = "InteroperabilityIFDPointer"
ExifVersion FieldName = "ExifVersion"
FlashpixVersion FieldName = "FlashpixVersion"
ColorSpace FieldName = "ColorSpace"
ComponentsConfiguration FieldName = "ComponentsConfiguration"
CompressedBitsPerPixel FieldName = "CompressedBitsPerPixel"
PixelXDimension FieldName = "PixelXDimension"
PixelYDimension FieldName = "PixelYDimension"
MakerNote FieldName = "MakerNote"
UserComment FieldName = "UserComment"
RelatedSoundFile FieldName = "RelatedSoundFile"
DateTimeOriginal FieldName = "DateTimeOriginal"
DateTimeDigitized FieldName = "DateTimeDigitized"
SubSecTime FieldName = "SubSecTime"
SubSecTimeOriginal FieldName = "SubSecTimeOriginal"
SubSecTimeDigitized FieldName = "SubSecTimeDigitized"
ImageUniqueID FieldName = "ImageUniqueID"
ExposureTime FieldName = "ExposureTime"
FNumber FieldName = "FNumber"
ExposureProgram FieldName = "ExposureProgram"
SpectralSensitivity FieldName = "SpectralSensitivity"
ISOSpeedRatings FieldName = "ISOSpeedRatings"
OECF FieldName = "OECF"
ShutterSpeedValue FieldName = "ShutterSpeedValue"
ApertureValue FieldName = "ApertureValue"
BrightnessValue FieldName = "BrightnessValue"
ExposureBiasValue FieldName = "ExposureBiasValue"
MaxApertureValue FieldName = "MaxApertureValue"
SubjectDistance FieldName = "SubjectDistance"
MeteringMode FieldName = "MeteringMode"
LightSource FieldName = "LightSource"
Flash FieldName = "Flash"
FocalLength FieldName = "FocalLength"
SubjectArea FieldName = "SubjectArea"
FlashEnergy FieldName = "FlashEnergy"
SpatialFrequencyResponse FieldName = "SpatialFrequencyResponse"
FocalPlaneXResolution FieldName = "FocalPlaneXResolution"
FocalPlaneYResolution FieldName = "FocalPlaneYResolution"
FocalPlaneResolutionUnit FieldName = "FocalPlaneResolutionUnit"
SubjectLocation FieldName = "SubjectLocation"
ExposureIndex FieldName = "ExposureIndex"
SensingMethod FieldName = "SensingMethod"
FileSource FieldName = "FileSource"
SceneType FieldName = "SceneType"
CFAPattern FieldName = "CFAPattern"
CustomRendered FieldName = "CustomRendered"
ExposureMode FieldName = "ExposureMode"
WhiteBalance FieldName = "WhiteBalance"
DigitalZoomRatio FieldName = "DigitalZoomRatio"
FocalLengthIn35mmFilm FieldName = "FocalLengthIn35mmFilm"
SceneCaptureType FieldName = "SceneCaptureType"
GainControl FieldName = "GainControl"
Contrast FieldName = "Contrast"
Saturation FieldName = "Saturation"
Sharpness FieldName = "Sharpness"
DeviceSettingDescription FieldName = "DeviceSettingDescription"
SubjectDistanceRange FieldName = "SubjectDistanceRange"
LensMake FieldName = "LensMake"
LensModel FieldName = "LensModel"
)
// thumbnail fields
const (
ThumbJPEGInterchangeFormat FieldName = "ThumbJPEGInterchangeFormat" // offset to thumb jpeg SOI
ThumbJPEGInterchangeFormatLength FieldName = "ThumbJPEGInterchangeFormatLength" // byte length of thumb
)
// GPS fields
const (
GPSVersionID FieldName = "GPSVersionID"
GPSLatitudeRef FieldName = "GPSLatitudeRef"
GPSLatitude FieldName = "GPSLatitude"
GPSLongitudeRef FieldName = "GPSLongitudeRef"
GPSLongitude FieldName = "GPSLongitude"
GPSAltitudeRef FieldName = "GPSAltitudeRef"
GPSAltitude FieldName = "GPSAltitude"
GPSTimeStamp FieldName = "GPSTimeStamp"
GPSSatelites FieldName = "GPSSatelites"
GPSStatus FieldName = "GPSStatus"
GPSMeasureMode FieldName = "GPSMeasureMode"
GPSDOP FieldName = "GPSDOP"
GPSSpeedRef FieldName = "GPSSpeedRef"
GPSSpeed FieldName = "GPSSpeed"
GPSTrackRef FieldName = "GPSTrackRef"
GPSTrack FieldName = "GPSTrack"
GPSImgDirectionRef FieldName = "GPSImgDirectionRef"
GPSImgDirection FieldName = "GPSImgDirection"
GPSMapDatum FieldName = "GPSMapDatum"
GPSDestLatitudeRef FieldName = "GPSDestLatitudeRef"
GPSDestLatitude FieldName = "GPSDestLatitude"
GPSDestLongitudeRef FieldName = "GPSDestLongitudeRef"
GPSDestLongitude FieldName = "GPSDestLongitude"
GPSDestBearingRef FieldName = "GPSDestBearingRef"
GPSDestBearing FieldName = "GPSDestBearing"
GPSDestDistanceRef FieldName = "GPSDestDistanceRef"
GPSDestDistance FieldName = "GPSDestDistance"
GPSProcessingMethod FieldName = "GPSProcessingMethod"
GPSAreaInformation FieldName = "GPSAreaInformation"
GPSDateStamp FieldName = "GPSDateStamp"
GPSDifferential FieldName = "GPSDifferential"
)
// interoperability fields
const (
InteroperabilityIndex FieldName = "InteroperabilityIndex"
)
var exifFields = map[uint16]FieldName{
/////////////////////////////////////
////////// IFD 0 ////////////////////
/////////////////////////////////////
// image data structure for the thumbnail
0x0100: ImageWidth,
0x0101: ImageLength,
0x0102: BitsPerSample,
0x0103: Compression,
0x0106: PhotometricInterpretation,
0x0112: Orientation,
0x0115: SamplesPerPixel,
0x011C: PlanarConfiguration,
0x0212: YCbCrSubSampling,
0x0213: YCbCrPositioning,
0x011A: XResolution,
0x011B: YResolution,
0x0128: ResolutionUnit,
// Other tags
0x0132: DateTime,
0x010E: ImageDescription,
0x010F: Make,
0x0110: Model,
0x0131: Software,
0x013B: Artist,
0x8298: Copyright,
// private tags
exifPointer: ExifIFDPointer,
/////////////////////////////////////
////////// Exif sub IFD /////////////
/////////////////////////////////////
gpsPointer: GPSInfoIFDPointer,
interopPointer: InteroperabilityIFDPointer,
0x9000: ExifVersion,
0xA000: FlashpixVersion,
0xA001: ColorSpace,
0x9101: ComponentsConfiguration,
0x9102: CompressedBitsPerPixel,
0xA002: PixelXDimension,
0xA003: PixelYDimension,
0x927C: MakerNote,
0x9286: UserComment,
0xA004: RelatedSoundFile,
0x9003: DateTimeOriginal,
0x9004: DateTimeDigitized,
0x9290: SubSecTime,
0x9291: SubSecTimeOriginal,
0x9292: SubSecTimeDigitized,
0xA420: ImageUniqueID,
// picture conditions
0x829A: ExposureTime,
0x829D: FNumber,
0x8822: ExposureProgram,
0x8824: SpectralSensitivity,
0x8827: ISOSpeedRatings,
0x8828: OECF,
0x9201: ShutterSpeedValue,
0x9202: ApertureValue,
0x9203: BrightnessValue,
0x9204: ExposureBiasValue,
0x9205: MaxApertureValue,
0x9206: SubjectDistance,
0x9207: MeteringMode,
0x9208: LightSource,
0x9209: Flash,
0x920A: FocalLength,
0x9214: SubjectArea,
0xA20B: FlashEnergy,
0xA20C: SpatialFrequencyResponse,
0xA20E: FocalPlaneXResolution,
0xA20F: FocalPlaneYResolution,
0xA210: FocalPlaneResolutionUnit,
0xA214: SubjectLocation,
0xA215: ExposureIndex,
0xA217: SensingMethod,
0xA300: FileSource,
0xA301: SceneType,
0xA302: CFAPattern,
0xA401: CustomRendered,
0xA402: ExposureMode,
0xA403: WhiteBalance,
0xA404: DigitalZoomRatio,
0xA405: FocalLengthIn35mmFilm,
0xA406: SceneCaptureType,
0xA407: GainControl,
0xA408: Contrast,
0xA409: Saturation,
0xA40A: Sharpness,
0xA40B: DeviceSettingDescription,
0xA40C: SubjectDistanceRange,
0xA433: LensMake,
0xA434: LensModel,
}
var gpsFields = map[uint16]FieldName{
/////////////////////////////////////
//// GPS sub-IFD ////////////////////
/////////////////////////////////////
0x0: GPSVersionID,
0x1: GPSLatitudeRef,
0x2: GPSLatitude,
0x3: GPSLongitudeRef,
0x4: GPSLongitude,
0x5: GPSAltitudeRef,
0x6: GPSAltitude,
0x7: GPSTimeStamp,
0x8: GPSSatelites,
0x9: GPSStatus,
0xA: GPSMeasureMode,
0xB: GPSDOP,
0xC: GPSSpeedRef,
0xD: GPSSpeed,
0xE: GPSTrackRef,
0xF: GPSTrack,
0x10: GPSImgDirectionRef,
0x11: GPSImgDirection,
0x12: GPSMapDatum,
0x13: GPSDestLatitudeRef,
0x14: GPSDestLatitude,
0x15: GPSDestLongitudeRef,
0x16: GPSDestLongitude,
0x17: GPSDestBearingRef,
0x18: GPSDestBearing,
0x19: GPSDestDistanceRef,
0x1A: GPSDestDistance,
0x1B: GPSProcessingMethod,
0x1C: GPSAreaInformation,
0x1D: GPSDateStamp,
0x1E: GPSDifferential,
}
var interopFields = map[uint16]FieldName{
/////////////////////////////////////
//// Interoperability sub-IFD ///////
/////////////////////////////////////
0x1: InteroperabilityIndex,
}
var thumbnailFields = map[uint16]FieldName{
0x0201: ThumbJPEGInterchangeFormat,
0x0202: ThumbJPEGInterchangeFormatLength,
}
|