attachment_fu and more complicated resizing

Not sure if this is the right forum to ask this question but I was hoping never the less someone might have a suggested solution for me.

I am presently resizing images that are being uploaded to 200x200. Now, no matter what the ratio (4:3…) or orientation (horizontal or vertical) I am making it so the image is always resized to a full 200x200. I am doing this by either cutting off a little off the top and bottom or off the sides.

Here are the parameters I am presently passing to ‘convert’ on the command line to get a perfect (almost perfect) 200x200 picture.

convert -size 800x800 #{original_file} -thumbnail x400 -resize ‘400x<’ -resize 50% -gravity center -crop 200x200+0+0 +repage #{location_of_users_pictures}/#{self.filename}_200x200.jpg

Two questions I have for you guys and gals:

  • can I simplify how I call convert with the same effect?

  • how can I use attachment_fu out of the box so it does this for me? (I am going to want to make another thumbnail of a full 50x50 as well)

Your input is greatly appreciated.

Your Friend,