rexml in ruby 1.8.6 is more strict that attributes cannot be Fixnum objects
authorgc <gc>
Sat, 16 Jun 2007 17:55:12 +0000 (17:55 +0000)
committergc <gc>
Sat, 16 Jun 2007 17:55:12 +0000 (17:55 +0000)
bin/booh
lib/booh/booh-lib.rb

index fe73377..26be6d9 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -454,7 +454,7 @@ def rotate_real(angle, thumbnail_img, img, xmlelem, attributes_prefix, desired_x
     $modified = true
 
     #- update rotate attribute
-    xmlelem.add_attribute("#{attributes_prefix}rotate", (xmlelem.attributes["#{attributes_prefix}rotate"].to_i + angle) % 360)
+    xmlelem.add_attribute("#{attributes_prefix}rotate", ((xmlelem.attributes["#{attributes_prefix}rotate"].to_i + angle) % 360).to_s)
 
     $modified_pixbufs[thumbnail_img] ||= {}
     $modified_pixbufs[thumbnail_img][:angle_to_orig] = (($modified_pixbufs[thumbnail_img][:angle_to_orig] || 0) + angle) % 360
@@ -556,7 +556,7 @@ def change_pano_amount(xmldir, attributes_prefix, value)
     if value.nil?
         xmldir.delete_attribute("#{attributes_prefix}pano-amount")
     else
-        xmldir.add_attribute("#{attributes_prefix}pano-amount", value)
+        xmldir.add_attribute("#{attributes_prefix}pano-amount", value.to_s)
     end
 end
 
index 77e2c66..50b45eb 100644 (file)
@@ -327,7 +327,7 @@ module Booh
                 end
                 rotate = felem.attributes["#{attributes_prefix}rotate"]
                 if !rotate
-                    felem.add_attribute("#{attributes_prefix}rotate", rotate = guess_rotate(orig).to_i)
+                    felem.add_attribute("#{attributes_prefix}rotate", rotate = guess_rotate(orig).to_s)
                 end
                 convert_options += "-rotate #{rotate} "
                 if felem.attributes["#{attributes_prefix}enhance"]