Class: Exif::Tag::MakerNote::Quality

Inherits:
Base
  • Object
show all
Defined in:
lib/exifparser/makernote/nikon.rb,
lib/exifparser/makernote/fujifilm.rb

Overview

0x1000 - Quality

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, #processData, #value

Constructor Details

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

Instance Method Details

#to_sObject



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
# File 'lib/exifparser/makernote/nikon.rb', line 23

def to_s
  n = @formatted.to_i - 1
  (s, q) = n.divmod(3)

  f =
    case s
    when 0
      'VGA'
    when 1
      'SVGA'
    when 2
      'SXGA'
    when 3
      'UXGA'
    else
      'Unknown size'
  end

  f << ' ' <<
    case q
    when 0
      'Basic'
    when 1
      'Normal'
    when 2
      'Fine'
    else
      'Unknown quality'
    end
  f
end