#!/usr/bin/perl # make sure, that the path of perl is right (try: which perl) ############################################################### # # Pix2tn by Michael Hahsler 1999 # # This script free for use and modification. # Version: 1.0 (18-Oct-1999) # # Usage: Copy this script into the directory with your photos or in # your directory for executables (e.g. ~/bin). Change to the directory # with the photos and run the script. The script will generate the # file welcome.html (the index) and the sub-directories tn and med # (for the thumpnails). # If you want to have the index and the pictures on the Web, the directory # you have to move everything to a directory used by your Web-server # (e.g. ~\www). # # Copyright: This script is under GPL # # You can reach me under hahsler@ai.wu-wien.ac.at # my $title="Index created with pix2tn"; my $tnperrow=4; # thumbnails per row my $tnsize=80; # size of thumbnails my $tnquality=25; # quality of thumbnails [0..100] # use small thumbnails with poor quality to speed up your index-page my $medsize=500; # size of thumbnails my $medquality=70; # quality of thumbnails [0..100] # used to create medium sized pictures # possible image extensions (jpg, gif) my @pics = (<*.jpg>,<*.JPG>,<*.gif>,<*.GIF>); #die "Problem: welcome.html exists!!!" if (-e "index.html"); open (PAGE, ">index.html") || die "Problem: Can't write to index.html\n"; print "Pix2tn by Michael Hahsler 1999\n"; # create a directory for the thumbnails system ("mkdir tn") if (!-d "tn"); system ("mkdir med") if (!-d "med"); # create the index page print PAGE qq*
| ";
@stat = stat $_;
print PAGE qq* $_ *. localtime($stat[9]).qq* original - *. int($stat[7]/1024).qq* kB*. qq*\n*; print " ... done\n"; } print PAGE qq* |