Exempi is an ultra-thin FFI-based wrapper for the Exempi C library. It wraps Exempi's functions in the Exempi module.
Don't like dealing with C functions directly? Check out Fasttrack, an object-oriented wrapper around Exempi.
Add this line to your application's Gemfile:
gem 'exempi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install exempi
Opening a file:
# create an empty file pointer
file_ptr = Exempi.xmp_files_new
Exempi.xmp_files_open file_ptr, "myfile.jpg", :XMP_OPEN_READ
Extracting XMP from a file:
xmp_ptr = Exempi.files_get_new_xmp file_ptr
Fetching an XMP property from a file:
# Exempi provides a set of standard namespace URIs for you
exif_ns = Exempi::Namespaces::XMP_NS_EXIF
xmp_string = Exempi.xmp_string_new
Exempi.xmp_get_property xmp_ptr, exif_ns, 'DateTimeOriginal', xmp_string
datetime = Exempi.xmp_string_cstr xmp_string
Exempi.xmp_string_free xmp_string
For more information see Exempi's function documentation, included in lib/exempi/exempi.rb.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
3-clause BSD, identical to the license used by Exempi and Adobe XMP Toolkit. For the license text, see LICENSE.