ImageScience.with_image(staging_filename) do |image|
# sorry about the lambda - IS uses blocks to guarantee that images are
# freed - and we don't want to resize an image if it's already 600x600
saver = lambda {|to_save| to_save.save(idea_filename)}
if image.width == 600 && image.height == 600
saver.call(image)
else
dim = [image.width, image.height].min
image.resize(dim,dim) {|resized| saver.call(resized) }
end
end