attachment_fu and portrait vs. landscape pictures

I'm using attachment_fu in some code that allows photo upload. The attachment_fu Model code generally looks like this:

    has_attachment :content_type => :image,
                   :storage => :file_system,
                   :max_size => 100.kilobytes,
                   :resize_to => '146x68>',
                   :processor => 'Rmagick'

However, we want to accept uploads in either portrait or landscape mode, and have them resized appropriately (such as resized to 200x150 if it's landscape, or 150x200 if it's portrait). Looking at attachment_fu, though, it doesn't look like it will handle that, resizing to the required dimensions regardless of orientation.

Has anyone done something like this before? Any thoughts? I figure I can always resize in two directions and then pick the one to display, but there seems like there'd be a better way to do that.

--Wade

Thanks for the suggestion, but I should have mentioned that we're doing a resize-and-crop via rmagick, which means that we don't want to (exactly) preserve the aspect ratio. The image will be resized and cropped to exactly 200x150 if it's landscape, and exactly 150x200 if it's portrait. Which does complicate things.

I've got the resize-and-crop working, it's just trying to figure out how to do one or the other depending on its orientation.

--Wade