The Photoalbum Script

Frank da Cruz, Columbia University, July 2006

The photoalbum script demonstrates some new features of C-Kermit 8.0.212:

Given a directory containing JPG images, this script creates:

The script calls upon the Image Magick component convert, if available, to create the thumbnails. If convert is not available, the index page simply contains links to each image page. (Click on the links in this paragraph to find Image Magick for Windows or Unix.)

This script requires C-Kermit 8.0.212 Dev.19 or later, which includes the new \fpictureinfo() function. Thus it will not fully work in the current version (2.1.3) of Kermit 95; but it still creates a website of unscaled pictures with all their links functioning, and an index with links rather than thumbnails.

Suppose you have some JPG images in a directory on your PC. Make a directory on your web server to hold them, cd to that directory, go back to Kermit on your PC upload them. Then run this script. Command-line options are as follows. If any option contains spaces, enclose the entire option in doublequotes or curly braces.

title=text Title for the Web page (enclose in quotes if it contains spaces) Photos
color=name Text color for Web page. Use any color name understood by your browser or "#xxxxxx" notation. Maroon
background=name Background color for Web page. Use any color name understood by your browser or "#xxxxxx" notation. Beige
Language=name English or Spanish English
Height=number Height in pixels for thumbnails 72
Noscale=number 0 = Scale pictures for Web browser; nonzero = don't scale. 0

Examples:

photoalbum
(no options)   Creates a web page called Photos using the default color scheme, creating thumbnails 72 pixels high if the Image Magick convert program is available.

photoalbum "title=Our Trip to Iceland"
The same, but the given title is used.

photoalbum "title=Our Trip to Iceland" color=blue background=#4444ff
The same, but with the given title and color scheme.

photoalbum "title=Santo Domingo" color=green background=yellow lang=Spanish
The same, but with a different title and in Spanish.

photoalbum height=100
Creates a web site with all the defaults, except thumbnails will be 100 pixels high instead of 72. If any thumbnails already exist that are not 100 pixels high, they are replaced.

After you have created your website, you can go back and edit the pages to add explanatory text. Don't do this until you are completely satisfied with the picture selection and color scheme, etc, because every time you run the photoalbum script, it replaces all the HTML pages.

To install the script in Unix...

  1. Install the C-Kermit 8.0.212 Dev.19 or later binary in any directory that's in your PATH. Use "chmod +x" to give it execute permission.
  2. Save the photoalbum script file on disk in any directory that's in your PATH. Use "chmod +x" to give it execute permission.
  3. Change the first line (the "kerbang line") of the photoalbum script file to indicate the full path of the C-Kermit 8.0.212 binary from step 1. CLICK HERE for details.