webmagick.in (WebMagick-2.03pre28) | : | webmagick.in (WebMagick-2.03pre29) | ||
---|---|---|---|---|
#!@PERL@ | #!@PERL@ | |||
# | # | |||
# $Id: webmagick.in,v 1.304 2016/12/19 16:04:03 ache Exp $ | # $Id: webmagick.in,v 1.306 2017/01/19 19:18:49 ache Exp $ | |||
# | # | |||
# You are looking at the main PERL script for WebMagick, a package to | # You are looking at the main PERL script for WebMagick, a package to | |||
# intelligently create HTML and JavaScript index files and imagemaps | # intelligently create HTML and JavaScript index files and imagemaps | |||
# corresponding to a directory tree of image files. | # corresponding to a directory tree of image files. | |||
# | # | |||
# Copyright Bob Friesenhahn (bfriesen@simple.dallas.tx.us) 1996, 1997, | # Copyright Bob Friesenhahn (bfriesen@simple.dallas.tx.us) 1996, 1997, | |||
# 1998, 1999, 2000 | # 1998, 1999, 2000 | |||
# | # | |||
# This work may be used for any purpose, public or private, provided | # This work may be used for any purpose, public or private, provided | |||
# that this work or derivations thereof are attributed to its author. | # that this work or derivations thereof are attributed to its author. | |||
skipping to change at page 230, line ? | skipping to change at page 230, line ? | |||
'verbose!' => \$opt_verbose, | 'verbose!' => \$opt_verbose, | |||
'version!' => \$opt_version, | 'version!' => \$opt_version, | |||
'zoomfilter=s' => \$opt_zoomfilter | 'zoomfilter=s' => \$opt_zoomfilter | |||
) | ) | |||
) { | ) { | |||
help(); | help(); | |||
exit(0); | exit(0); | |||
} | } | |||
# Fix for getopt | # Fix for getopt | |||
if ($opt_imgparam) { | if (!defined($opt_imgparam)) { | |||
$opt_imgparam = '?' . "${opt_imgparam}"; | ||||
} else { | ||||
$opt_imgparam = ''; | $opt_imgparam = ''; | |||
} | } | |||
# | # | |||
# Print help message | # Print help message | |||
# | # | |||
if( $opt_help ) { | if( $opt_help ) { | |||
help(); | help(); | |||
exit(0); | exit(0); | |||
} | } | |||
skipping to change at page 230, line ? | skipping to change at page 230, line ? | |||
if ($opt_cachedir && $File::Find::name =~ /\/${opt_cachedir}$/) { | if ($opt_cachedir && $File::Find::name =~ /\/${opt_cachedir}$/) { | |||
return; | return; | |||
} | } | |||
forking_dodir($File::Find::name); | forking_dodir($File::Find::name); | |||
} | } | |||
} | } | |||
sub FileChoose { | sub FileChoose { | |||
my $oldname = shift; | my $oldname = shift; | |||
my $newname = shift; | my $newname = shift; | |||
my ($oldfile, $newfile, $oldcont, $newcont, $newnameexist); | my ($oldfile, $newfile, $oldcont, $newcont, $newnameexist, $oldnameexist); | |||
$oldnameexist = 0; | ||||
if (open(FILECON, "<", $oldname)) { | if (open(FILECON, "<", $oldname)) { | |||
$oldcont = do { local $/; <FILECON> }; | $oldcont = do { local $/; <FILECON> }; | |||
$oldnameexist = 1; | ||||
close FILECON; | close FILECON; | |||
} | } | |||
$newnameexist = 0; | $newnameexist = 0; | |||
if (open(FILECON, "<", $newname)) { | if (open(FILECON, "<", $newname)) { | |||
$newcont = do { local $/; <FILECON> }; | $newcont = do { local $/; <FILECON> }; | |||
$newnameexist = 1; | $newnameexist = 1; | |||
close FILECON; | close FILECON; | |||
} | } | |||
if ($oldcont ne $newcont) { | if (defined($oldcont) != defined($newcont) || | |||
(defined($oldcont) && $oldcont ne $newcont)) { | ||||
if ($newnameexist) { | if ($newnameexist) { | |||
print(STDERR "Rename $newname to $oldname since changed from last run .\n") | print(STDERR "Rename $newname to $oldname since changed from last run .\n") | |||
if $opt_debug; | if $opt_debug; | |||
unlink($oldname); | unlink($oldname); | |||
rename($newname, $oldname); | rename($newname, $oldname); | |||
} else { | } else { | |||
print(STDERR "FileChoose: can't read $newname\n"); | print(STDERR "FileChoose: can't read $newname\n"); | |||
} | } | |||
} else { | } else { | |||
print(STDERR "Keep old $oldname since unchanged from last run.\n") | if ($oldnameexist) { | |||
if $opt_debug; | print(STDERR "Keep old $oldname since unchanged from last run.\n") | |||
if $opt_debug; | ||||
} else { | ||||
print(STDERR "FileChoose: can't read $oldname\n"); | ||||
} | ||||
unlink($newname); | unlink($newname); | |||
} | } | |||
} | } | |||
# Execute dodir with the protection of a fork. This ensures that | # Execute dodir with the protection of a fork. This ensures that | |||
# current directory and global webmagick configuration values are | # current directory and global webmagick configuration values are | |||
# preserved between directories. | # preserved between directories. | |||
sub forking_dodir { | sub forking_dodir { | |||
my $sourceDirectory = shift(@_); # Directory to process | my $sourceDirectory = shift(@_); # Directory to process | |||
skipping to change at page 230, line ? | skipping to change at page 230, line ? | |||
# current directory webmagickrc file. | # current directory webmagickrc file. | |||
$opt_ignore=0; # Ignore -- do not process this directory | $opt_ignore=0; # Ignore -- do not process this directory | |||
if( $direlem ) { | if( $direlem ) { | |||
$path = "$path/$direlem"; | $path = "$path/$direlem"; | |||
} | } | |||
$rcpath = "$path/$opt_webmagickrc"; | $rcpath = "$path/$opt_webmagickrc"; | |||
sourceRcFile( $rcpath ); | sourceRcFile( $rcpath ); | |||
} while( $direlem = shift(@dir) ); | } while( $direlem = shift(@dir) ); | |||
if ($opt_imgparam) { | if (!defined($opt_imgparam)) { | |||
$opt_imgparam = '?' . "${opt_imgparam}"; | ||||
} else { | ||||
$opt_imgparam = ''; | $opt_imgparam = ''; | |||
} | } | |||
return( 0 ); | return( 0 ); | |||
} | } | |||
# | # | |||
# Lookup color in RGB hash table | # Lookup color in RGB hash table | |||
# | # | |||
sub lookupRGBColor { | sub lookupRGBColor { | |||
my($color) = @_; | my($color) = @_; | |||
End of changes. 8 change blocks. | ||||
11 lines changed or deleted | 14 lines changed or added |