Class: ImageVoodoo::Directory
- Inherits:
-
Object
- Object
- ImageVoodoo::Directory
- Defined in:
- lib/image_voodoo/metadata.rb
Overview
All metadata are contained within Directories. An image may have n directories. You have to know a bit about the image to khow what to look at (e.g. a image from a Pentax camera may have a PentaxMakerNote directory.
Direct Known Subclasses
AdobeJpegDirectory, BmpHeaderDirectory, CanonMakernoteDirectory, CasioType1MakernoteDirectory, CasioType2MakernoteDirectory, ExifIFD0Directory, ExifInteropDirectory, ExifSubIFDDirectory, ExifThumbnailDirectory, FujifilmMakernoteDirectory, GifHeaderDirectory, GpsDirectory, IccDirectory, IptcDirectory, JfifDirectory, JpegCommentDirectory, JpegDirectory, KyoceraMakernoteDirectory, LeicaMakernoteDirectory, NikonType1MakernoteDirectory, NikonType2MakernoteDirectory, OlympusMakernoteDirectory, PanasonicMakernoteDirectory, PentaxMakernoteDirectory, PhotoshopDirectory, PngChromaticitiesDirectory, PngDirectory, PsdHeaderDirectory, RicohMakernoteDirectory, SanyoMakernoteDirectory, SigmaMakernoteDirectory, SonyType1MakernoteDirectory, SonyType6MakernoteDirectory, XmpDirectory
Instance Method Summary collapse
-
#[](tag_name) ⇒ Object
Return tag value for the tag specified or nil if there is none defined.
-
#exists? ⇒ Boolean
Does the directory you requested exist as metadata for this image.
-
#initialize(metadata) ⇒ Directory
constructor
A new instance of Directory.
Constructor Details
#initialize(metadata) ⇒ Directory
Returns a new instance of Directory.
56 57 58 |
# File 'lib/image_voodoo/metadata.rb', line 56 def initialize() @directory = .get_directory self.class.directory_class.java_class end |
Instance Method Details
#[](tag_name) ⇒ Object
Return tag value for the tag specified or nil if there is none defined.
69 70 71 72 73 74 75 76 |
# File 'lib/image_voodoo/metadata.rb', line 69 def [](tag_name) return nil unless @directory (tag_type, tag_method) = self.class::TAGS[tag_name.to_s] raise ArgumentError, "Unkown tag_name: #{tag_name}" unless tag_type java_tag_type = self.class.directory_class.const_get tag_type return nil unless @directory.contains_tag java_tag_type @directory.__send__ tag_method, java_tag_type end |
#exists? ⇒ Boolean
Does the directory you requested exist as metadata for this image.
62 63 64 |
# File 'lib/image_voodoo/metadata.rb', line 62 def exists? @directory end |