module FileData::TagEnumerator

Contains the ability to enumerate through the exif tags in an ifd

Constants

TAG_RECORD_SIZE

Public Instance Methods

read_num_tags() click to toggle source
# File lib/file_data/formats/exif/ifd.rb, line 16
def read_num_tags
  stream.read_value(2)
end
tags_enum() click to toggle source
# File lib/file_data/formats/exif/ifd.rb, line 6
def tags_enum
  Enumerator.new do |e|
    read_num_tags.times do
      tag_start_pos = stream.pos
      e.yield stream.read_value(2)
      stream.seek(tag_start_pos + TAG_RECORD_SIZE)
    end
  end.lazy
end
tags_size(num_tags) click to toggle source
# File lib/file_data/formats/exif/ifd.rb, line 20
def tags_size(num_tags)
  num_tags * TAG_RECORD_SIZE
end