I get the following error at the browser:
ArgumentError in ImagesController#upload
invalid geometry string `110×’
… for the call to change_geometry with an explicit size (‘110x’) as
the geometry string:
def make_thumb (the_img)
require ‘RMagick’
size = “110x”
debugger if ENV[‘RAILS_ENV’] == ‘development’
img = Magick::Image.from_blob(the_img.img_data).first
img.change_geometry(‘110×’) {|cols, rows, i| i.resize!
(cols,rows) }
img.change_geometry(“110×”) {|cols, rows, i| i.resize!
(cols,rows) }
img.change_geometry("#{size}") {|cols, rows, i| i.resize!
(cols,rows) }
end
… but it all works OK when the size is buried within “#{size}”.
The debugger doesn’t seem to see any difference:
(rdb:1) l
[112, 121] in ./script/…/config/…/app/controllers/
images_controller.rb
112 def make_thumb (the_img)
113 require ‘RMagick’
114 size = “110x”
115 debugger if ENV[‘RAILS_ENV’] == ‘development’
=> 116 img = Magick::Image.from_blob(the_img.img_data).first
117 img.change_geometry(‘110×’) {|cols, rows, i| i.resize!
(cols,rows) }
118 # img.change_geometry(“110×”) {|cols, rows, i| i.resize!
(cols,rows) }
119 # img.change_geometry("#{size}") {|cols, rows, i| i.resize!
(cols,rows) }
120 end
121
(rdb:1) p size
“110x”
(rdb:1) p (‘110×’)
“110×”
(rdb:1) p (“110×”)
“110×”
(rdb:1) p ("#{size}")
“110x”
… and I sure don’t. Am still trying to figure out which way is up
with much of this, and would appreciate any insight as to what’s going
on here.
Thanks!
ps:
ruby 1.8.5 (2006-12-04 patchlevel 2) [i386-linux]
rails-1.2.2
GraphicsMagick 1.1.7
RMagick-1.15.2
fedora core 5