Project

xmp

0.06
No commit activity in last 3 years
No release in over 3 years
Extensible Metadata Platform (XMP) parser
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.4
~> 2.0

Runtime

~> 1.5.0
 Project Readme

xmp - Extensible Metadata Platform (XMP) parser¶ ↑

XMP provides object oriented interface to XMP data (en.wikipedia.org/wiki/Extensible_Metadata_Platform). XMP data can be found in PDF, JPEG, GIF, PNG, and many other formats.

Supported formats¶ ↑

Currently only JPEG is supported through exifr gem.

JPEG example¶ ↑

# gem install xmp exifr
require 'xmp'
require 'exifr'
require 'open-uri'

img = EXIFR::JPEG.new('spec/fixtures/multiple-app1.jpg')
xmp = XMP.parse(img)
xmp.dc.subject #=> ["something interesting"]

# explore XMP data
xmp.namespaces.each do |namespace_name|
  namespace = xmp.send(namespace_name)
  namespace.attributes.each do |attr|
    puts "#{namespace_name}.#{attr}: " + namespace.send(attr).inspect
  end
end

Installation¶ ↑

gem install xmp
# for JPEG support
gem install exifr -v ">=1.0.4"

Requirements¶ ↑

  • Ruby 1.8.7, 1.9.2

  • Nokogiri 1.4

  • EXIFR >= 1.0.4

Development¶ ↑

Fork it at github.com/amberbit/xmp

# install development dependencies
bundle install
# run specs
rake spec

License¶ ↑

Ruby’s license.

Copyright © 2011 Wojciech Piekutowski, AmberBit (amberbit.com)