Browse files

Fix bug #17470, get_exif_by_xxxx may fail when called with at least o…

…ne argument
  • Loading branch information...
1 parent ca5b661 commit 62a895fdcdc8fc73178f8493cc7a2bf67e3dab23 rmagick committed Jan 25, 2008
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/RMagick.rb
View
6 lib/RMagick.rb
@@ -1,4 +1,4 @@
-# $Id: RMagick.rb,v 1.64 2008/01/05 22:21:52 rmagick Exp $
+# $Id: RMagick.rb,v 1.65 2008/01/25 00:43:01 rmagick Exp $
#==============================================================================
# Copyright (C) 2007 by Timothy P. Hunter
# Name: RMagick.rb
@@ -775,6 +775,7 @@ def get_exif_by_entry(*entry)
exif_data.split("\n").each { |exif| ary.push(exif.split('=')) }
end
else
+ get_exif_by_entry() # ensure properties is populated with exif data
entry.each do |name|
rval = self["EXIF:#{name}"]
ary.push([name, rval])
@@ -796,8 +797,9 @@ def get_exif_by_number(*tag)
end
end
else
+ get_exif_by_number() # ensure properties is populated with exif data
tag.each do |num|
- rval = self["EXIF:#{'#%04X' % num}"]
+ rval = self['#%04X' % num.to_i]
hash[num] = rval == 'unknown' ? nil : rval
end
end

0 comments on commit 62a895f

Please sign in to comment.