Making imagemaps from images

The contact.perl script was used to read a list of files from stdin (most likely as the output of ls) and make a series of interlaced/transparent GIFs and imagemap files.

What's new

1995/03/14

1995/03/07

first release

How to use it

To make a series of image maps of the beer images avalable in our environment I did something like this:

	mkdir /tmp/work
	cd /tmp/work
	setenv TMPDIR .
	ls /ftp/pub/beermats/*.{gif,jpg} | contact.perl

The contact.perl script then makes as many all*.gif and all*.map files as it needs to contain small copies of the images; and makes an index.html, text.html, and map.html file with the hypertext references.

You'll then need to copy the files into one of your public_html directories and update your imagemap configuration file. This is what I'd do (following from above):

	set ddir=~/public_html/beermats
	chmod 644 *
	cp -p * $ddir
	cd $ddir
	foreach i (all*.map)
		echo $i
		echo `basename $i .map` : $ddir/$i >> imagemap.conf
	end

contact.perl bugs

missing features

contact.perl internals

The following variables may be useful in the .contact.perlrc file:

WIDTH
maximum width of contact sheet
HEIGHT
maximum height
PICW
maximum width of preview images
PICH
maximum height
WW
White Width of border around preview images
BW
Black Width of border (will become transparent)
TP
The width of the border around the image text (Text Padding)
BDFFILE
The full path of a BDF file to use for the image text font. eg: /usr/local/X11R6/xc/fonts/bdf/75dpi/helvBO12.bdf
SERVER
Where the real images will be found. eg: http://www.csi.uottawa.ca
LOCPREFIX
The directory relative to SERVER where the images are kept. eg: $SERVER/ftppub/beermats
CGIIMAGEMAP
The path relative to SERVER that will run the imagemap eg: cgi-bin/imagemap/~user/dirpath
quiet
set this to 0 to see the action
addtext2pic
set this to 0 if you don't want the filename in the preview images
makeitfit
set this to 1 if you want contact.perl to find the best values for PICW and PICH for the values of WIDTH and HEIGHT.

Sample .contact.perlrc file

	$makeitfit = 1;
	$BW = 0;
	$WW = 0;
	$addtext2pic = 0;
	$WIDTH = 500;
	$HEIGHT = 450;
	$SERVER = "http://www.csi.uottawa.ca";
	$CGIIMAGEMAP = "cgi-bin/imagemap/~kwhite/beermats";
	$LOCPREFIX = "$SERVER/ftppub/beermats";

kwhite@csi.uottawa.ca 1995/03/15