Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This library is an alternative approach of a wrapper for the Exiftool command-line application (http://www.sno.phy.queensu.ca/~phil/exiftool/) written by Phil Harvey. (See MiniExiftool) The goal is performance and the possibility to handle multiple files at once.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples New example using the functional api.
lib Tidy up attribute accessors.
regtest
test
.aspell.pws
.gitignore Complete rewrite of the test suite to use real tests.
.travis.yml Install exiftool in .travis.yml.
CHANGELOG
LICENSE Complete rewrite of the test suite to use real tests.
README.rdoc
Rakefile

README.rdoc

MultiExiftool

Description

This library is wrapper for the Exiftool command-line application (www.sno.phy.queensu.ca/~phil/exiftool) written by Phil Harvey. It is designed for dealing with multiple files at once by creating commands to call exiftool with various arguments, call it and parsing the results.

Examples

Reading

require 'multi_exiftool'

# Object oriented approach
reader = MultiExiftool::Reader.new
reader.filenames = Dir['*.jpg']
results = reader.read
unless reader.errors.empty?
  $stderr.puts reader.errors
end
results.each do |values|
 puts "#{values.file_name}: #{values.comment}"
end

# Functional approach
results, errors = MultiExiftool.read(Dir['*.jpg'])
unless reader.errors.empty?
  $stderr.puts reader.errors
end
results.each do |values|
 puts "#{values.file_name}: #{values.comment}"
end

Writing

require 'multi_exiftool'

# Object oriented approach
writer = MultiExiftool::Writer.new
writer.filenames = Dir['*.jpg']
writer.values = {creator: 'Jan Friedrich', copyright: 'Public Domain'}
if writer.write
  puts 'ok'
else
  puts writer.errors
end

# Functional approach
errors = MultiExiftool.write(Dir['*.jpg'],  {creator: 'Jan Friedrich', copyright: 'Public Domain'})
if errors.empty?
  puts 'ok'
else
  puts writer.errors
end

Further Examples

See the examples in the examples directory.

Requirements

  • Ruby 1.9.1 or higher

  • An installation of the Exiftool command-line application (version 7.65 or higher). Instructions for installation you can find under www.sno.phy.queensu.ca/~phil/exiftool/install.html .

  • If you have problems with special characters (like German umlauts) in

filenames on windows system it is recommended to use exiftool version 9.79 or higher.

Installation

First you need Exiftool (see under Requirements above). Then you can simply install the gem with

gem install multi_exiftool

Contribution

The code is also hosted in a git repository at github.com/janfri/multi_exiftool or bitbucket.org/janfri/multi_exiftool feel free to contribute!

Author

Jan Friedrich <janfri26gmail.com>

Copyright / License

The MIT License

Copyright (c) 2009-2015 Jan Friedrich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Something went wrong with that request. Please try again.