Class: Exif::Tag::MakerNote::Tag0x0004

Inherits:
Base
  • Object
show all
Defined in:
lib/exifparser/makernote/canon.rb

Overview

0x0004 - Tag0x0004

Instance Attribute Summary

Attributes inherited from Base

#IFD, #count, #data, #dataPos, #pos, #tagID

Instance Method Summary collapse

Methods inherited from Base

#formatExposureTime, #formatFNumber, #formatFocalLength, #formatLatLon, #initialize, #inspect, #name, #to_s

Constructor Details

This class inherits a constructor from Exif::Tag::Base

Instance Method Details

#processDataObject



275
276
277
278
279
280
# File 'lib/exifparser/makernote/canon.rb', line 275

def processData
  @formatted = []
  partition_data(@count) do |part|
    @formatted.push _formatData(part)
  end
end

#valueObject



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/exifparser/makernote/canon.rb', line 282

def value
  numTags = @formatted[0] / 2
  ret = {}

  return hash if numTags < 8
  # offset 7 : white balance
  ret['White balance'] =
  case @formatted[7]
  when 0
    "Auto"
  when 1
    "Sunny"
  when 2
    "Cloudy"
  when 3
    "Tungsten"
  when 4
    "Florescent"
  when 5
    "Flash"
  when 6
    "Custom"
  else
    "Unknown"
  end

  return ret if numTags < 10
  # offset 9: Sequence number (if in a continuous burst)
  ret['Sequence number'] = @formatted[9]

  return ret if numTags < 15
  # offset 14: Auto Focus point used
  ret['Auto Focus point used'] = @formatted[14]

  return ret if numTags < 16
  ret['Flash bias'] =
  case @formatted[15]
  when 0xffc0
    "-2 EV"
  when 0xffcc
    "-1.67 EV"
  when 0xffd0
    "-1.50 EV"
  when 0xffd4
    "-1.33 EV"
  when 0xffe0
    "-1 EV"
  when 0xffec
    "-0.67 EV"
  when 0xfff0
    "-0.50 EV"
  when 0xfff4
    "-0.33 EV"
  when 0x0000
    "0 EV"
  when 0x000c
    "0.33 EV"
  when 0x0010
    "0.50 EV"
  when 0x0014
    "0.67 EV"
  when 0x0020
    "1 EV"
  when 0x002c
    "1.33 EV"
  when 0x0030
    "1.50 EV"
  when 0x0034
    "1.67 EV"
  when 0x0040
    "2 EV"
  else
    "Unknown"
  end

  return ret if numTags < 20
  ret['Subject Distance'] = @formatted[19]

  ret
end