Despite its heavy weight, I've always used Image::Magick for creating image thumbnails. I know it can be done using lighter-weight GD, I just never liked its syntax. Really, who wants to remember the lengthy arguments list of copyResized() or copyResampled() functions:

Returns a GD::Image object for the new, resized image. Original image is not modified. This lets you create multiple thumbnails of an image using the same Image::Resize object.

First two arguments are required, which define new image dimensions. By default resize() retains image proportions while resizing. This is always what you expect to happen. In case you don't care about retaining image proportions, pass 0 as the third argument to resize().

Following example creates a 120x120 thumbnail of a "large" image, and stores it in disk:

Thanks to Paul Allen <paul.l.allen AT comcast.net> for the trueColor(1) tip. Now Image::Resize should work fine for photographs too.

Thanks to Nicholas Venturella <nick2588 AT gmail.com> for allowing Image::Resize to work with already-opened GD::Image objects and for checking the scaling routine. It's now comparable to Image::Magick's Scale(): the resulting image dimensions won't exceed the given width and height.