#!/usr/bin/perl ############################################################### # # Thumbion # written by James Evans in 2001 # based on Pix2tn by Michael Hahsler 1999 # # This script is free for use and modify. # Version: 0.9 (May 15, 2001) # # Usage: # Copy this script into the directory that your photos # and descript.ion file are in. Modify the $title # variable to be the title for your page. Execute the # script and the thumbnails will be created, with # descriptions added from the descript.ion file. # # Copyright: This script is under GPL # # I can be contacted at jrevans@altavista.net # my $title="Cambria and Indiana Hopper Pictures from 02/16/2002"; my $tnperrow=2; # thumbnails per row my $tnsize=150; # size of thumbnails my $tnquality=40; # quality of thumbnails [0..100] # use small thumbnails with poor quality to speed up your index-page # possible image extensions (jpg, gif) my @pics = (); #my $desc="no description"; #die "Problem: c_and_i.html exists!!!" if (-e "index.html"); open (PAGE, ">c_and_i.html") || die "Problem: Can't write to index.html\n"; print "thumbion written by James Evans 2001\n"; # create a directory for the thumbnails system ("mkdir tn") if (!-d "tn"); # create the index page print PAGE qq* $title\n\n

$title

\n\n
Clicking on thumbnail opens full sized image in same window.
Clicking on "Full size image is nnnk" text opens full sized image in a new window.

\n\n *; my $counter=0; foreach $_ (sort @pics) { print $_; system ("convert -geometry ".$tnsize."x".$tnsize. " -quality $tnquality $_ tn/$_") == 0 || die "Problems with convert: $?\n"; $desc = `awk '{if(\$1~/$_/) print substr(\$0,length(\$1)+2,199)}' descript.ion`; print PAGE "" if (!($counter++%$tnperrow)); print PAGE "
\n\n\n"; @stat = stat $_; print PAGE qq*

$_
$desc
Full size image is *. int($stat[7]/1024).qq* kB*. qq*
\n\n\n*; print " ... done\n"; } # print PAGE qq*
#
# $_
*. # localtime($stat[9]).qq*
# $desc original - *. # int($stat[7]/1024).qq* kB*. # qq*
\n*; # print " ... done\n"; print PAGE qq*

Index created on *.localtime(time).qq*.
photos by Jim Evans
*; # based on pix2tn # # written by Michael Hahsler.

close PAGE;