Module: XMPR

Defined in:
lib/xmpr.rb,
lib/xmpr/version.rb

Overview

XMPR

XMP reader

XMPR has some known namespaces, like “dc” for dublin core. See the NAMESPACES constants for a complete list.

## Example

xmp = XMPR.parse(File.read('xmp.xml'))
xmp["dc", "title"] # => "Amazing Photo"
xmp["photoshop", "Category"] # => "summer"
xmp["photoshop", "SupplementalCategories"] # => ["morning", "sea"]

## References

Defined Under Namespace

Classes: XMP

Constant Summary collapse

NAMESPACES =

Namespace shortcuts, and fallbacks for undeclared namespaces.

{
  "aux" => "http://ns.adobe.com/exif/1.0/aux/",
  "cc" => "http://creativecommons.org/ns#",
  "crs" => "http://ns.adobe.com/camera-raw-settings/1.0/",  
  "dc" => "http://purl.org/dc/elements/1.1/",
  "exif" => "http://ns.adobe.com/exif/1.0/",
  "Iptc4xmpCore" => "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/",
  "pdf" => "http://ns.adobe.com/pdf/1.3/",
  "photoshop" => "http://ns.adobe.com/photoshop/1.0/",
  "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
  "tiff" => "http://ns.adobe.com/tiff/1.0/",
  "x" => "adobe:ns:meta/",
  "xap" => "http://ns.adobe.com/xap/1.0/",
  "xmp" => "http://ns.adobe.com/xap/1.0/",
  "xmpidq" => "http://ns.adobe.com/xmp/Identifier/qual/1.0/",
  "xmpBJ" => "http://ns.adobe.com/xap/1.0/bj/",
  "xmpRights" => "http://ns.adobe.com/xap/1.0/rights/",
  "xmpMM" => "http://ns.adobe.com/xap/1.0/mm/",
  "xmpTPg" => "http://ns.adobe.com/xap/1.0/t/pg/",
}
DEFAULT_NAMESPACE =
"http://ns.adobe.com/xap/1.0/"
VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.parse(value) ⇒ Object



44
45
46
# File 'lib/xmpr.rb', line 44

def self.parse(value)
  XMP.new(value)
end