#! /usr/local/bin/perl ############################################################################## # thumbindex.pl v0.95 09-26-95 Dale Bewley dlbewley@iupui.edu #----------------------------------------------------------------------------- # This script and others found at http://www.engr.iupui.edu/~dbewley/perl # # Creates a thumbnail index in table format. # o Will read graphic names from $THUMBNAIL_DIR and create a table # using the thumbnail and thumbnail-name as links to the full size # version of the graphic in the current dir. # # o It is a VERY good idea to use fiximg.pl on the output of this # program. Especially if you have many thumbnails. # # ToDO # o Add output options # # Notes # o I haven't touched this program in sometime. You really should be # using gtindex.pl instead. I'm leaving it here for now, for historic # purposes? # # Copyright (C) 1996 Dale Bewley # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################## #- User Configurable Variables ----------------------------------------------# $BASEREF = "./"; # where all URLs should begin $THUMBNAIL_DIR = "thumbnails/"; # directory containing thumbnail graphics $INDEX_FILE = "home.html"; # output file $BACKGROUND = "http://www.iupui.edu/home/Graphics/emboss.gif"; # if you wish #----------------------------------------------------------------------------# if ($h || !$ARGV[1]) { &HELP } sub HELP { print "\nDescription: If you have a directory full of graphics and a\n", "\tsubdirectory of thumbnails for each, thumbindex will make an\n", "\tHTML table from the thumbnails for these graphics.\n\n"; print "Usage: thumbindex [switches] (one word caption) (filenames)\n", "\tFilenames are of the graphic files. Example *.gif *.jpg\n", "\tIt is assumed that a thumbnail of the same name will exist in\n", "\t$BASEREF$THUMBNAIL_DIR and that there are html files for each\n", "\tgraphic named filename.html. Gif2html can make these for you.\n\n"; print "Switches:\n", "\t-h\tHelp!\n"; exit; } open (FILE,">$INDEX_FILE"); print (FILE "\n$ARGV[0]\n"); print (FILE "\n"); print (FILE "\n\n"); print (FILE "
\n"); print (FILE "\t
\n"); print (FILE "\n"); shift @ARGV; while (@ARGV) { if (! -f $ARGV[0].html) { print "Can't find $ARGV[0].html\n", "Please get gif2html from ", "http://www.engr.iupui.edu/~dbewley/perl\n"; exit; } $graphicTitle = $ARGV[0]; $graphicTitle =~ s/\.gif//g; $graphicTitle =~ s/\.jpg//g; $graphicTitle =~ s/-/ /g; print (FILE "\n"); print (FILE "\t"); print (FILE "\t\n"); print (FILE "\n"); shift @ARGV; } print (FILE "\n
${graphicTitle}
\n"); print (FILE "\t
\n"); print (FILE "
\n"); # fiximg.pl has a bug # print (FILE "\n"); print (FILE "\n"); close FILE; # comment this out if you don't have fiximg.pl. You should GET IT! system "fiximg.pl $INDEX_FILE";