Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

(code) WebMagick, thumbnail index, no javascript

by ybiC (Prior)
on Apr 21, 2002 at 02:02 UTC ( #160834=snippet: print w/replies, xml ) Need Help??
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
Replies are listed 'Best First'.
Re: WebMagick and eeevil javascript
by belg4mit (Prior) on Apr 21, 2002 at 03:11 UTC
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: snippet [id://160834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2023-10-01 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?