Giter Site home page Giter Site logo

xmpr's Introduction

XMP Reader

Build Status

XMP Reader in Ruby. Parse XMP data extracted from an image into rich data types.

Usage

Use something like imagemagick to extract the XMP, then read it with this class:

require "xmpr"
raw_xmp = `convert image.jpg xmp:-`
xmp = XMPR.parse(raw_xmp)
xmp["dc", "title"] # => "Amazing Photo"
xmp["photoshop", "Category"] # => "summer"
xmp["photoshop", "SupplementalCategories"] # => ["morning", "sea"]

The xmp instance fetches namespaced attributes. You can use fully qualified namespaces, or some namespaces have shortcuts:

xmp["http://purl.org/dc/elements/1.1/", "title"] # => "Amazing Photo"
xmp["dc", "title"] # => "Amazing Photo" (same thing)

The following namespaces have shortcuts:

  • auxhttp://ns.adobe.com/exif/1.0/aux/
  • cchttp://creativecommons.org/ns# (Creative Commons)
  • crshttp://ns.adobe.com/camera-raw-settings/1.0/
  • dchttp://purl.org/dc/elements/1.1/ (Dublin Core)
  • exifhttp://ns.adobe.com/exif/1.0/
  • Iptc4xmpCorehttp://iptc.org/std/Iptc4xmpCore/1.0/xmlns/ (IPTC)
  • pdfhttp://ns.adobe.com/pdf/1.3/
  • photoshophttp://ns.adobe.com/photoshop/1.0/
  • rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
  • tiffhttp://ns.adobe.com/tiff/1.0/
  • xadobe:ns:meta/
  • xaphttp://ns.adobe.com/xap/1.0/
  • xmphttp://ns.adobe.com/xap/1.0/ (XMP)
  • xmpidqhttp://ns.adobe.com/xmp/Identifier/qual/1.0/
  • xmpBJhttp://ns.adobe.com/xap/1.0/bj/
  • xmpRightshttp://ns.adobe.com/xap/1.0/rights/
  • xmpMMhttp://ns.adobe.com/xap/1.0/mm/
  • xmpTPghttp://ns.adobe.com/xap/1.0/t/pg/

Thanks

Refactored from XMP. Inspired by ExifTool.

References

License

MIT license, see LICENSE.

xmpr's People

Contributors

carterpape avatar da2x avatar sj26 avatar tigerwolf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.