Displaying 1 result from an estimated 1 matches for "display_thumb".
2006 Nov 04
0
Minimagick issue writing resized file
...per method in my Rails app that uses Minimagick as a plugin.
All is fine except for the write step where I attempt to write the
resized file to another directory.
I get the error: "undefined method `to_str'' for #<Array:0x25221e8>"
Here''s my resizing method:
def display_thumb(product_id)
# glob through images/books/thumbs dir to find thumb that matches isbn of book
p = Product.find(product_id).isbn
z = Dir["#{RAILS_ROOT}/public/images/books/#{p}.{gif,jpg,png}"]
i = MiniMagick::Image.new(z)
w = i[:width]
h = i[:height]
w = w.to_f
h = h.to_f
ma...