Download url2thumb for MacOS X! (67 Kb)
Univeral Binary for Both Intel and PowerPC Macs running MacOS X Tiger (10.4+)

url2thumb

A command line utility that creates thumbnails from URLs

Url2thumb is a simple command line program for MacOS X that creates a thumbnail of a website as a JPEG. By default, it will create a 400 x 200 pixel image, but you can specify other sizes by passing in an optional width and height parameter.

This command will make a 400 pixel wide image called cnn.jpg in the current directory:

./url2thumb http://cnn.com/ cnn.jpg

The resulting thumbnail is shown below. The gray border was added later with a style-sheet.

To create a 200 x 100 thumbnail, specify a smaller width:

./url2thumb http://apple.com/ apple.jpg 200

To create a 250 x 250 pixel thumbnail specify a width and height:

./url2thumb http://apple.com/ apple.jpg 250 250

Scripting Caveats

This program requires access to the window-server to work correctly. Url2thumb needs to be run as a user logged in. If you want to invoke this program from a webserver running as 'www' (a user not logged in), you will need to set the suid bit on url2thumb so it runs as another user who is logged in, or the root user (although root is not recommended for security reasons). For example, if you are always logged in as 'erik', then you can run the following commands to set suid bit:

sudo chown erik:admin url2thumb
sudo chmod +s url2thumb

When making screenshots of URLs with ampersands in them, you'll need to put single quotes around the URL. You'll need to do this because ampersands are used to tell the terminal to execute the preceding command asynchronously.

./url2thumb 'http://site.com/?image=pic.jpg&width=400' img.jpg

Putting url2thumb in your path

While you can always run url2thumb by cd-ing into it's directory and typing ./url2thumb, you may prefer to put it your path as shown below. Now you can just open a terminal window and type in url2thumb.

sudo mkdir /usr/local/bin
sudo mv url2thumb /usr/local/bin/
# and if /usr/local/bin is not already in your path...
echo 'export PATH=/usr/local/bin:$PATH' >> .bash_profile

About url2thumb

Url2thumb was written by Erik Wrenholt in 2006, and is released as freeware. If you use and enjoy url2thumb, I'd appreciate a link to http://www.timestretch.com/. Thanks, and have fun!