#!/usr/bin/perl -w # -*- Mode: Perl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- =for the record Should make fine html pages out of a dir of photos This version for just 2col s=400x300 -> m=800x600 l=1600x1200 run with ls | pag-s2ml > index.html expects small images (and possible a "writeme" file) in cur dir and med in subdir "m" and large in subdir "l" "writeme" is where to put text you'd like to see on the page. pag-* takes the text (which should be marked up ready for insertion into an html file) and writes it out between the /table and /body tags. Next: should take input for page title. getopts :^/ ? ls | pag-s2ml -t "gunrack photos" > index.html =cut to code use Image::Size; use File::Basename; #use subs ("eachpic"); { print " photo page

\(Images link to larger versions. Read about photopage/pag-s2ml?\)

\n"; FILE: for($i=0; ; $i++) { do { unless (defined ($_ = )) # intended to be a line from ls = one filename\n { print "\n" if $i%2; # odd table bin last FILE; } $html = eachpic($_); } until $html; print $html; print "\n" if $i%2; # two TD's per TR. } print "
\n\n"; if (open WRITEME, '; close WRITEME; } print "\n\n"; } sub eachpic { shift; # @_ = filename\n chomp; return 0 if !-f; my ($base, $path, $suff) = fileparse ($_, qw(\.gif \.GIF \.jpg \.JPG \.p.?m \.P.?M)); return 0 if $suff eq ""; # not a browserable image my $filename = $base . $suff; my ($width, $height) = imgsize($_); my $w2 = int($width/2); my $w21 = $w2 -1; my $h = 3*int($height/4) -1; my $w1 = $width -1; $retval = # BTW, why doesn't "my retval=" work? " "; return $retval; }