Module: Exif::Tag::Formatter::SRational

Defined in:
lib/exifparser/tag.rb

Overview

convert data to signed rational (4+4 byte) value.

Instance Method Summary collapse

Instance Method Details

#_formatData(data) ⇒ Object



163
164
165
166
167
168
# File 'lib/exifparser/tag.rb', line 163

def _formatData(data)
  a = decode_slong(data[0,4])
  b = decode_slong(data[4,4])
  return Rational(0,1) if b == 0
  Rational(a, b)
end

#formatObject



159
160
161
# File 'lib/exifparser/tag.rb', line 159

def format
  'Signed rational'
end