cul_image_props 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,23 +74,24 @@ def self.process_file(f, opts={})
74
74
  end
75
75
  exif = EXIF_TAGS[0x0128] # resolution unit
76
76
  label = 'Image ' + exif.name
77
+ tag_name = nil
77
78
  if (data[offset+11] == X00)
78
- jfif[label] = IFD_Tag.new(exif.value[1],label,3,[0],offset+11,1)
79
+ tag_name = exif.value[1]
79
80
  elsif (data[offset+11] == X01)
80
- jfif[label] = IFD_Tag.new(exif.value[2],label,3,[0],offset+11,1)
81
+ tag_name = exif.value[2]
81
82
  elsif (data[offset+11] == X02)
82
- jfif[label] = IFD_Tag.new(exif.value[3],label,3,[0],offset+11,1)
83
+ tag_name = exif.value[3]
83
84
  else
84
85
  puts "Unknown jfif tag: #{data[offset+11]}"
85
- jfif[label] = IFD_Tag.new("Unknown",label,3,[0],offset+11,1)
86
+ tag_name = "Unknown"
86
87
  end
88
+ jfif[label] = IFD_Tag.new(tag_name,3,exif,[0],offset+11,1)
87
89
  xres= data[offset+12,2].unpack('n')[0]
88
90
  yres= data[offset+14,2].unpack('n')[0]
89
- exif = EXIF_TAGS[0x011a] # x resolution
90
91
  label = 'Image ' + EXIF_TAGS[0x011a].name
91
- jfif[label] = IFD_Tag.new(xres.to_s,label,5,[xres],offset+12,2)
92
+ jfif[label] = IFD_Tag.new(xres.to_s,5,EXIF_TAGS[0x011a],[xres],offset+12,2)
92
93
  label = 'Image ' + EXIF_TAGS[0x011b].name # y resolution
93
- jfif[label] = IFD_Tag.new(yres.to_s,label,5,[yres],offset+13,2)
94
+ jfif[label] = IFD_Tag.new(yres.to_s,5,EXIF_TAGS[0x011b],[yres],offset+13,2)
94
95
  else
95
96
  if(data.length < fptr + 2)
96
97
  break
