jpgshow.pl - Example - Download script - Some time in 2000
I ran a "comedy pics" mailing list/fileecho/archive site. Updating the archive became a major pain, creating thumbnails and hundreds of html files. They also exceeded the limit of my ISP's webspace. So, moving onto another site, this time with user cgi-bin, I wanted to lay things out easier. So, perl. At the time of writing there are 418 comedy pics in one directory, named 1.JPG - 418.JPG. I initially wrote a DOS widget in C to create matching .HTM files. It worked, but that's another 418 files required, not good. Dabbled with perl and this is the result. It's called with:
"http://www.digdilem.org/cgi-bin/jpgshow.pl?n" where n is the numbered file it produces HTML for. The HTML output centers the image nicely and provides links to n-1, "home" and n+1 so it can cycle through the lot.
Provisos
The images need to be of one extension, in this case ".JPG".
They need to be named consecutively in a numerical range, e.g. 1-418
Bugs
Only one of significance AFAIK, which is that it doesn't check that the JPG exists first. This can cause problems when "previous" is selected at the lowest number, or when "next" is selected at the highest number. It then produces HTML for a file that doesn't exist. Doesn't cause any drama, just the picture doesn't display.
I need to suck the cluestick before I can fix this.