Class: FileData::ExifData

Inherits:
Object
  • Object
show all
Defined in:
lib/file_data/formats/exif/exif_data.rb

Overview

Container for Exif tag values

Constant Summary collapse

SECTIONS =
{ 0 => :image, 1 => :thumbnail }.freeze

Instance Method Summary collapse

Constructor Details

#initializeExifData

Returns a new instance of ExifData.



7
8
9
# File 'lib/file_data/formats/exif/exif_data.rb', line 7

def initialize
  @hash = SECTIONS.each_with_object({}) { |pair, hash| hash[pair[0]] = {} }
end

Instance Method Details

#add_tag(index, ifd_id, tag_id, tag_value) ⇒ Object



11
12
13
14
# File 'lib/file_data/formats/exif/exif_data.rb', line 11

def add_tag(index, ifd_id, tag_id, tag_value)
  name = ExifTags.get_tag_name(ifd_id, tag_id)
  @hash[index][name] = tag_value
end