#! /usr/local/bin/perl ############################################################################## # gif2html.pl 26 September 1995 Dale Bewley dbewley@iupui.edu #----------------------------------------------------------------------------- # This script and others found at http://www.bewley.net/perl/ # # Creates an html file for each graphic in a directory. Usefull for creating # a slide show, I'm working on slideshow.pl now. # # o Give your graphics descriptive names. Use full words seperated by # a '-'. Dashes will be converted to spaces. # # o It would be a good idea to use fiximg.pl to add width and height tags # to your IMG SRCs. # # # 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 ----------------------------------------------# $BACKGROUND = "http://www.iupui.edu/home/Graphics/emboss.gif"; $BASEREF = "./"; #----------------------------------------------------------------------------# if (!$ARGV[0]) { die "Usage: $0 *[.gif|.jpg]\n";} while (@ARGV) { # Create html file open (FILE,">$ARGV[0].html"); # Create picture title with spaces in place or dashes and without # the extension. $picTitle = $ARGV[0]; $picTitle =~ s/\.gif//g; $picTitle =~ s/\.jpg//g; $picTitle =~ s/-/ /g; # Print HEAD of HTML file. print (FILE "\n $picTitle \n"); print (FILE "\n"); print (FILE "\n"); # Print BODY of HTML file. print (FILE "\n"); print (FILE "
\n"); print (FILE "\t
\n"); print (FILE "\n\n"); print (FILE "\t"); print (FILE "\n
\n"); print (FILE "\t
\n"); print (FILE "

$picTitle

\n"); print (FILE "
\n"); print (FILE "\n"); # fiximg.pl has a bug that will print twice, so leave it out. #print (FILE "\n"); # Get next command line argument. shift @ARGV; }