From: Han Holl Date: 2005-12-13T20:59:27+09:00 Subject: LocalJumpError ------=_Part_13867_29040675.1134475160901 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Because ruby-libexif no longer works with libexif-0.6.12, I decided to roll my own Exif class. Quick and dirty. And got a surprising error message. Here's the program: #!/usr/bin/ruby #require 'exif' class Exif < Hash @@want =3D %w{ DateTimeOriginal DateTime ImageDescription PixelYDimension= } def initialize(file) IO.popen("exiv2 -pt '#{file}'") do |h| h.each do |line| a =3D line.split[0].split(/\./)[2].strip if @@want.include?(a) self[a] =3D line[60 .. -1].strip end end end end end def run exif =3D Exif.new('/var/pictures/alpujaras/img_0528_edited.jpg') puts exif['DateTimeOriginal'] exif =3D Exif.new('/bin/ls') puts exif['DateTimeOriginal'] next if exif.empty? puts "won't get here" end run ### End-of-ruby-program If I run this, I get: 2005:01:04 13:22:48 Exiv2 exception in print action for file /bin/ls: /bin/ls: The file contains data of an unknown image type nil ./add_captions.rb:25:in `run': unexpected next (LocalJumpError) from ./add_captions.rb:29 For a real JPEG it works fine, but things get ugly otherwise: I can't quite figure out what this means. Cheers, Han Holl ------=_Part_13867_29040675.1134475160901--