How to update EXIF tags of a picture file in Ruby?
Asked Answered
A

3

7

Title says everything.

Anarchist answered 18/4, 2010 at 15:49 Comment(0)
X
6

I'm using MiniExiftool, a ruby interface to Perl's Exiftool.

Usage:

exif = MiniExiftool.new(file_path)
exif.date_time_original = Time.now
exif["captionextract"] = "This is my new caption"
exif.save

There is also: https://github.com/janfri/multi_exiftool

Xavierxaviera answered 23/3, 2011 at 19:26 Comment(3)
I've had success editing existing tags but is there a way to add new ones?Superstratum
exif["whatever"] = "Foo"Xavierxaviera
if you are looking for just a reader, there is github.com/exiftool-rb/exiftool.rbGasman
T
1

Have you tried exifr?

EXIF Reader is a module to read EXIF from JPEG and TIFF images.

Toaster answered 20/5, 2010 at 8:49 Comment(2)
Yes I did. It can only read tags but there isn't any writing support. I'm now using a call to the "jhead" tool.Anarchist
"exifr" stands for "exif reader" and you didn't answer the question.Sculptress
P
0

Try ruby-libexif: http://raa.ruby-lang.org/project/ruby-libexif/

Usage: http://74.125.113.132/search?q=cache:yjOeG4UnD38J:tach.arege.net/trac/browser/debian/libexif-ruby/trunk/exif.rd.en%3Frev%3D51%26format%3Draw+ruby+set+exif+tag&cd=10&hl=en&ct=clnk&gl=us&client=firefox-a

Perilymph answered 19/4, 2010 at 1:39 Comment(2)
Thanks, I had seen this projet but it seems to be dead, all links are broken so I'm unable to install it...Anarchist
Oh, that sucks. I'll go ahead and be blasphemous then. Try this: tilloy.net/dev/pyexiv2Perilymph

© 2022 - 2024 — McMap. All rights reserved.