Drop Dead Simple Web Photo Galleries

04
Mar

Drop Dead Simple Web Photo Galleries

Today, I'm going to show you a great little application for easily generating a Web gallery of images that requires no server side coding. Just generate your gallery with a simple command, then upload to your Web site. Of course, coding a Web page is easy enough if you know even basic HTML, and you can create thumbnails with the tools in ImageMagick easily enough, but setting up that little web slide show can be a tad time consuming even if you know how to do all these things. There are also some great Web photo gallery packages out there, like Zenphoto, but what if you don't have shell access to your Website or you aren't allowed to install programs or run scripts? You might well be in a bind. This is where iGal comes into play.

iGal is a simple Perl script originally written by Eric Pop (at Stanford). These days, iGal is maintained and updated by Wolfgang Trexler. If you need to create a presentation of images in a hurry for your web site, for your family or for your company, then you should check out iGal at Wolfgang's site. As I suggested, iGal makes use of the ImageMagick tools we talked about to do its work so you'll need to have the package installed.

Installing this is child's play since iGal (which stands for Image GALlery generator), being a Perl script, is already source. Visit the site and download the latest tarred and gzipped bundle. Then, extract the package and install it.

tar -xzvf igal-1.4.7-wt.tar.gz
cd igal-1.4.7-wt
sudo make install

To make your instant slide show, change directory to where you already have a collection of images, and type the following:

igal -xy 150 --bigy 800

That's all there is to it. You don't need either the -xy 150 or the --bigy 800 flags I added. What the first does is create an HTML slide show with a title page made up of thumbnails scaled to a maximum of 150 pixels along their longest dimension. The bigy option is useful if you have very large images. It takes your large photos and creates images of the selected y dimension (in this case, 800 pixels). To see the full-sized image, your visitors just have to click the 800 pixel image. This whole process may take a minute or two depending on the size of your images and the quantity. In the directory, you'll also find an index.html page, your original images, thumbnail versions of these (prefixed with .thumb_), and cross-linked HTML pages for each image. It should look something like the following image.

Click photo for a larger image.

The only real editing that I wind up doing is changing the title of the index.html file. By default, the title for that page is "Index of pictures", and I tend to like something a bit more descriptive. If you would like to see the final product of such a slide show, check out this link for moments from the 2007 Ontario Linuxfest in Toronto.

When you run iGal, the default caption for the images is the image name itself. You can change that without editing all the images by running iGal with the -c option. This will generate a file called .captions. Lines in the file will appear something like this:

img_0261.jpg ----
img_1400.jpg ----

To create captions for your images, append the text you want to the image:

img_0261.jpg ---- A picture of me with Tux
img_1400.jpg ---- An increasingly expensive clock

Save the file, rerun iGal with the -c option again, and all your pages will have your selected captions. If you choose the -C option (upper case C), you will get your captions, but the image names are preserved. Note that you should then remove the .captions file first.

For the down and dirty of iGal, check out the accompanying documentation, but frankly, it's not much more complicated than this. I will leave you with one final modification you can make to your presentation. You might have noticed the classic film reel effect on the index page. For those who (for reasons unknown) don't like this effect, it can be turned off with the -r flag.

Comments