# OT EXIF libraray

**URL:** <https://www.ruby-forum.com/t/ot-exif-libraray/64137>\
**Category:** Rails\
**Created:** [June 22, 2006, 11:42am UTC](https://www.ruby-forum.com/t/ot-exif-libraray/64137 "2006-06-22T11:42:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus\_Strickler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Markus\_Strickler](https://www.ruby-forum.com/u/Markus_Strickler)\
**Post date:** [June 22, 2006, 11:42am UTC](https://www.ruby-forum.com/t/ot-exif-libraray/64137/1 "2006-06-22T11:42:00Z")

</div>

Hi-

this is slightly off topic, but is anyone aware of a WORKING ruby  
library that reads EXIF data from JPEG files?  
It has to run on both Windows and \*nix, so wrappers around unix libs  
won’t do.

So far I tried rexif, ruby-exif (both throwing exceptions when presented  
with a JPEG) and RMagick (at least able to get the date  
from EXIF, however it adds a ‘.’ at the end for whatever reason plus  
unable to read GPS info from EXIF).

libexif and wrappers around gtk seem problematic in the windows  
environment.

What’s everbody else using?

thanks for your help,

-markus

---

<div class="post-metadata">

**Author:** ![Markus\_Strickler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Markus\_Strickler](https://www.ruby-forum.com/u/Markus_Strickler)\
**Post date:** [June 22, 2006, 7:26pm UTC](https://www.ruby-forum.com/t/ot-exif-libraray/64137/2 "2006-06-22T19:26:25Z")

</div>

Doesn’t Magick#get\_exif\_by\_entry give you what you need?

> From the documentation:

image.get\_exif\_by\_entry(‘Make’) =\> [[“Make”, “Canon”]]

I know you’re looking for GPS, but perhaps you should try  
get\_exif\_by\_number  
to find that.

See:

[http://www.simplesystems.org/RMagick/doc/image2.html#get\_exif\_by\_entry](http://www.simplesystems.org/RMagick/doc/image2.html#get_exif_by_entry)

## HTH

View this message in context:  
[http://www.nabble.com/OT-EXIF-libraray-t1829170.html#a4997839](http://www.nabble.com/OT-EXIF-libraray-t1829170.html#a4997839)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Markus\_Strickler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Markus\_Strickler](https://www.ruby-forum.com/u/Markus_Strickler)\
**Post date:** [June 23, 2006, 11:59am UTC](https://www.ruby-forum.com/t/ot-exif-libraray/64137/3 "2006-06-23T11:59:13Z")

</div>

Hi-

> -----Original Message-----  
> From: removed\_email\_address@domain.invalid  
> [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of s.ross  
> Sent: Thursday, June 22, 2006 7:24 PM  
> To: removed\_email\_address@domain.invalid  
> Subject: Re: [Rails] OT EXIF libraray
> 
> Doesn’t Magick#get\_exif\_by\_entry give you what you need?

unfortunately not.

> > From the documentation:
> 
> image.get\_exif\_by\_entry(‘Make’) =\> [[“Make”, “Canon”]]

Well  
image.get\_exif\_by\_entry(‘DateTime’) =\> [[“DateTime”, “2002:07:19  
13:28:10.”]]

which is wrong in the first place, as it should be “2002:07:19 13:28:10”  
(no . at the end). This would be easy enough to work  
around, but might as well be a problem with the RMagick/ImageMagick  
version.

Unfortunately GPSInfo is stored in its own IFD and a  
get\_exif\_by\_entry(‘GPSInfo’) just gives you the offset to that IFD.  
Looking for  
the tag number won’t help for the same reason. The API seems to lack a  
way to specify the IFD you want to get the entry from.

Anyway, thanks for your help.

-markus
