Manicured Thumbnails
By Randal L. Schwartz
Recently I found myself with a handful of photographs that I wanted to add to the personal section of my Web site. I thought to myself, "No Problem...just scan them in, upload them, add some links, and I'm done." Of course, I then remembered that I had wanted to create "thumbnails" of these pictures. Ugh. This made matters more complicated.
Thumbnails, which are miniature versions of the original pictures, help visitors to a site decide whether they want to take the time to download the entire picture. (Please don't confuse this with what one of my friends calls dumbnails, which are full-size downloads that are scaled in the browser to be small. Lame.) There's nothing worse than spending two to five minutes downloading a typical JPEG file, only to discover that you've already got it, or it looks, well, useless.
Now, all modern photo manipulation programs have tools to scale pictures down to a small size, but the thought of doing this over and over again for each picture just didn't make sense to me. And even then, I'd have twice as many pictures to upload.
Then I remembered that I had previously installed the NETPBM tools on my Web-site machine. This freely available package can perform many manipulations on pictures programmatically from a command line. Be sure to comply with the extremely liberal licensing agreements for this package. Visit ftp.x.org/contrib/utilities/ netpbm-1mar1994.p1.tar.gz for details
So, after pouring over the docs for PBM, I came up with the following command lines to make a thumbnail (see