by remvee

remvee / exifr

EXIF Reader

445 Stars 63 Forks Last release: Not found MIT License 234 Commits 33 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

= EXIF Reader {Gem Version}[https://badge.fury.io/rb/exifr]

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

== Examples require 'exifr/jpeg' EXIFR::JPEG.new('IMG6841.JPG').width # => 2272 EXIFR::JPEG.new('IMG6841.JPG').height # => 1704 EXIFR::JPEG.new('IMG6841.JPG').exif? # => true EXIFR::JPEG.new('IMG6841.JPG').model # => "Canon PowerShot G3" EXIFR::JPEG.new('IMG6841.JPG').datetime # => Fri Feb 09 16:48:54 +0100 2007 EXIFR::JPEG.new('IMG6841.JPG').exposuretime.tos # => "1/15" EXIFR::JPEG.new('IMG6841.JPG').fnumber.tof # => 2.0 EXIFR::JPEG.new('enkhuizen.jpg').gps.latitude # => 52.7197888888889 EXIFR::JPEG.new('enkhuizen.jpg').gps.longitude # => 5.28397777777778

require 'exifr/tiff' EXIFR::TIFF.new('DSC0218.TIF').width # => 3008 EXIFR::TIFF.new('DSC0218.TIF')[1].width # => 160 EXIFR::TIFF.new('DSC0218.TIF').model # => "NIKON D1X" EXIFR::TIFF.new('DSC0218.TIF').datetime # => Tue May 23 19:15:32 +0200 2006 EXIFR::TIFF.new('DSC0218.TIF').exposuretime.tos # => "1/100" EXIFR::TIFF.new('DSC0218.TIF').fnumber.to_f # => 5.0

== Logging warnings When EXIF information is malformed, a warning is logged to STDERR with the standard Ruby logger. Log to some other location by supplying an alternative implementation:

EXIFR.logger = SyslogLogger.new

== Time zone support EXIF does not support time zones so this code does not support time zones. All time stamps are created in the local time zone with:


It is possible to change this behavior by supplying an alternative implementation. For those who prefer UTC:

EXIFR::TIFF.mktime_proc = proc{|args| Time.utc(args)}

Or when the application depends on ActiveSupport for time zone handling:

EXIFR::TIFF.mktime_proc = proc{|args| Time.zone.local(args)}

== XMP data access If you need to access XMP data you can use the xmp gem. More info and examples at https://github.com/amberbit/xmp

== Development and running tests

On a fresh checkout of the repository, run

bundle install
and then
bundle exec rake test

== Author R.W. van 't Veer

== Copyright Copyright (c) 2006-2020 - R.W. van 't Veer

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.