Frank da Cruz, Columbia University
fdc@columbia.edu
9 July 2006
The photoalbum script demonstrates some new features of C-Kermit 8.0.212:
Given a directory containing JPG images, this script creates a website like this one:
http://www.columbia.edu/~fdc/museum
composed of:
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.20 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.
At the core of the script is the new \fpictureinfo() function:
.orientation := \fpictureinfo(foo.jpg,&d)
then the array is created (destroying any previously existing array of the same name) and element 1 is set to the image width (in pixels) and element 2 to the height (in pixels).
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.
Option Description Default 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.