@@ -142,10 +142,10 @@ FIELD_TYPES = [
142
142
 
143
143
  # dictionary of main EXIF tag names
144
144
  EXIF_TAGS = {
145
- 0x0100 => TagName.new('ImageWidth'),
146
- 0x0101 => TagName.new('ImageLength'),
147
- 0x0102 => TagName.new('BitsPerSample'),
148
- 0x0103 => TagName.new('Compression',
145
+ 0x0100 => TagEntry.new('ImageWidth'),
146
+ 0x0101 => TagEntry.new('ImageLength'),
147
+ 0x0102 => TagEntry.new('BitsPerSample'),
148
+ 0x0103 => TagEntry.new('Compression',
149
149
  {1 => 'Uncompressed',
150
150
  2 => 'CCITT 1D',
151
151
  3 => 'T4/Group 3 Fax',
@@ -176,15 +176,15 @@ EXIF_TAGS = {
176
176
  34713 => 'Nikon NEF Compressed',
177
177
  65000 => 'Kodak DCR Compressed',
178
178
  65535 => 'Pentax PEF Compressed'}),
179
- 0x0106 => TagName.new('PhotometricInterpretation'),
180
- 0x0107 => TagName.new('Thresholding'),
181
- 0x010A => TagName.new('FillOrder'),
182
- 0x010D => TagName.new('DocumentName'),
183
- 0x010E => TagName.new('ImageDescription'),
184
- 0x010F => TagName.new('Make'),
185
- 0x0110 => TagName.new('Model'),
186
- 0x0111 => TagName.new('StripOffsets'),
187
- 0x0112 => TagName.new('Orientation',
179
+ 0x0106 => TagEntry.new('PhotometricInterpretation'),
180
+ 0x0107 => TagEntry.new('Thresholding'),
181
+ 0x010A => TagEntry.new('FillOrder'),
182
+ 0x010D => TagEntry.new('DocumentName'),
183
+ 0x010E => TagEntry.new('ImageDescription'),
184
+ 0x010F => TagEntry.new('Make'),
185
+ 0x0110 => TagEntry.new('Model'),
186
+ 0x0111 => TagEntry.new('StripOffsets'),
187
+ 0x0112 => TagEntry.new('Orientation',
188
188
  {1 => 'Horizontal (normal)',
189
189
  2 => 'Mirrored horizontal',
190
190
  3 => 'Rotated 180',
@@ -193,46 +193,46 @@ EXIF_TAGS = {
193
193
  6 => 'Rotated 90 CW',
194
194
  7 => 'Mirrored horizontal then rotated 90 CW',
195
195
  8 => 'Rotated 90 CCW'}),
196
- 0x0115 => TagName.new('SamplesPerPixel'),
197
- 0x0116 => TagName.new('RowsPerStrip'),
198
- 0x0117 => TagName.new('StripByteCounts'),
199
- 0x011A => TagName.new('XResolution'),
200
- 0x011B => TagName.new('YResolution'),
201
- 0x011C => TagName.new('PlanarConfiguration'),
202
- 0x011D => TagName.new('PageName', self.method(:ascii_bytes_to_filtered_string)),
203
- 0x0128 => TagName.new('ResolutionUnit',
196
+ 0x0115 => TagEntry.new('SamplesPerPixel'),
197
+ 0x0116 => TagEntry.new('RowsPerStrip'),
198
+ 0x0117 => TagEntry.new('StripByteCounts'),
199
+ 0x011A => TagEntry.new('XResolution'),
200
+ 0x011B => TagEntry.new('YResolution'),
201
+ 0x011C => TagEntry.new('PlanarConfiguration'),
202
+ 0x011D => TagEntry.new('PageName', self.method(:ascii_bytes_to_filtered_string)),
203
+ 0x0128 => TagEntry.new('ResolutionUnit',
204
204
  { 1 => 'Not Absolute',
205
205
  2 => 'Pixels/Inch',
206
206
  3 => 'Pixels/Centimeter' }),
207
- 0x012D => TagName.new('TransferFunction'),
208
- 0x0131 => TagName.new('Software'),
209
- 0x0132 => TagName.new('DateTime'),
210
- 0x013B => TagName.new('Artist'),
211
- 0x013E => TagName.new('WhitePoint'),
212
- 0x013F => TagName.new('PrimaryChromaticities'),
213
- 0x0156 => TagName.new('TransferRange'),
214
- 0x0200 => TagName.new('JPEGProc'),
215
- 0x0201 => TagName.new('JPEGInterchangeFormat'),
216
- 0x0202 => TagName.new('JPEGInterchangeFormatLength'),
217
- 0x0211 => TagName.new('YCbCrCoefficients'),
218
- 0x0212 => TagName.new('YCbCrSubSampling'),
219
- 0x0213 => TagName.new('YCbCrPositioning',
207
+ 0x012D => TagEntry.new('TransferFunction'),
208
+ 0x0131 => TagEntry.new('Software'),
209
+ 0x0132 => TagEntry.new('DateTime'),
210
+ 0x013B => TagEntry.new('Artist'),
211
+ 0x013E => TagEntry.new('WhitePoint'),
212
+ 0x013F => TagEntry.new('PrimaryChromaticities'),
213
+ 0x0156 => TagEntry.new('TransferRange'),
214
+ 0x0200 => TagEntry.new('JPEGProc'),
215
+ 0x0201 => TagEntry.new('JPEGInterchangeFormat'),
216
+ 0x0202 => TagEntry.new('JPEGInterchangeFormatLength'),
217
+ 0x0211 => TagEntry.new('YCbCrCoefficients'),
218
+ 0x0212 => TagEntry.new('YCbCrSubSampling'),
219
+ 0x0213 => TagEntry.new('YCbCrPositioning',
220
220
  {1 => 'Centered',
221
221
  2 => 'Co-sited'}),
222
- 0x0214 => TagName.new('ReferenceBlackWhite'),
222
+ 0x0214 => TagEntry.new('ReferenceBlackWhite'),
223
223
 
224
- 0x4746 => TagName.new('Rating'),
224
+ 0x4746 => TagEntry.new('Rating'),
225
225
 
226
- 0x828D => TagName.new('CFARepeatPatternDim'),
227
- 0x828E => TagName.new('CFAPattern'),
228
- 0x828F => TagName.new('BatteryLevel'),
229
- 0x8298 => TagName.new('Copyright'),
230
- 0x829A => TagName.new('ExposureTime'),
231
- 0x829D => TagName.new('FNumber'),
232
- 0x83BB => TagName.new('IPTC/NAA'),
233
- 0x8769 => TagName.new('ExifOffset'),
234
- 0x8773 => TagName.new('InterColorProfile'),
235
- 0x8822 => TagName.new('ExposureProgram',
226
+ 0x828D => TagEntry.new('CFARepeatPatternDim'),
227
+ 0x828E => TagEntry.new('CFAPattern'),
228
+ 0x828F => TagEntry.new('BatteryLevel'),
229
+ 0x8298 => TagEntry.new('Copyright'),
230
+ 0x829A => TagEntry.new('ExposureTime'),
231
+ 0x829D => TagEntry.new('FNumber'),
232
+ 0x83BB => TagEntry.new('IPTC/NAA'),
233
+ 0x8769 => TagEntry.new('ExifOffset'),
234
+ 0x8773 => TagEntry.new('InterColorProfile'),
235
+ 0x8822 => TagEntry.new('ExposureProgram',
236
236
  {0 => 'Unidentified',
237
237
  1 => 'Manual',
238
238
  2 => 'Program Normal',
@@ -242,14 +242,14 @@ EXIF_TAGS = {
242
242
  6 => 'Program Action',
243
243
  7 => 'Portrait Mode',
244
244
  8 => 'Landscape Mode'}),
245
- 0x8824 => TagName.new('SpectralSensitivity'),
246
- 0x8825 => TagName.new('GPSInfo'),
247
- 0x8827 => TagName.new('ISOSpeedRatings'),
248
- 0x8828 => TagName.new('OECF'),
249
- 0x9000 => TagName.new('ExifVersion', self.method(:ascii_bytes_to_filtered_string)),
250
- 0x9003 => TagName.new('DateTimeOriginal'),
251
- 0x9004 => TagName.new('DateTimeDigitized'),
252
- 0x9101 => TagName.new('ComponentsConfiguration',
245
+ 0x8824 => TagEntry.new('SpectralSensitivity'),
246
+ 0x8825 => TagEntry.new('GPSInfo'),
247
+ 0x8827 => TagEntry.new('ISOSpeedRatings'),
248
+ 0x8828 => TagEntry.new('OECF'),
249
+ 0x9000 => TagEntry.new('ExifVersion', self.method(:ascii_bytes_to_filtered_string)),
250
+ 0x9003 => TagEntry.new('DateTimeOriginal'),
251
+ 0x9004 => TagEntry.new('DateTimeDigitized'),
252
+ 0x9101 => TagEntry.new('ComponentsConfiguration',
253
253
  {0 => '',
254
254
  1 => 'Y',
255
255
  2 => 'Cb',
@@ -257,21 +257,21 @@ EXIF_TAGS = {
257
257
  4 => 'Red',
258
258
  5 => 'Green',
259
259
  6 => 'Blue'}),
260
- 0x9102 => TagName.new('CompressedBitsPerPixel'),
261
- 0x9201 => TagName.new('ShutterSpeedValue'),
262
- 0x9202 => TagName.new('ApertureValue'),
263
- 0x9203 => TagName.new('BrightnessValue'),
264
- 0x9204 => TagName.new('ExposureBiasValue'),
265
- 0x9205 => TagName.new('MaxApertureValue'),
266
- 0x9206 => TagName.new('SubjectDistance'),
267
- 0x9207 => TagName.new('MeteringMode',
260
+ 0x9102 => TagEntry.new('CompressedBitsPerPixel'),
261
+ 0x9201 => TagEntry.new('ShutterSpeedValue'),
262
+ 0x9202 => TagEntry.new('ApertureValue'),
263
+ 0x9203 => TagEntry.new('BrightnessValue'),
264
+ 0x9204 => TagEntry.new('ExposureBiasValue'),
265
+ 0x9205 => TagEntry.new('MaxApertureValue'),
266
+ 0x9206 => TagEntry.new('SubjectDistance'),
267
+ 0x9207 => TagEntry.new('MeteringMode',
268
268
  {0 => 'Unidentified',
269
269
  1 => 'Average',
270
270
  2 => 'CenterWeightedAverage',
271
271
  3 => 'Spot',
272
272
  4 => 'MultiSpot',
273
273
  5 => 'Pattern'}),
274
- 0x9208 => TagName.new('LightSource',
274
+ 0x9208 => TagEntry.new('LightSource',
275
275
  {0 => 'Unknown',
276
276
  1 => 'Daylight',
277
277
  2 => 'Fluorescent',
@@ -290,7 +290,7 @@ EXIF_TAGS = {
290
290
  21 => 'D65',
291
291
  22 => 'D75',
292
292
  255 => 'Other'}),
293
- 0x9209 => TagName.new('Flash',
293
+ 0x9209 => TagEntry.new('Flash',
294
294
  {0 => 'No',
295
295
  1 => 'Fired',
296
296
  5 => 'Fired (?)', # no return sensed
@@ -304,37 +304,37 @@ EXIF_TAGS = {
304
304
  29 => 'Auto Fired (?)',
305
305
  31 => 'Auto Fired (!)',
306
306
  32 => 'Not Available'}),
307
- 0x920A => TagName.new('FocalLength'),
308
- 0x9214 => TagName.new('SubjectArea'),
309
- 0x927C => TagName.new('MakerNote'),
310
- 0x9286 => TagName.new('UserComment', self.method(:filter_encoded_string)),
311
- 0x9290 => TagName.new('SubSecTime'),
312
- 0x9291 => TagName.new('SubSecTimeOriginal'),
313
- 0x9292 => TagName.new('SubSecTimeDigitized'),
307
+ 0x920A => TagEntry.new('FocalLength'),
308
+ 0x9214 => TagEntry.new('SubjectArea'),
309
+ 0x927C => TagEntry.new('MakerNote'),
310
+ 0x9286 => TagEntry.new('UserComment', self.method(:filter_encoded_string)),
311
+ 0x9290 => TagEntry.new('SubSecTime'),
312
+ 0x9291 => TagEntry.new('SubSecTimeOriginal'),
313
+ 0x9292 => TagEntry.new('SubSecTimeDigitized'),
314
314
 
315
315
  # used by Windows Explorer
316
- 0x9C9B => TagName.new('XPTitle'),
317
- 0x9C9C => TagName.new('XPComment'),
318
- 0x9C9D => TagName.new('XPAuthor'), #(ignored by Windows Explorer if Artist exists)
319
- 0x9C9E => TagName.new('XPKeywords'),
320
- 0x9C9F => TagName.new('XPSubject'),
316
+ 0x9C9B => TagEntry.new('XPTitle'),
317
+ 0x9C9C => TagEntry.new('XPComment'),
318
+ 0x9C9D => TagEntry.new('XPAuthor'), #(ignored by Windows Explorer if Artist exists)
319
+ 0x9C9E => TagEntry.new('XPKeywords'),
320
+ 0x9C9F => TagEntry.new('XPSubject'),
321
321
 
322
- 0xA000 => TagName.new('FlashPixVersion', self.method(:ascii_bytes_to_filtered_string)),
323
- 0xA001 => TagName.new('ColorSpace',
322
+ 0xA000 => TagEntry.new('FlashPixVersion', self.method(:ascii_bytes_to_filtered_string)),
323
+ 0xA001 => TagEntry.new('ColorSpace',
324
324
  {1 => 'sRGB',
325
325
  2 => 'Adobe RGB',
326
326
  65535 => 'Uncalibrated'}),
327
- 0xA002 => TagName.new('ExifImageWidth'),
328
- 0xA003 => TagName.new('ExifImageLength'),
329
- 0xA005 => TagName.new('InteroperabilityOffset'),
330
- 0xA20B => TagName.new('FlashEnergy'), # 0x920B in TIFF/EP
331
- 0xA20C => TagName.new('SpatialFrequencyResponse'), # 0x920C
332
- 0xA20E => TagName.new('FocalPlaneXResolution'), # 0x920E
333
- 0xA20F => TagName.new('FocalPlaneYResolution'), # 0x920F
334
- 0xA210 => TagName.new('FocalPlaneResolutionUnit'), # 0x9210
335
- 0xA214 => TagName.new('SubjectLocation'), # 0x9214
336
- 0xA215 => TagName.new('ExposureIndex'), # 0x9215
337
- 0xA217 => TagName.new('SensingMethod', # 0x9217
327
+ 0xA002 => TagEntry.new('ExifImageWidth'),
328
+ 0xA003 => TagEntry.new('ExifImageLength'),
329
+ 0xA005 => TagEntry.new('InteroperabilityOffset'),
330
+ 0xA20B => TagEntry.new('FlashEnergy'), # 0x920B in TIFF/EP
331
+ 0xA20C => TagEntry.new('SpatialFrequencyResponse'), # 0x920C
332
+ 0xA20E => TagEntry.new('FocalPlaneXResolution'), # 0x920E
333
+ 0xA20F => TagEntry.new('FocalPlaneYResolution'), # 0x920F
334
+ 0xA210 => TagEntry.new('FocalPlaneResolutionUnit'), # 0x9210
335
+ 0xA214 => TagEntry.new('SubjectLocation'), # 0x9214
336
+ 0xA215 => TagEntry.new('ExposureIndex'), # 0x9215
337
+ 0xA217 => TagEntry.new('SensingMethod', # 0x9217
338
338
  {1 => 'Not defined',
339
339
  2 => 'One-chip color area',
340
340
  3 => 'Two-chip color area',
@@ -342,62 +342,62 @@ EXIF_TAGS = {
342
342
  5 => 'Color sequential area',
343
343
  7 => 'Trilinear',
344
344
  8 => 'Color sequential linear'}),
345
- 0xA300 => TagName.new('FileSource',
345
+ 0xA300 => TagEntry.new('FileSource',
346
346
  {1 => 'Film Scanner',
347
347
  2 => 'Reflection Print Scanner',
348
348
  3 => 'Digital Camera'}),
349
- 0xA301 => TagName.new('SceneType',
349
+ 0xA301 => TagEntry.new('SceneType',
350
350
  {1 => 'Directly Photographed'}),
351
- 0xA302 => TagName.new('CVAPattern'),
352
- 0xA401 => TagName.new('CustomRendered',
351
+ 0xA302 => TagEntry.new('CVAPattern'),
352
+ 0xA401 => TagEntry.new('CustomRendered',
353
353
  {0 => 'Normal',
354
354
  1 => 'Custom'}),
355
- 0xA402 => TagName.new('ExposureMode',
355
+ 0xA402 => TagEntry.new('ExposureMode',
356
356
  {0 => 'Auto Exposure',
357
357
  1 => 'Manual Exposure',
358
358
  2 => 'Auto Bracket'}),
359
- 0xA403 => TagName.new('WhiteBalance',
359
+ 0xA403 => TagEntry.new('WhiteBalance',
360
360
  {0 => 'Auto',
361
361
  1 => 'Manual'}),
362
- 0xA404 => TagName.new('DigitalZoomRatio'),
363
- 0xA405 => TagName.new('FocalLengthIn35mmFilm'),
364
- 0xA406 => TagName.new('SceneCaptureType',
362
+ 0xA404 => TagEntry.new('DigitalZoomRatio'),
363
+ 0xA405 => TagEntry.new('FocalLengthIn35mmFilm'),
364
+ 0xA406 => TagEntry.new('SceneCaptureType',
365
365
  {0 => 'Standard',
366
366
  1 => 'Landscape',
367
367
  2 => 'Portrait',
368
368
  3 => 'Night)'}),
369
- 0xA407 => TagName.new('GainControl',
369
+ 0xA407 => TagEntry.new('GainControl',
370
370
  {0 => 'None',
371
371
  1 => 'Low gain up',
372
372
  2 => 'High gain up',
373
373
  3 => 'Low gain down',
374
374
  4 => 'High gain down'}),
375
- 0xA408 => TagName.new('Contrast',
375
+ 0xA408 => TagEntry.new('Contrast',
376
376
  {0 => 'Normal',
377
377
  1 => 'Soft',
378
378
  2 => 'Hard'}),
379
- 0xA409 => TagName.new('Saturation',
379
+ 0xA409 => TagEntry.new('Saturation',
380
380
  {0 => 'Normal',
381
381
  1 => 'Soft',
382
382
  2 => 'Hard'}),
383
- 0xA40A => TagName.new('Sharpness',
383
+ 0xA40A => TagEntry.new('Sharpness',
384
384
  {0 => 'Normal',
385
385
  1 => 'Soft',
386
386
  2 => 'Hard'}),
387
- 0xA40B => TagName.new('DeviceSettingDescription'),
388
- 0xA40C => TagName.new('SubjectDistanceRange'),
389
- 0xA500 => TagName.new('Gamma'),
390
- 0xC4A5 => TagName.new('PrintIM'),
391
- 0xEA1C => TagName.new('Padding')
387
+ 0xA40B => TagEntry.new('DeviceSettingDescription'),
388
+ 0xA40C => TagEntry.new('SubjectDistanceRange'),
389
+ 0xA500 => TagEntry.new('Gamma'),
390
+ 0xC4A5 => TagEntry.new('PrintIM'),
391
+ 0xEA1C => TagEntry.new('Padding')
392
392
  }
393
393
 
394
394
  # interoperability tags
395
395
  INTR_TAGS = {
396
- 0x0001 => TagName.new('InteroperabilityIndex'),
397
- 0x0002 => TagName.new('InteroperabilityVersion'),
398
- 0x1000 => TagName.new('RelatedImageFileFormat'),
399
- 0x1001 => TagName.new('RelatedImageWidth'),
400
- 0x1002 => TagName.new('RelatedImageLength')
396
+ 0x0001 => TagEntry.new('InteroperabilityIndex'),
397
+ 0x0002 => TagEntry.new('InteroperabilityVersion'),
398
+ 0x1000 => TagEntry.new('RelatedImageFileFormat'),
399
+ 0x1001 => TagEntry.new('RelatedImageWidth'),
400
+ 0x1002 => TagEntry.new('RelatedImageLength')
401
401
  }
402
402
 
403
403
  # Ignore these tags when quick processing
@@ -409,132 +409,132 @@ IGNORE_TAGS = [0x9286, 0x927C]
409
409
  MAKERNOTE_OLYMPUS_TAGS = {
410
410
  # ah HAH! those sneeeeeaky bastids! this is how they get past the fact
411
411
  # that a JPEG thumbnail is not allowed in an uncompressed TIFF file
412
- 0x0100 => TagName.new('JPEGThumbnail'),
413
- 0x0200 => TagName.new('SpecialMode', self.method(:olympus_special_mode)),
414
- 0x0201 => TagName.new('JPEGQual',
412
+ 0x0100 => TagEntry.new('JPEGThumbnail'),
413
+ 0x0200 => TagEntry.new('SpecialMode', self.method(:olympus_special_mode)),
414
+ 0x0201 => TagEntry.new('JPEGQual',
415
415
  {1 => 'SQ',
416
416
  2 => 'HQ',
417
417
  3 => 'SHQ'}),
418
- 0x0202 => TagName.new('Macro',
418
+ 0x0202 => TagEntry.new('Macro',
419
419
  {0 => 'Normal',
420
420
  1 => 'Macro',
421
421
  2 => 'SuperMacro'}),
422
- 0x0203 => TagName.new('BWMode',
422
+ 0x0203 => TagEntry.new('BWMode',
423
423
  {0 => 'Off',
424
424
  1 => 'On'}),
425
- 0x0204 => TagName.new('DigitalZoom'),
426
- 0x0205 => TagName.new('FocalPlaneDiagonal'),
427
- 0x0206 => TagName.new('LensDistortionParams'),
428
- 0x0207 => TagName.new('SoftwareRelease'),
429
- 0x0208 => TagName.new('PictureInfo'),
430
- 0x0209 => TagName.new('CameraID', self.method(:ascii_bytes_to_filtered_string)), # print as string
431
- 0x0F00 => TagName.new('DataDump'),
432
- 0x0300 => TagName.new('PreCaptureFrames'),
433
- 0x0404 => TagName.new('SerialNumber'),
434
- 0x1000 => TagName.new('ShutterSpeedValue'),
435
- 0x1001 => TagName.new('ISOValue'),
436
- 0x1002 => TagName.new('ApertureValue'),
437
- 0x1003 => TagName.new('BrightnessValue'),
438
- 0x1004 => TagName.new('FlashMode'),
439
- 0x1004 => TagName.new('FlashMode',
425
+ 0x0204 => TagEntry.new('DigitalZoom'),
426
+ 0x0205 => TagEntry.new('FocalPlaneDiagonal'),
427
+ 0x0206 => TagEntry.new('LensDistortionParams'),
428
+ 0x0207 => TagEntry.new('SoftwareRelease'),
429
+ 0x0208 => TagEntry.new('PictureInfo'),
430
+ 0x0209 => TagEntry.new('CameraID', self.method(:ascii_bytes_to_filtered_string)), # print as string
431
+ 0x0F00 => TagEntry.new('DataDump'),
432
+ 0x0300 => TagEntry.new('PreCaptureFrames'),
433
+ 0x0404 => TagEntry.new('SerialNumber'),
434
+ 0x1000 => TagEntry.new('ShutterSpeedValue'),
435
+ 0x1001 => TagEntry.new('ISOValue'),
436
+ 0x1002 => TagEntry.new('ApertureValue'),
437
+ 0x1003 => TagEntry.new('BrightnessValue'),
438
+ 0x1004 => TagEntry.new('FlashMode'),
439
+ 0x1004 => TagEntry.new('FlashMode',
440
440
  {2 => 'On',
441
441
  3 => 'Off'}),
442
- 0x1005 => TagName.new('FlashDevice',
442
+ 0x1005 => TagEntry.new('FlashDevice',
443
443
  {0 => 'None',
444
444
  1 => 'Internal',
445
445
  4 => 'External',
446
446
  5 => 'Internal + External'}),
447
- 0x1006 => TagName.new('ExposureCompensation'),
448
- 0x1007 => TagName.new('SensorTemperature'),
449
- 0x1008 => TagName.new('LensTemperature'),
450
- 0x100b => TagName.new('FocusMode',
447
+ 0x1006 => TagEntry.new('ExposureCompensation'),
448
+ 0x1007 => TagEntry.new('SensorTemperature'),
449
+ 0x1008 => TagEntry.new('LensTemperature'),
450
+ 0x100b => TagEntry.new('FocusMode',
451
451
  {0 => 'Auto',
452
452
  1 => 'Manual'}),
453
- 0x1017 => TagName.new('RedBalance'),
454
- 0x1018 => TagName.new('BlueBalance'),
455
- 0x101a => TagName.new('SerialNumber'),
456
- 0x1023 => TagName.new('FlashExposureComp'),
457
- 0x1026 => TagName.new('ExternalFlashBounce',
453
+ 0x1017 => TagEntry.new('RedBalance'),
454
+ 0x1018 => TagEntry.new('BlueBalance'),
455
+ 0x101a => TagEntry.new('SerialNumber'),
456
+ 0x1023 => TagEntry.new('FlashExposureComp'),
457
+ 0x1026 => TagEntry.new('ExternalFlashBounce',
458
458
  {0 => 'No',
459
459
  1 => 'Yes'}),
460
- 0x1027 => TagName.new('ExternalFlashZoom'),
461
- 0x1028 => TagName.new('ExternalFlashMode'),
462
- 0x1029 => TagName.new('Contrast int16u',
460
+ 0x1027 => TagEntry.new('ExternalFlashZoom'),
461
+ 0x1028 => TagEntry.new('ExternalFlashMode'),
462
+ 0x1029 => TagEntry.new('Contrast int16u',
463
463
  {0 => 'High',
464
464
  1 => 'Normal',
465
465
  2 => 'Low'}),
466
- 0x102a => TagName.new('SharpnessFactor'),
467
- 0x102b => TagName.new('ColorControl'),
468
- 0x102c => TagName.new('ValidBits'),
469
- 0x102d => TagName.new('CoringFilter'),
470
- 0x102e => TagName.new('OlympusImageWidth'),
471
- 0x102f => TagName.new('OlympusImageHeight'),
472
- 0x1034 => TagName.new('CompressionRatio'),
473
- 0x1035 => TagName.new('PreviewImageValid',
466
+ 0x102a => TagEntry.new('SharpnessFactor'),
467
+ 0x102b => TagEntry.new('ColorControl'),
468
+ 0x102c => TagEntry.new('ValidBits'),
469
+ 0x102d => TagEntry.new('CoringFilter'),
470
+ 0x102e => TagEntry.new('OlympusImageWidth'),
471
+ 0x102f => TagEntry.new('OlympusImageHeight'),
472
+ 0x1034 => TagEntry.new('CompressionRatio'),
473
+ 0x1035 => TagEntry.new('PreviewImageValid',
474
474
  {0 => 'No',
475
475
  1 => 'Yes'}),
476
- 0x1036 => TagName.new('PreviewImageStart'),
477
- 0x1037 => TagName.new('PreviewImageLength'),
478
- 0x1039 => TagName.new('CCDScanMode',
476
+ 0x1036 => TagEntry.new('PreviewImageStart'),
477
+ 0x1037 => TagEntry.new('PreviewImageLength'),
478
+ 0x1039 => TagEntry.new('CCDScanMode',
479
479
  {0 => 'Interlaced',
480
480
  1 => 'Progressive'}),
481
- 0x103a => TagName.new('NoiseReduction',
481
+ 0x103a => TagEntry.new('NoiseReduction',
482
482
  {0 => 'Off',
483
483
  1 => 'On'}),
484
- 0x103b => TagName.new('InfinityLensStep'),
485
- 0x103c => TagName.new('NearLensStep'),
484
+ 0x103b => TagEntry.new('InfinityLensStep'),
485
+ 0x103c => TagEntry.new('NearLensStep'),
486
486
 
487
487
  # TODO - these need extra definitions
488
488
  # http =>//search.cpan.org/src/EXIFTOOL/Image-ExifTool-6.90/html/TagNames/Olympus.html
489
- 0x2010 => TagName.new('Equipment'),
490
- 0x2020 => TagName.new('CameraSettings'),
491
- 0x2030 => TagName.new('RawDevelopment'),
492
- 0x2040 => TagName.new('ImageProcessing'),
493
- 0x2050 => TagName.new('FocusInfo'),
494
- 0x3000 => TagName.new('RawInfo '),
489
+ 0x2010 => TagEntry.new('Equipment'),
490
+ 0x2020 => TagEntry.new('CameraSettings'),
491
+ 0x2030 => TagEntry.new('RawDevelopment'),
492
+ 0x2040 => TagEntry.new('ImageProcessing'),
493
+ 0x2050 => TagEntry.new('FocusInfo'),
494
+ 0x3000 => TagEntry.new('RawInfo '),
495
495
  }
496
496
 
497
497
  # 0x2020 CameraSettings
498
498
  MAKERNOTE_OLYMPUS_TAG_0x2020={
499
- 0x0100 => TagName.new('PreviewImageValid',
499
+ 0x0100 => TagEntry.new('PreviewImageValid',
500
500
  {0 => 'No',
501
501
  1 => 'Yes'}),
502
- 0x0101 => TagName.new('PreviewImageStart'),
503
- 0x0102 => TagName.new('PreviewImageLength'),
504
- 0x0200 => TagName.new('ExposureMode',
502
+ 0x0101 => TagEntry.new('PreviewImageStart'),
503
+ 0x0102 => TagEntry.new('PreviewImageLength'),
504
+ 0x0200 => TagEntry.new('ExposureMode',
505
505
  {1 => 'Manual',
506
506
  2 => 'Program',
507
507
  3 => 'Aperture-priority AE',
508
508
  4 => 'Shutter speed priority AE',
509
509
  5 => 'Program-shift'}),
510
- 0x0201 => TagName.new('AELock',
510
+ 0x0201 => TagEntry.new('AELock',
511
511
  {0 => 'Off',
512
512
  1 => 'On'}),
513
- 0x0202 => TagName.new('MeteringMode',
513
+ 0x0202 => TagEntry.new('MeteringMode',
514
514
  {2 => 'Center Weighted',
515
515
  3 => 'Spot',
516
516
  5 => 'ESP',
517
517
  261 => 'Pattern+AF',
518
518
  515 => 'Spot+Highlight control',
519
519
  1027 => 'Spot+Shadow control'}),
520
- 0x0300 => TagName.new('MacroMode',
520
+ 0x0300 => TagEntry.new('MacroMode',
521
521
  {0 => 'Off',
522
522
  1 => 'On'}),
523
- 0x0301 => TagName.new('FocusMode',
523
+ 0x0301 => TagEntry.new('FocusMode',
524
524
  {0 => 'Single AF',
525
525
  1 => 'Sequential shooting AF',
526
526
  2 => 'Continuous AF',
527
527
  3 => 'Multi AF',
528
528
  10 => 'MF'}),
529
- 0x0302 => TagName.new('FocusProcess',
529
+ 0x0302 => TagEntry.new('FocusProcess',
530
530
  {0 => 'AF Not Used',
531
531
  1 => 'AF Used'}),
532
- 0x0303 => TagName.new('AFSearch',
532
+ 0x0303 => TagEntry.new('AFSearch',
533
533
  {0 => 'Not Ready',
534
534
  1 => 'Ready'}),
535
- 0x0304 => TagName.new('AFAreas'),
536
- 0x0401 => TagName.new('FlashExposureCompensation'),
537
- 0x0500 => TagName.new('WhiteBalance2',
535
+ 0x0304 => TagEntry.new('AFAreas'),
536
+ 0x0401 => TagEntry.new('FlashExposureCompensation'),
537
+ 0x0500 => TagEntry.new('WhiteBalance2',
538
538
  {0 => 'Auto',
539
539
  16 => '7500K (Fine Weather with Shade)',
540
540
  17 => '6000K (Cloudy)',
@@ -552,22 +552,22 @@ MAKERNOTE_OLYMPUS_TAG_0x2020={
552
552
  512 => 'Custom WB 5400K',
553
553
  513 => 'Custom WB 2900K',
554
554
  514 => 'Custom WB 8000K', }),
555
- 0x0501 => TagName.new('WhiteBalanceTemperature'),
556
- 0x0502 => TagName.new('WhiteBalanceBracket'),
557
- 0x0503 => TagName.new('CustomSaturation'), # (3 numbers => 1. CS Value, 2. Min, 3. Max)
558
- 0x0504 => TagName.new('ModifiedSaturation',
555
+ 0x0501 => TagEntry.new('WhiteBalanceTemperature'),
556
+ 0x0502 => TagEntry.new('WhiteBalanceBracket'),
557
+ 0x0503 => TagEntry.new('CustomSaturation'), # (3 numbers => 1. CS Value, 2. Min, 3. Max)
558
+ 0x0504 => TagEntry.new('ModifiedSaturation',
559
559
  {0 => 'Off',
560
560
  1 => 'CM1 (Red Enhance)',
561
561
  2 => 'CM2 (Green Enhance)',
562
562
  3 => 'CM3 (Blue Enhance)',
563
563
  4 => 'CM4 (Skin Tones)'}),
564
- 0x0505 => TagName.new('ContrastSetting'), # (3 numbers => 1. Contrast, 2. Min, 3. Max)
565
- 0x0506 => TagName.new('SharpnessSetting'), # (3 numbers => 1. Sharpness, 2. Min, 3. Max)
566
- 0x0507 => TagName.new('ColorSpace',
564
+ 0x0505 => TagEntry.new('ContrastSetting'), # (3 numbers => 1. Contrast, 2. Min, 3. Max)
565
+ 0x0506 => TagEntry.new('SharpnessSetting'), # (3 numbers => 1. Sharpness, 2. Min, 3. Max)
566
+ 0x0507 => TagEntry.new('ColorSpace',
567
567
  {0 => 'sRGB',
568
568
  1 => 'Adobe RGB',
569
569
  2 => 'Pro Photo RGB'}),
570
- 0x0509 => TagName.new('SceneMode',
570
+ 0x0509 => TagEntry.new('SceneMode',
571
571
  {0 => 'Standard',
572
572
  6 => 'Auto',
573
573
  7 => 'Sport',
@@ -593,105 +593,105 @@ MAKERNOTE_OLYMPUS_TAG_0x2020={
593
593
  45 => 'Low Key',
594
594
  46 => 'Children',
595
595
  48 => 'Nature Macro'}),
596
- 0x050a => TagName.new('NoiseReduction',
596
+ 0x050a => TagEntry.new('NoiseReduction',
597
597
  {0 => 'Off',
598
598
  1 => 'Noise Reduction',
599
599
  2 => 'Noise Filter',
600
600
  3 => 'Noise Reduction + Noise Filter',
601
601
  4 => 'Noise Filter (ISO Boost)',
602
602
  5 => 'Noise Reduction + Noise Filter (ISO Boost)'}),
603
- 0x050b => TagName.new('DistortionCorrection',
603
+ 0x050b => TagEntry.new('DistortionCorrection',
604
604
  {0 => 'Off',
605
605
  1 => 'On'}),
606
- 0x050c => TagName.new('ShadingCompensation',
606
+ 0x050c => TagEntry.new('ShadingCompensation',
607
607
  {0 => 'Off',
608
608
  1 => 'On'}),
609
- 0x050d => TagName.new('CompressionFactor'),
610
- 0x050f => TagName.new('Gradation',
609
+ 0x050d => TagEntry.new('CompressionFactor'),
610
+ 0x050f => TagEntry.new('Gradation',
611
611
  {'-1 -1 1' => 'Low Key',
612
612
  '0 -1 1' => 'Normal',
613
613
  '1 -1 1' => 'High Key'}),
614
- 0x0520 => TagName.new('PictureMode',
614
+ 0x0520 => TagEntry.new('PictureMode',
615
615
  {1 => 'Vivid',
616
616
  2 => 'Natural',
617
617
  3 => 'Muted',
618
618
  256 => 'Monotone',
619
619
  512 => 'Sepia'}),
620
- 0x0521 => TagName.new('PictureModeSaturation'),
621
- 0x0522 => TagName.new('PictureModeHue?'),
622
- 0x0523 => TagName.new('PictureModeContrast'),
623
- 0x0524 => TagName.new('PictureModeSharpness'),
624
- 0x0525 => TagName.new('PictureModeBWFilter',
620
+ 0x0521 => TagEntry.new('PictureModeSaturation'),
621
+ 0x0522 => TagEntry.new('PictureModeHue?'),
622
+ 0x0523 => TagEntry.new('PictureModeContrast'),
623
+ 0x0524 => TagEntry.new('PictureModeSharpness'),
624
+ 0x0525 => TagEntry.new('PictureModeBWFilter',
625
625
  {0 => 'n/a',
626
626
  1 => 'Neutral',
627
627
  2 => 'Yellow',
628
628
  3 => 'Orange',
629
629
  4 => 'Red',
630
630
  5 => 'Green'}),
631
- 0x0526 => TagName.new('PictureModeTone',
631
+ 0x0526 => TagEntry.new('PictureModeTone',
632
632
  {0 => 'n/a',
633
633
  1 => 'Neutral',
634
634
  2 => 'Sepia',
635
635
  3 => 'Blue',
636
636
  4 => 'Purple',
637
637
  5 => 'Green'}),
638
- 0x0600 => TagName.new('Sequence'), # 2 or 3 numbers => 1. Mode, 2. Shot number, 3. Mode bits
639
- 0x0601 => TagName.new('PanoramaMode'), # (2 numbers => 1. Mode, 2. Shot number)
640
- 0x0603 => TagName.new('ImageQuality2',
638
+ 0x0600 => TagEntry.new('Sequence'), # 2 or 3 numbers => 1. Mode, 2. Shot number, 3. Mode bits
639
+ 0x0601 => TagEntry.new('PanoramaMode'), # (2 numbers => 1. Mode, 2. Shot number)
640
+ 0x0603 => TagEntry.new('ImageQuality2',
641
641
  {1 => 'SQ',
642
642
  2 => 'HQ',
643
643
  3 => 'SHQ',
644
644
  4 => 'RAW'}),
645
- 0x0901 => TagName.new('ManometerReading')
645
+ 0x0901 => TagEntry.new('ManometerReading')
646
646
  }
647
647
 
648
648
 
649
649
  MAKERNOTE_CASIO_TAGS={
650
- 0x0001 => TagName.new('RecordingMode',
650
+ 0x0001 => TagEntry.new('RecordingMode',
651
651
  {1 => 'Single Shutter',
652
652
  2 => 'Panorama',
653
653
  3 => 'Night Scene',
654
654
  4 => 'Portrait',
655
655
  5 => 'Landscape'}),
656
- 0x0002 => TagName.new('Quality',
656
+ 0x0002 => TagEntry.new('Quality',
657
657
  {1 => 'Economy',
658
658
  2 => 'Normal',
659
659
  3 => 'Fine'}),
660
- 0x0003 => TagName.new('FocusingMode',
660
+ 0x0003 => TagEntry.new('FocusingMode',
661
661
  {2 => 'Macro',
662
662
  3 => 'Auto Focus',
663
663
  4 => 'Manual Focus',
664
664
  5 => 'Infinity'}),
665
- 0x0004 => TagName.new('FlashMode',
665
+ 0x0004 => TagEntry.new('FlashMode',
666
666
  {1 => 'Auto',
667
667
  2 => 'On',
668
668
  3 => 'Off',
669
669
  4 => 'Red Eye Reduction'}),
670
- 0x0005 => TagName.new('FlashIntensity',
670
+ 0x0005 => TagEntry.new('FlashIntensity',
671
671
  {11 => 'Weak',
672
672
  13 => 'Normal',
673
673
  15 => 'Strong'}),
674
- 0x0006 => TagName.new('Object Distance'),
675
- 0x0007 => TagName.new('WhiteBalance',
674
+ 0x0006 => TagEntry.new('Object Distance'),
675
+ 0x0007 => TagEntry.new('WhiteBalance',
676
676
  {1 => 'Auto',
677
677
  2 => 'Tungsten',
678
678
  3 => 'Daylight',
679
679
  4 => 'Fluorescent',
680
680
  5 => 'Shade',
681
681
  129 => 'Manual'}),
682
- 0x000B => TagName.new('Sharpness',
682
+ 0x000B => TagEntry.new('Sharpness',
683
683
  {0 => 'Normal',
684
684
  1 => 'Soft',
685
685
  2 => 'Hard'}),
686
- 0x000C => TagName.new('Contrast',
686
+ 0x000C => TagEntry.new('Contrast',
687
687
  {0 => 'Normal',
688
688
  1 => 'Low',
689
689
  2 => 'High'}),
690
- 0x000D => TagName.new('Saturation',
690
+ 0x000D => TagEntry.new('Saturation',
691
691
  {0 => 'Normal',
692
692
  1 => 'Low',
693
693
  2 => 'High'}),
694
- 0x0014 => TagName.new('CCDSpeed',
694
+ 0x0014 => TagEntry.new('CCDSpeed',
695
695
  {64 => 'Normal',
696
696
  80 => 'Normal',
697
697
  100 => 'High',
@@ -701,15 +701,15 @@ MAKERNOTE_CASIO_TAGS={
701
701
  }
702
702
 
703
703
  MAKERNOTE_FUJIFILM_TAGS={
704
- 0x0000 => TagName.new('NoteVersion', self.method(:ascii_bytes_to_filtered_string)),
705
- 0x1000 => TagName.new('Quality'),
706
- 0x1001 => TagName.new('Sharpness',
704
+ 0x0000 => TagEntry.new('NoteVersion', self.method(:ascii_bytes_to_filtered_string)),
705
+ 0x1000 => TagEntry.new('Quality'),
706
+ 0x1001 => TagEntry.new('Sharpness',
707
707
  {1 => 'Soft',
708
708
  2 => 'Soft',
709
709
  3 => 'Normal',
710
710
  4 => 'Hard',
711
711
  5 => 'Hard'}),
712
- 0x1002 => TagName.new('WhiteBalance',
712
+ 0x1002 => TagEntry.new('WhiteBalance',
713
713
  {0 => 'Auto',
714
714
  256 => 'Daylight',
715
715
  512 => 'Cloudy',
@@ -718,30 +718,30 @@ MAKERNOTE_FUJIFILM_TAGS={
718
718
  770 => 'White-Fluorescent',
719
719
  1024 => 'Incandescent',
720
720
  3840 => 'Custom'}),
721
- 0x1003 => TagName.new('Color',
721
+ 0x1003 => TagEntry.new('Color',
722
722
  {0 => 'Normal',
723
723
  256 => 'High',
724
724
  512 => 'Low'}),
725
- 0x1004 => TagName.new('Tone',
725
+ 0x1004 => TagEntry.new('Tone',
726
726
  {0 => 'Normal',
727
727
  256 => 'High',
728
728
  512 => 'Low'}),
729
- 0x1010 => TagName.new('FlashMode',
729
+ 0x1010 => TagEntry.new('FlashMode',
730
730
  {0 => 'Auto',
731
731
  1 => 'On',
732
732
  2 => 'Off',
733
733
  3 => 'Red Eye Reduction'}),
734
- 0x1011 => TagName.new('FlashStrength'),
735
- 0x1020 => TagName.new('Macro',
734
+ 0x1011 => TagEntry.new('FlashStrength'),
735
+ 0x1020 => TagEntry.new('Macro',
736
736
  {0 => 'Off',
737
737
  1 => 'On'}),
738
- 0x1021 => TagName.new('FocusMode',
738
+ 0x1021 => TagEntry.new('FocusMode',
739
739
  {0 => 'Auto',
740
740
  1 => 'Manual'}),
741
- 0x1030 => TagName.new('SlowSync',
741
+ 0x1030 => TagEntry.new('SlowSync',
742
742
  {0 => 'Off',
743
743
  1 => 'On'}),
744
- 0x1031 => TagName.new('PictureMode',
744
+ 0x1031 => TagEntry.new('PictureMode',
745
745
  {0 => 'Auto',
746
746
  1 => 'Portrait',
747
747
  2 => 'Landscape',
@@ -751,38 +751,38 @@ MAKERNOTE_FUJIFILM_TAGS={
751
751
  256 => 'Aperture Priority AE',
752
752
  512 => 'Shutter Priority AE',
753
753
  768 => 'Manual Exposure'}),
754
- 0x1100 => TagName.new('MotorOrBracket',
754
+ 0x1100 => TagEntry.new('MotorOrBracket',
755
755
  {0 => 'Off',
756
756
  1 => 'On'}),
757
- 0x1300 => TagName.new('BlurWarning',
757
+ 0x1300 => TagEntry.new('BlurWarning',
758
758
  {0 => 'Off',
759
759
  1 => 'On'}),
760
- 0x1301 => TagName.new('FocusWarning',
760
+ 0x1301 => TagEntry.new('FocusWarning',
761
761
  {0 => 'Off',
762
762
  1 => 'On'}),
763
- 0x1302 => TagName.new('AEWarning',
763
+ 0x1302 => TagEntry.new('AEWarning',
764
764
  {0 => 'Off',
765
765
  1 => 'On'})
766
766
  }
767
767
 
768
768
  MAKERNOTE_CANON_TAGS = {
769
- 0x0006 => TagName.new('ImageType'),
770
- 0x0007 => TagName.new('FirmwareVersion'),
771
- 0x0008 => TagName.new('ImageNumber'),
772
- 0x0009 => TagName.new('OwnerName')
769
+ 0x0006 => TagEntry.new('ImageType'),
770
+ 0x0007 => TagEntry.new('FirmwareVersion'),
771
+ 0x0008 => TagEntry.new('ImageNumber'),
772
+ 0x0009 => TagEntry.new('OwnerName')
773
773
  }
774
774
 
775
775
  # this is in element offset, name, optional value dictionary format
776
776
  MAKERNOTE_CANON_TAG_0x001 = {
777
- 1 => TagName.new('Macromode',
777
+ 1 => TagEntry.new('Macromode',
778
778
  {1 => 'Macro',
779
779
  2 => 'Normal'}),
780
- 2 => TagName.new('SelfTimer'),
781
- 3 => TagName.new('Quality',
780
+ 2 => TagEntry.new('SelfTimer'),
781
+ 3 => TagEntry.new('Quality',
782
782
  {2 => 'Normal',
783
783
  3 => 'Fine',
784
784
  5 => 'Superfine'}),
785
- 4 => TagName.new('FlashMode',
785
+ 4 => TagEntry.new('FlashMode',
786
786
  {0 => 'Flash Not Fired',
787
787
  1 => 'Auto',
788
788
  2 => 'On',
@@ -791,10 +791,10 @@ MAKERNOTE_CANON_TAG_0x001 = {
791
791
  5 => 'Auto + Red-Eye Reduction',
792
792
  6 => 'On + Red-Eye Reduction',
793
793
  16 => 'external flash'}),
794
- 5 => TagName.new('ContinuousDriveMode',
794
+ 5 => TagEntry.new('ContinuousDriveMode',
795
795
  {0 => 'Single Or Timer',
796
796
  1 => 'Continuous'}),
797
- 7 => TagName.new('FocusMode',
797
+ 7 => TagEntry.new('FocusMode',
798
798
  {0 => 'One-Shot',
799
799
  1 => 'AI Servo',
800
800
  2 => 'AI Focus',
@@ -802,11 +802,11 @@ MAKERNOTE_CANON_TAG_0x001 = {
802
802
  4 => 'Single',
803
803
  5 => 'Continuous',
804
804
  6 => 'MF'}),
805
- 10 => TagName.new('ImageSize',
805
+ 10 => TagEntry.new('ImageSize',
806
806
  {0 => 'Large',
807
807
  1 => 'Medium',
808
808
  2 => 'Small'}),
809
- 11 => TagName.new('EasyShootingMode',
809
+ 11 => TagEntry.new('EasyShootingMode',
810
810
  {0 => 'Full Auto',
811
811
  1 => 'Manual',
812
812
  2 => 'Landscape',
@@ -819,70 +819,70 @@ MAKERNOTE_CANON_TAG_0x001 = {
819
819
  9 => 'Sports',
820
820
  10 => 'Macro/Close-Up',
821
821
  11 => 'Pan Focus'}),
822
- 12 => TagName.new('DigitalZoom',
822
+ 12 => TagEntry.new('DigitalZoom',
823
823
  {0 => 'None',
824
824
  1 => '2x',
825
825
  2 => '4x'}),
826
- 13 => TagName.new('Contrast',
826
+ 13 => TagEntry.new('Contrast',
827
827
  {0xFFFF => 'Low',
828
828
  0 => 'Normal',
829
829
  1 => 'High'}),
830
- 14 => TagName.new('Saturation',
830
+ 14 => TagEntry.new('Saturation',
831
831
  {0xFFFF => 'Low',
832
832
  0 => 'Normal',
833
833
  1 => 'High'}),
834
- 15 => TagName.new('Sharpness',
834
+ 15 => TagEntry.new('Sharpness',
835
835
  {0xFFFF => 'Low',
836
836
  0 => 'Normal',
837
837
  1 => 'High'}),
838
- 16 => TagName.new('ISO',
838
+ 16 => TagEntry.new('ISO',
839
839
  {0 => 'See ISOSpeedRatings Tag',
840
840
  15 => 'Auto',
841
841
  16 => '50',
842
842
  17 => '100',
843
843
  18 => '200',
844
844
  19 => '400'}),
845
- 17 => TagName.new('MeteringMode',
845
+ 17 => TagEntry.new('MeteringMode',
846
846
  {3 => 'Evaluative',
847
847
  4 => 'Partial',
848
848
  5 => 'Center-weighted'}),
849
- 18 => TagName.new('FocusType',
849
+ 18 => TagEntry.new('FocusType',
850
850
  {0 => 'Manual',
851
851
  1 => 'Auto',
852
852
  3 => 'Close-Up (Macro)',
853
853
  8 => 'Locked (Pan Mode)'}),
854
- 19 => TagName.new('AFPointSelected',
854
+ 19 => TagEntry.new('AFPointSelected',
855
855
  {0x3000 => 'None (MF)',
856
856
  0x3001 => 'Auto-Selected',
857
857
  0x3002 => 'Right',
858
858
  0x3003 => 'Center',
859
859
  0x3004 => 'Left'}),
860
- 20 => TagName.new('ExposureMode',
860
+ 20 => TagEntry.new('ExposureMode',
861
861
  {0 => 'Easy Shooting',
862
862
  1 => 'Program',
863
863
  2 => 'Tv-priority',
864
864
  3 => 'Av-priority',
865
865
  4 => 'Manual',
866
866
  5 => 'A-DEP'}),
867
- 23 => TagName.new('LongFocalLengthOfLensInFocalUnits'),
868
- 24 => TagName.new('ShortFocalLengthOfLensInFocalUnits'),
869
- 25 => TagName.new('FocalUnitsPerMM'),
870
- 28 => TagName.new('FlashActivity',
867
+ 23 => TagEntry.new('LongFocalLengthOfLensInFocalUnits'),
868
+ 24 => TagEntry.new('ShortFocalLengthOfLensInFocalUnits'),
869
+ 25 => TagEntry.new('FocalUnitsPerMM'),
870
+ 28 => TagEntry.new('FlashActivity',
871
871
  {0 => 'Did Not Fire',
872
872
  1 => 'Fired'}),
873
- 29 => TagName.new('FlashDetails',
873
+ 29 => TagEntry.new('FlashDetails',
874
874
  {14 => 'External E-TTL',
875
875
  13 => 'Internal Flash',
876
876
  11 => 'FP Sync Used',
877
877
  7 => '2nd("Rear")-Curtain Sync Used',
878
878
  4 => 'FP Sync Enabled'}),
879
- 32 => TagName.new('FocusMode',
879
+ 32 => TagEntry.new('FocusMode',
880
880
  {0 => 'Single',
881
881
  1 => 'Continuous'})
882
882
  }
883
883
 
884
884
  MAKERNOTE_CANON_TAG_0x004 = {
885
- 7 => TagName.new('WhiteBalance',
885
+ 7 => TagEntry.new('WhiteBalance',
886
886
  {0 => 'Auto',
887
887
  1 => 'Sunny',
888
888
  2 => 'Cloudy',
@@ -890,9 +890,9 @@ MAKERNOTE_CANON_TAG_0x004 = {
890
890
  4 => 'Fluorescent',
891
891
  5 => 'Flash',
892
892
  6 => 'Custom'}),
893
- 9 => TagName.new('SequenceNumber'),
894
- 14 => TagName.new('AFPointUsed'),
895
- 15 => TagName.new('FlashBias',
893
+ 9 => TagEntry.new('SequenceNumber'),
894
+ 14 => TagEntry.new('AFPointUsed'),
895
+ 15 => TagEntry.new('FlashBias',
896
896
  {0xFFC0 => '-2 EV',
897
897
  0xFFCC => '-1.67 EV',
898
898
  0xFFD0 => '-1.50 EV',
@@ -910,62 +910,62 @@ MAKERNOTE_CANON_TAG_0x004 = {
910
910
  0x0030 => '1.50 EV',
911
911
  0x0034 => '1.67 EV',
912
912
  0x0040 => '2 EV'}),
913
- 19 => TagName.new('SubjectDistance')
913
+ 19 => TagEntry.new('SubjectDistance')
914
914
  }
915
915
 
916
916
  # Nikon E99x MakerNote Tags
917
917
  MAKERNOTE_NIKON_NEWER_TAGS={
918
- 0x0001 => TagName.new('MakernoteVersion', self.method(:ascii_bytes_to_filtered_string)), # Sometimes binary
919
- 0x0002 => TagName.new('ISOSetting', self.method(:ascii_bytes_to_filtered_string)),
920
- 0x0003 => TagName.new('ColorMode'),
921
- 0x0004 => TagName.new('Quality'),
922
- 0x0005 => TagName.new('Whitebalance'),
923
- 0x0006 => TagName.new('ImageSharpening'),
924
- 0x0007 => TagName.new('FocusMode'),
925
- 0x0008 => TagName.new('FlashSetting'),
926
- 0x0009 => TagName.new('AutoFlashMode'),
927
- 0x000B => TagName.new('WhiteBalanceBias'),
928
- 0x000C => TagName.new('WhiteBalanceRBCoeff'),
929
- 0x000D => TagName.new('ProgramShift', self.method(:nikon_ev_bias)),
918
+ 0x0001 => TagEntry.new('MakernoteVersion', self.method(:ascii_bytes_to_filtered_string)), # Sometimes binary
919
+ 0x0002 => TagEntry.new('ISOSetting', self.method(:ascii_bytes_to_filtered_string)),
920
+ 0x0003 => TagEntry.new('ColorMode'),
921
+ 0x0004 => TagEntry.new('Quality'),
922
+ 0x0005 => TagEntry.new('Whitebalance'),
923
+ 0x0006 => TagEntry.new('ImageSharpening'),
924
+ 0x0007 => TagEntry.new('FocusMode'),
925
+ 0x0008 => TagEntry.new('FlashSetting'),
926
+ 0x0009 => TagEntry.new('AutoFlashMode'),
927
+ 0x000B => TagEntry.new('WhiteBalanceBias'),
928
+ 0x000C => TagEntry.new('WhiteBalanceRBCoeff'),
929
+ 0x000D => TagEntry.new('ProgramShift', self.method(:nikon_ev_bias)),
930
930
  # Nearly the same as the other EV vals, but step size is 1/12 EV (?)
931
- 0x000E => TagName.new('ExposureDifference', self.method(:nikon_ev_bias)),
932
- 0x000F => TagName.new('ISOSelection'),
933
- 0x0011 => TagName.new('NikonPreview'),
934
- 0x0012 => TagName.new('FlashCompensation', self.method(:nikon_ev_bias)),
935
- 0x0013 => TagName.new('ISOSpeedRequested'),
936
- 0x0016 => TagName.new('PhotoCornerCoordinates'),
937
- 0x0018 => TagName.new('FlashBracketCompensationApplied', self.method(:nikon_ev_bias)),
938
- 0x0019 => TagName.new('AEBracketCompensationApplied'),
939
- 0x001A => TagName.new('ImageProcessing'),
940
- 0x001B => TagName.new('CropHiSpeed'),
941
- 0x001D => TagName.new('SerialNumber'), # Conflict with 0x00A0 ?
942
- 0x001E => TagName.new('ColorSpace'),
943
- 0x001F => TagName.new('VRInfo'),
944
- 0x0020 => TagName.new('ImageAuthentication'),
945
- 0x0022 => TagName.new('ActiveDLighting'),
946
- 0x0023 => TagName.new('PictureControl'),
947
- 0x0024 => TagName.new('WorldTime'),
948
- 0x0025 => TagName.new('ISOInfo'),
949
- 0x0080 => TagName.new('ImageAdjustment'),
950
- 0x0081 => TagName.new('ToneCompensation'),
951
- 0x0082 => TagName.new('AuxiliaryLens'),
952
- 0x0083 => TagName.new('LensType'),
953
- 0x0084 => TagName.new('LensMinMaxFocalMaxAperture'),
954
- 0x0085 => TagName.new('ManualFocusDistance'),
955
- 0x0086 => TagName.new('DigitalZoomFactor'),
956
- 0x0087 => TagName.new('FlashMode',
931
+ 0x000E => TagEntry.new('ExposureDifference', self.method(:nikon_ev_bias)),
932
+ 0x000F => TagEntry.new('ISOSelection'),
933
+ 0x0011 => TagEntry.new('NikonPreview'),
934
+ 0x0012 => TagEntry.new('FlashCompensation', self.method(:nikon_ev_bias)),
935
+ 0x0013 => TagEntry.new('ISOSpeedRequested'),
936
+ 0x0016 => TagEntry.new('PhotoCornerCoordinates'),
937
+ 0x0018 => TagEntry.new('FlashBracketCompensationApplied', self.method(:nikon_ev_bias)),
938
+ 0x0019 => TagEntry.new('AEBracketCompensationApplied'),
939
+ 0x001A => TagEntry.new('ImageProcessing'),
940
+ 0x001B => TagEntry.new('CropHiSpeed'),
941
+ 0x001D => TagEntry.new('SerialNumber'), # Conflict with 0x00A0 ?
942
+ 0x001E => TagEntry.new('ColorSpace'),
943
+ 0x001F => TagEntry.new('VRInfo'),
944
+ 0x0020 => TagEntry.new('ImageAuthentication'),
945
+ 0x0022 => TagEntry.new('ActiveDLighting'),
946
+ 0x0023 => TagEntry.new('PictureControl'),
947
+ 0x0024 => TagEntry.new('WorldTime'),
948
+ 0x0025 => TagEntry.new('ISOInfo'),
949
+ 0x0080 => TagEntry.new('ImageAdjustment'),
950
+ 0x0081 => TagEntry.new('ToneCompensation'),
951
+ 0x0082 => TagEntry.new('AuxiliaryLens'),
952
+ 0x0083 => TagEntry.new('LensType'),
953
+ 0x0084 => TagEntry.new('LensMinMaxFocalMaxAperture'),
954
+ 0x0085 => TagEntry.new('ManualFocusDistance'),
955
+ 0x0086 => TagEntry.new('DigitalZoomFactor'),
956
+ 0x0087 => TagEntry.new('FlashMode',
957
957
  {0x00 => 'Did Not Fire',
958
958
  0x01 => 'Fired, Manual',
959
959
  0x07 => 'Fired, External',
960
960
  0x08 => 'Fired, Commander Mode ',
961
961
  0x09 => 'Fired, TTL Mode'}),
962
- 0x0088 => TagName.new('AFFocusPosition',
962
+ 0x0088 => TagEntry.new('AFFocusPosition',
963
963
  {0x0000 => 'Center',
964
964
  0x0100 => 'Top',
965
965
  0x0200 => 'Bottom',
966
966
  0x0300 => 'Left',
967
967
  0x0400 => 'Right'}),
968
- 0x0089 => TagName.new('BracketingMode',
968
+ 0x0089 => TagEntry.new('BracketingMode',
969
969
  {0x00 => 'Single frame, no bracketing',
970
970
  0x01 => 'Continuous, no bracketing',
971
971
  0x02 => 'Timer, no bracketing',
@@ -975,53 +975,53 @@ MAKERNOTE_NIKON_NEWER_TAGS={
975
975
  0x40 => 'Single frame, white balance bracketing',
976
976
  0x41 => 'Continuous, white balance bracketing',
977
977
  0x42 => 'Timer, white balance bracketing'}),
978
- 0x008A => TagName.new('AutoBracketRelease'),
979
- 0x008B => TagName.new('LensFStops'),
980
- 0x008C => TagName.new('NEFCurve1'), # ExifTool calls this 'ContrastCurve'
981
- 0x008D => TagName.new('ColorMode'),
982
- 0x008F => TagName.new('SceneMode'),
983
- 0x0090 => TagName.new('LightingType'),
984
- 0x0091 => TagName.new('ShotInfo'), # First 4 bytes are a version number in ASCII
985
- 0x0092 => TagName.new('HueAdjustment'),
978
+ 0x008A => TagEntry.new('AutoBracketRelease'),
979
+ 0x008B => TagEntry.new('LensFStops'),
980
+ 0x008C => TagEntry.new('NEFCurve1'), # ExifTool calls this 'ContrastCurve'
981
+ 0x008D => TagEntry.new('ColorMode'),
982
+ 0x008F => TagEntry.new('SceneMode'),
983
+ 0x0090 => TagEntry.new('LightingType'),
984
+ 0x0091 => TagEntry.new('ShotInfo'), # First 4 bytes are a version number in ASCII
985
+ 0x0092 => TagEntry.new('HueAdjustment'),
986
986
  # ExifTool calls this 'NEFCompression', should be 1-4
987
- 0x0093 => TagName.new('Compression'),
988
- 0x0094 => TagName.new('Saturation',
987
+ 0x0093 => TagEntry.new('Compression'),
988
+ 0x0094 => TagEntry.new('Saturation',
989
989
  {-3 => 'B&W',
990
990
  -2 => '-2',
991
991
  -1 => '-1',
992
992
  0 => '0',
993
993
  1 => '1',
994
994
  2 => '2'}),
995
- 0x0095 => TagName.new('NoiseReduction'),
996
- 0x0096 => TagName.new('NEFCurve2'), # ExifTool calls this 'LinearizationTable'
997
- 0x0097 => TagName.new('ColorBalance'), # First 4 bytes are a version number in ASCII
998
- 0x0098 => TagName.new('LensData'), # First 4 bytes are a version number in ASCII
999
- 0x0099 => TagName.new('RawImageCenter'),
1000
- 0x009A => TagName.new('SensorPixelSize'),
1001
- 0x009C => TagName.new('Scene Assist'),
1002
- 0x009E => TagName.new('RetouchHistory'),
1003
- 0x00A0 => TagName.new('SerialNumber'),
1004
- 0x00A2 => TagName.new('ImageDataSize'),
995
+ 0x0095 => TagEntry.new('NoiseReduction'),
996
+ 0x0096 => TagEntry.new('NEFCurve2'), # ExifTool calls this 'LinearizationTable'
997
+ 0x0097 => TagEntry.new('ColorBalance'), # First 4 bytes are a version number in ASCII
998
+ 0x0098 => TagEntry.new('LensData'), # First 4 bytes are a version number in ASCII
999
+ 0x0099 => TagEntry.new('RawImageCenter'),
1000
+ 0x009A => TagEntry.new('SensorPixelSize'),
1001
+ 0x009C => TagEntry.new('Scene Assist'),
1002
+ 0x009E => TagEntry.new('RetouchHistory'),
1003
+ 0x00A0 => TagEntry.new('SerialNumber'),
1004
+ 0x00A2 => TagEntry.new('ImageDataSize'),
1005
1005
  # 00A3 => unknown - a single byte 0
1006
1006
  # 00A4 => In NEF, looks like a 4 byte ASCII version number ('0200')
1007
- 0x00A5 => TagName.new('ImageCount'),
1008
- 0x00A6 => TagName.new('DeletedImageCount'),
1009
- 0x00A7 => TagName.new('TotalShutterReleases'),
1007
+ 0x00A5 => TagEntry.new('ImageCount'),
1008
+ 0x00A6 => TagEntry.new('DeletedImageCount'),
1009
+ 0x00A7 => TagEntry.new('TotalShutterReleases'),
1010
1010
  # First 4 bytes are a version number in ASCII, with version specific
1011
1011
  # info to follow. Its hard to treat it as a string due to embedded nulls.
1012
- 0x00A8 => TagName.new('FlashInfo'),
1013
- 0x00A9 => TagName.new('ImageOptimization'),
1014
- 0x00AA => TagName.new('Saturation'),
1015
- 0x00AB => TagName.new('DigitalVariProgram'),
1016
- 0x00AC => TagName.new('ImageStabilization'),
1017
- 0x00AD => TagName.new('Responsive AF'), # 'AFResponse'
1018
- 0x00B0 => TagName.new('MultiExposure'),
1019
- 0x00B1 => TagName.new('HighISONoiseReduction'),
1020
- 0x00B7 => TagName.new('AFInfo'),
1021
- 0x00B8 => TagName.new('FileInfo'),
1012
+ 0x00A8 => TagEntry.new('FlashInfo'),
1013
+ 0x00A9 => TagEntry.new('ImageOptimization'),
1014
+ 0x00AA => TagEntry.new('Saturation'),
1015
+ 0x00AB => TagEntry.new('DigitalVariProgram'),
1016
+ 0x00AC => TagEntry.new('ImageStabilization'),
1017
+ 0x00AD => TagEntry.new('Responsive AF'), # 'AFResponse'
1018
+ 0x00B0 => TagEntry.new('MultiExposure'),
1019
+ 0x00B1 => TagEntry.new('HighISONoiseReduction'),
1020
+ 0x00B7 => TagEntry.new('AFInfo'),
1021
+ 0x00B8 => TagEntry.new('FileInfo'),
1022
1022
  # 00B9 => unknown
1023
- 0x0100 => TagName.new('DigitalICE'),
1024
- 0x0103 => TagName.new('PreviewCompression',
1023
+ 0x0100 => TagEntry.new('DigitalICE'),
1024
+ 0x0103 => TagEntry.new('PreviewCompression',
1025
1025
  {1 => 'Uncompressed',
1026
1026
  2 => 'CCITT 1D',
1027
1027
  3 => 'T4/Group 3 Fax',
@@ -1052,37 +1052,37 @@ MAKERNOTE_NIKON_NEWER_TAGS={
1052
1052
  34713 => 'Nikon NEF Compressed',
1053
1053
  65000 => 'Kodak DCR Compressed',
1054
1054
  65535 => 'Pentax PEF Compressed',}),
1055
- 0x0201 => TagName.new('PreviewImageStart'),
1056
- 0x0202 => TagName.new('PreviewImageLength'),
1057
- 0x0213 => TagName.new('PreviewYCbCrPositioning',
1055
+ 0x0201 => TagEntry.new('PreviewImageStart'),
1056
+ 0x0202 => TagEntry.new('PreviewImageLength'),
1057
+ 0x0213 => TagEntry.new('PreviewYCbCrPositioning',
1058
1058
  {1 => 'Centered',
1059
1059
  2 => 'Co-sited'}),
1060
- 0x0010 => TagName.new('DataDump'),
1060
+ 0x0010 => TagEntry.new('DataDump'),
1061
1061
  }
1062
1062
 
1063
1063
  MAKERNOTE_NIKON_OLDER_TAGS = {
1064
- 0x0003 => TagName.new('Quality',
1064
+ 0x0003 => TagEntry.new('Quality',
1065
1065
  {1 => 'VGA Basic',
1066
1066
  2 => 'VGA Normal',
1067
1067
  3 => 'VGA Fine',
1068
1068
  4 => 'SXGA Basic',
1069
1069
  5 => 'SXGA Normal',
1070
1070
  6 => 'SXGA Fine'}),
1071
- 0x0004 => TagName.new('ColorMode',
1071
+ 0x0004 => TagEntry.new('ColorMode',
1072
1072
  {1 => 'Color',
1073
1073
  2 => 'Monochrome'}),
1074
- 0x0005 => TagName.new('ImageAdjustment',
1074
+ 0x0005 => TagEntry.new('ImageAdjustment',
1075
1075
  {0 => 'Normal',
1076
1076
  1 => 'Bright+',
1077
1077
  2 => 'Bright-',
1078
1078
  3 => 'Contrast+',
1079
1079
  4 => 'Contrast-'}),
1080
- 0x0006 => TagName.new('CCDSpeed',
1080
+ 0x0006 => TagEntry.new('CCDSpeed',
1081
1081
  {0 => 'ISO 80',
1082
1082
  2 => 'ISO 160',
1083
1083
  4 => 'ISO 320',
1084
1084
  5 => 'ISO 100'}),
1085
- 0x0007 => TagName.new('WhiteBalance',
1085
+ 0x0007 => TagEntry.new('WhiteBalance',
1086
1086
  {0 => 'Auto',
1087
1087
  1 => 'Preset',
1088
1088
  2 => 'Daylight',