Maybe I’m a fool for putting my RMagick into a Rails controller and not a model. We’ll see, later. After I adjust things a bit and try the model approach.
Here the code as a stand alone script:
# RMagick Test
require 'rubygems'
require 'rmagick'
include Magick
puts "Enter the name of the file to thumb:"
image_to_alter = gets.chomp
img = Image.read(image_to_alter)[0]
thumbnail_height = 100
thumbnail_width = 100
geometry_obj = Geometry.new(thumbnail_width, thumbnail_height, nil, nil, '!')
chg_geom_img = img.change_geometry(geometry_obj) {|cols, rows, image| image.resize(cols, rows)}
chg_geom_img_name = 'thumbnail_' + image_to_alter#@basename_of_f
chg_geom_img.write(chg_geom_img_name)
Here is the original image:

Here is the image after resizing with my Ruby script:
![]()
Here is the version that was resized using almost the identical code, from within a Rails app:
![]()
Screwy, huh?
Any tips/advice very welcome!
