#!/usr/bin/perl -w # webmagick.pl # pod at tail $|++; use strict; use Cwd; my $dmw = 'index.html'; my $wmBin = '/usr/bin/webmagick'; my $wmSyn = '--forcehtml --forcecache --forcemontage'; my $wmPaths = '--rootpath /var/www/ --iconpath doc/webmagick/icons/'; my $wmColors = '--colorback white --thumbbackground white'; my $baseDir = '/var/www/Graphics'; my @dirs = ( 'Christian', 'Ico', 'Icons', 'Images', 'Tech', ); for(@dirs){ -d "$baseDir/$_" or next; chdir "$baseDir/$_" or next; unlink $dmw if -w $dmw; system("$wmBin $wmSyn $wmPaths $wmColors") and warn $!; unlink $dmw if -w $dmw; symlink '.index1.html', 'index.html' or warn $!; } =head1 TITLE wm.pl =head1 DESCRIPTION Wrapper for webmagick. Webmagick creates thumbnails and markup to easily browse said thumbnails Sadly, Debian's current webmagick uses JavaScript in it's markup. My Mozilla settings don't seem to like that. So this ditty runs webmagick against a configured list of image directories, then unlinks the javascripted index.html, and symlinks index.html from a non-JS thumbnail montage page. Yes, I know it's a brittle kludge. But I don't care because it's *my* kludge. ;^) Oh yeah, and as a kludge, it doesn't support recursing directories. P.S. $dmw stands for Dead Man Walking. I considered $ejs for Evil Java Script. =head1 AUTHOR ybiC =head1 UPDATES 2002-04-20 20:55 CDT Post to PerlMonks Initial working code =cut