#!/usr/bin/perl use warnings; use strict; use Image::Magick; use Cwd; #watch the width of your picture names #they can widen the table cells if too long umask 0022; my $image = Image::Magick->new; my $count = 0; my $dir = cwd; open(HEADER,">header.html"); print HEADER<

Thumbnails for $dir

End_Header close HEADER; open(INDEX,">index.html"); print INDEX< Thumbnails End_Index close INDEX; open(MAIN,">main.html"); print MAIN<

Click thumbnails at left to view

End_Main close MAIN; open(OUT,">left.html"); print OUT< End_Header my @pics= <*.jpg>; foreach my $pic (@pics){ $count++; my ($picbasename) = $pic =~ /^(.*).jpg$/; my $ok; $ok = $image->Read($pic) and warn ($ok); my ($w,$h)= $image->Get('columns','height'); my $thumb = $picbasename . '-t.jpg'; $ok = $image->Scale(geometry => '100x100')and warn ($ok); $ok = $image->Write($thumb)and warn ($ok); my ($tw,$th)= $image->Get('columns','height'); my $picoptions= $w.'x'.$h.'x'.$tw.'x'.$th; print "$pic\t$picoptions\n"; undef @$image; print OUT<[$pic-thumbnail]
$pic EOTR if($count == 1){print OUT "
"; $count = 0}; } print OUT<
EOHTML close OUT; __END__