From: Timothy Hunter Date: 2005-04-12T08:04:38+09:00 Subject: Re: RMagick question Joe Van Dyk wrote: > I have images that have a bunch of different aspect ratios. When I > generate a thumbnail of those different images, I want all the > thumbnails to have the same image ratio. Currently, I can only have > the thumbnails have the same width OR the same height, and not both at > the same time. > > Any ideas as for the algorithm to do this? Or is there some function > inside RMagick that does something similar to this? > Do you mean you want to resize an image to a specific size without retaining its current aspect ratio? Just specify the desired new width and height when you call #resize: http://www.simplesystems.org/RMagick/doc/image3.html#resize In general you can use the #change_geometry method to compute a new image geometry. Here's a couple of links: http://www.simplesystems.org/RMagick/doc/comtasks.html#resizing http://www.simplesystems.org/RMagick/doc/image1.html#change_geometry