
Rexif is a pure ruby library for handling JPEG/EXIF formatted images.
Rexif consists of two libraries; rjpeg.rb (for JPEG) and rexif.rb (for EXIF).
The latest version is rexif-0.4 (Feb.17.2003.).
Old versions are here.
% su # ruby install.rb
See API reference document for detail.
require 'rexif'
Jpeg::use_class_for(Jpeg::Segment::APP1,Exif)
j=Jpeg::load('EXIF_FILE.JPG')
if(j.app1.is_exif?)
puts j.app1.ifd0.marker
end
require 'rexif'
Jpeg::load('EXIF_FILE.JPG'){|seg|
if(seg.marker==Jpeg::Segment::APP1)
Exif.new(seg.marker,seg.byte_data){|dir|
if(dir.tag==Exif::Ifd::Directory::Maker)
puts dir
end
dir
}
else
seg
end
}
In this method, each return value of Jpeg::load()'s and Exif::new()'s block is treated as Jpeg segment data and Exif directory data, and those return values are stored to Jpeg object and Exif object.
Copyright © 2003 NISHI Takao <zophos@koka-in.org> All rights
reserved.
This is free software with ABSOLUTELY NO WARRANTY.
You can redistribute it and/or modify it under the terms of Ruby's licence.
See Change Log for detail.