magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1998 > 09 > Programming with Perl  

Manicured Thumbnails

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



  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2