RMagick Exif

J

John Smith

Hi all:

I have been working to extract the exif information from jpegs using
RMagick and the get_exif_by_entry function. However, no matter what I
try it returns an empty array. I am certain the file has exif info as I
save it from Photoshop with the embed XMP option selected.

A simply test such as:

photo = Magick::Image.read(path_to_file).first

photo.get_exif_by_entry

returns [] always

Am I missing something?

I have RMagick 2.0 installed.

Thanks,

John
 
C

Carlo E. Prelz

Subject: RMagick Exif
Date: Wed 02 Jan 08 04:40:33PM +0900

Quoting John Smith ([email protected]):
I have been working to extract the exif information from jpegs using
RMagick and the get_exif_by_entry function. However, no matter what I
try it returns an empty array. I am certain the file has exif info as I
save it from Photoshop with the embed XMP option selected.

A simply test such as:

photo = Magick::Image.read(path_to_file).first

photo.get_exif_by_entry

returns [] always

Here I receive a populated hash. You say you are sure that the tags
are present, but did you check this with a standalone tool
(e.g. exiftags here on linux)?

Carlo
 
T

Tim Hunter

John said:
Hi all:

I have been working to extract the exif information from jpegs using
RMagick and the get_exif_by_entry function. However, no matter what I
try it returns an empty array. I am certain the file has exif info as I
save it from Photoshop with the embed XMP option selected.

A simply test such as:

photo = Magick::Image.read(path_to_file).first

photo.get_exif_by_entry

returns [] always

Am I missing something?

I have RMagick 2.0 installed.

Thanks,

John

Open a bug track on RubyForge and upload the image you're trying to use.
Also add which version of ImageMagick you're using.
 
J

John Smith

Carlo said:
Subject: RMagick Exif
Date: Wed 02 Jan 08 04:40:33PM +0900

Quoting John Smith ([email protected]):
returns [] always

Here I receive a populated hash. You say you are sure that the tags
are present, but did you check this with a standalone tool
(e.g. exiftags here on linux)?

Carlo

Yes, I have made sure that the exif information is there by loading the
file into Lightroom and it is able to list all the exif data.
 
J

John Smith

Tim said:
Open a bug track on RubyForge and upload the image you're trying to use.
Also add which version of ImageMagick you're using.

ImageMagick version 6.3.5.
 
C

Carlo E. Prelz

Subject: Re: RMagick Exif
Date: gio 03 gen 08 04:30:44 +0900

Quoting John Smith ([email protected]):
Yes, I have made sure that the exif information is there by loading the
file into Lightroom and it is able to list all the exif data.

The best thing you can do is open a ticket on rubyforge, attaching a
copy of the image, as the author of rmagick suggested. First register
at

http://rubyforge.org/account/register.php

and then login and submit your ticket at

http://rubyforge.org/tracker/?func=add&group_id=12&atid=133

Carlo
 
O

Ollivier Robert

I have been working to extract the exif information from jpegs using
RMagick and the get_exif_by_entry function. However, no matter what I
try it returns an empty array. I am certain the file has exif info as I
save it from Photoshop with the embed XMP option selected.

The way I deal with these is by using exiftool with the mini_exiftool Ruby module. It has been working great so far.

-----
require "rubygems"
require "mini_exiftool"
[...]
def set_lens_info(data)
lens_type = data.lens_type
#
# Check for M-42 lens
#
if lens_type.nil? or lens_type =~ /M-42|K,M/ then
[...]
data.lens_type = lens_type
data.save
end # -- set_lens_info
[...]
def main(argv)
argv.each do |fn|
data = MiniExiftool.new(fn)
ts = data.date_time_original
save_ok = set_lens_info(data)
if save_ok then
File.utime(Time.now, ts, fn)
STDERR.puts("#{fn} saved ok, time changed")
STDERR.puts(" #{data.lens}")
else
STDERR.puts("Error saving #{fn}")
data.errors.each do |fld, msg|
STDERR.puts(" #{fld}: #{msg}")
end
end
end
return 0
end # -- main
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,275
Messages
2,571,375
Members
48,069
Latest member
RandallDav

Latest Threads

Top