0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Minimal ruby wrapper around exiftool..
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
>= 0
 Project Readme

micro_exiftool Build Status

micro_exiftool is an extremely basic ruby wrapper for the ExifTool command line tool.

It allows to read and write metadata for all files supported by ExifTools, such as JPG or MP3.

This was the simplest tool that fit my own needs and deliberately tries to do as little as possible.

If you need a more complete implementation, you might want to take a look at mini_exiftool.

Installation

You need to have exiftool installed and on your PATH.

Add this line to your application's Gemfile:

gem 'micro_exiftool'

And then execute:

$ bundle

Or install it yourself as:

$ gem install micro_exiftool

Usage

All attributes are plain strings.

Read attributes

file = MicroExiftool::File.new(path_to_file)

file.attributes               # hash including all attributes returned by exiftool
file['EXIF:Copyright']        # the EXIF copyright field
file['IPTC:CopyrightNotice']  # the IPTC copyright field

Update attributes

file = MicroExiftool::File.new(path_to_file)

file.update!(
  'EXIF:Copyright' => 'new EXIF copyright',
  'IPTC:CopyrightNotice' => 'new IPTC copyright',
)

This will update the attributes of the file in place.

Note that there is (currently) no validation that the fields are actually valid metadata fields. If you set an unknown field, it will be silently ignored.

Author

Tobias Kraze from makandra

License

Licensed under the MIT license.