Description: |
Kludge to replace WebMagick's javascript thumbnail index with existing no-javascript one.
webmagick's generated thumbnail index contains javascript which breaks badly under reasonably secure Mozilla settings. Using this wrapper allows you to view the resulting thumbnail indeces without compromising you browser configuration.
Yeah, this *is* a marginal post to snippets. The criteria appear to be clever, useful, and hard to write, so I'm batting 300. 8^P
|
#!/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
|