Add few options for more flexibility

This commit is contained in:
Andrey A. Chernov 1998-05-21 19:00:30 +00:00
parent 2e099e4cda
commit a3e1acb529
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=11091
2 changed files with 219 additions and 17 deletions

View File

@ -1,5 +1,29 @@
*** webmagick.in.orig Tue Mar 24 07:45:45 1998
--- webmagick.in Thu May 21 02:35:08 1998
--- webmagick.in Thu May 21 19:58:44 1998
***************
*** 130,135 ****
--- 130,136 ----
$opt_dirindexname,
$opt_forcecache,
$opt_forcegif,
+ $opt_forcejpeg,
$opt_forcehtml,
$opt_forcemontage,
$opt_frame_name_dirview,
***************
*** 196,201 ****
--- 197,207 ----
$opt_verbose,
$opt_webmagickrc, # Per-directory WebMagick rc file name
$opt_zoomfilter,
+ $opt_pichtml,
+ $opt_pichtmlext,
+ $opt_pichtmltarget,
+ $opt_pichtmltop,
+ $opt_pichtmlbottom,
$pageStatusTime, # Time status file last modified
$pageNumber, # Current page number
$perlVarsLoaded, # Set to one when directory status file sourced
***************
*** 249,255 ****
# Name of per-directory rc file
@ -9,7 +33,7 @@
# File naming
--- 249,255 ----
--- 255,261 ----
# Name of per-directory rc file
$opt_webmagickrc = '.webmagickrc';
# global rc files
@ -18,27 +42,68 @@
# File naming
***************
*** 1584,1590 ****
# Save run status (source files and montage options)
#
writePerlIndexFiles();
! writeJavaScriptIndexFiles();
}
*** 299,304 ****
--- 305,311 ----
$opt_forcehtml = 0; # Force HTML files to be generated (default off)
$opt_forcemontage = 0; # Force montage (default off)
$opt_forcegif = 0; # Force GIF imagemaps (default off)
+ $opt_forcejpeg = 0; # Force JPEG imagemaps (default off)
$opt_help = 0; # Display usage message
$opt_header = ''; # Imagemap extra page header (HTML)
$opt_javascript = 1; # Enable JavaScript output
***************
*** 306,311 ****
--- 313,323 ----
$opt_title = ''; # Page title (blank provides default title)
$opt_address = ''; # Additonal address info for bottom of
# imagemap page
+ $opt_pichtml = 0; # Write separate HTML for each picture
+ $opt_pichtmlext = '.html'; # Use .shtml for SSI
+ $opt_pichtmltarget = '';
+ $opt_pichtmltop = '';
+ $opt_pichtmlbottom = '';
# Clear error flag
--- 1584,1592 ----
#
# ImageMagick Montage settings
***************
*** 645,650 ****
--- 657,663 ----
'forcecache!' => \$opt_forcecache,
'forcegif!' => \$opt_forcegif,
'forcehtml!' => \$opt_forcehtml,
+ 'forcejpeg!' => \$opt_forcejpeg,
'forcemontage!' => \$opt_forcemontage,
'framemarginwidth=i' => \$opt_framemarginwidth,
'framemarginheight=i' => \$opt_framemarginheight,
***************
*** 662,667 ****
--- 675,685 ----
'maptype=s' => \$opt_maptype,
'maxgif=i' => \$opt_maxgif,
'pageindexname=s' => \$opt_pageindexname,
+ 'pichtml!' => \$opt_pichtml,
+ 'pichtmlbottom=s' => \$opt_pichtmlbottom,
+ 'pichtmlext=s' => \$opt_pichtmlext,
+ 'pichtmltarget=s' => \$opt_pichtmltarget,
+ 'pichtmltop=s' => \$opt_pichtmltop,
'prefixpath=s' => \$opt_prefixpath,
'readme=s' => \$opt_readme,
'readmevisible!' => \$opt_readmevisible,
***************
*** 1584,1590 ****
--- 1602,1610 ----
# Save run status (source files and montage options)
#
writePerlIndexFiles();
! if( $opt_javascript ) {
! writeJavaScriptIndexFiles();
! }
+ if( $opt_javascript ) {
writeJavaScriptIndexFiles();
+ }
}
# Clear error flag
***************
*** 1860,1865 ****
--- 1862,1868 ----
--- 1880,1886 ----
# ----- Output Top JavaScript Index File (usually "indexjs.html") -------
#
@ -48,7 +113,7 @@
print( INDEX "<HTML>\n" );
***************
*** 1873,1878 ****
--- 1876,1882 ----
--- 1894,1900 ----
print( INDEX "</SCRIPT>\n" );
print( INDEX "</HTML>\n" );
close( INDEX );
@ -56,3 +121,116 @@
# ----- Output Frame Directory File (usally ".indexdir.html") ------
***************
*** 2034,2041 ****
print( INDEX "<MAP NAME=\"${mapname}\">\n" );
my $imageNum;
for( $imageNum = 0; $imageNum <= $#{$imageNames[$pageNumber - 1]}; ++$imageNum ) {
! print( INDEX " <AREA HREF=\"", $imageNames[$pageNumber - 1][$imageNum],
"\" SHAPE=RECT COORDS=", $imageThumbCoords[$pageNumber - 1][$imageNum],">\n" );
}
print( INDEX "</MAP>\n" );
}
--- 2056,2107 ----
print( INDEX "<MAP NAME=\"${mapname}\">\n" );
my $imageNum;
for( $imageNum = 0; $imageNum <= $#{$imageNames[$pageNumber - 1]}; ++$imageNum ) {
! my $pic = $imageNames[$pageNumber - 1][$imageNum];
! if ( $opt_pichtml ) {
! my $pichtml;
! my $target = '';
!
! if( !defined $opt_pichtmlext || $opt_pichtmlext eq '' ) {
! $pichtml = $pic . ".html";
! } else {
! $pichtml = $pic . $opt_pichtmlext;
! }
! open( PICHTML, ">$pichtml")
! || die("$0: Failed to open file $pichtml for output\n$@\n");
! print( PICHTML "<HTML>\n<HEAD>\n" );
! print( PICHTML " <TITLE>$pic</TITLE>\n" );
! print( PICHTML "</HEAD>\n" );
! print( PICHTML "<BODY\n" );
! print( PICHTML " TEXT=\"${opt_colorfore}\"\n" );
! print( PICHTML " BGCOLOR=\"${opt_colorback}\"\n" );
! print( PICHTML " BACKGROUND=\"$iconImageUrls{background}\"\n" )
! if defined $iconImageUrls{background};
! print( PICHTML " LINK=\"${opt_colorlink}\"\n" );
! print( PICHTML " VLINK=\"${opt_colorvlink}\"\n" );
! print( PICHTML " ALINK=\"${opt_coloralink}\">\n\n" );
! print( PICHTML "<CENTER>\n" );
! print( PICHTML "$opt_pichtmltop\n")
! if defined $opt_pichtmltop && $opt_pichtmltop ne '';
! if ( $pic =~ /\.(jpg|jpeg?|gif|xbm)$/i ) {
! print( PICHTML "<IMG SRC=\"$pic\">\n" );
! } else {
! print( PICHTML "<A HREF=\"$pic\"><BIG><B>$pic</B></A> ", fsize($pic), "</BIG>\n" );
! }
! print( PICHTML "$opt_pichtmlbottom\n")
! if defined $opt_pichtmlbottom && $opt_pichtmlbottom ne '';
! print( PICHTML "</CENTER>\n" );
! print( PICHTML "</BODY>\n" );
! print( PICHTML "</HTML>\n" );
! close ( PICHTML );
! if (defined $opt_pichtmltarget && $opt_pichtmltarget ne '') {
! $target = " TARGET=\"$opt_pichtmltarget\"";
! }
! print( INDEX " <AREA$target HREF=\"", $pichtml,
! "\" SHAPE=RECT COORDS=", $imageThumbCoords[$pageNumber - 1][$imageNum],">\n" );
! } else {
! print( INDEX " <AREA HREF=\"", $pic,
"\" SHAPE=RECT COORDS=", $imageThumbCoords[$pageNumber - 1][$imageNum],">\n" );
+ }
}
print( INDEX "</MAP>\n" );
}
***************
*** 2648,2653 ****
--- 2714,2720 ----
handleMagickError( __FILE__, __LINE__, "", $status) if "$status";
}
+ if( ! $opt_forcejpeg ) {
print( STDERR "Writing $fileNames{'montageGIF'} ...\n" ) if $opt_debug;
$status = $image->Write(
colors=>256,
***************
*** 2659,2676 ****
handleMagickError( __FILE__, __LINE__, $fileNames{'montageGIF'}, $status) if "$status";
last MONTAGE if "$status";
undef @$image;
# If not doing GIF only, do JPEG
if( ! $opt_forcegif ) {
# Only do JPEG if GIF is large.
# Most reasonable GIFs are under 30K
! if( fsize( $fileNames{'montageGIF'} ) > $opt_maxgif ) {
# Write JPEG file
print( STDERR "Writing $fileNames{'montageJPEG'} ...\n" )
if $opt_debug;
$status = $montage->Write(
filename=>"JPEG:$fileNames{'montageJPEG'}",
! interlace=>'None',
quality=>70
);
handleMagickError( __FILE__, __LINE__, $fileNames{'montageJPEG'}, $status) if "$status";
--- 2726,2744 ----
handleMagickError( __FILE__, __LINE__, $fileNames{'montageGIF'}, $status) if "$status";
last MONTAGE if "$status";
undef @$image;
+ }
# If not doing GIF only, do JPEG
if( ! $opt_forcegif ) {
# Only do JPEG if GIF is large.
# Most reasonable GIFs are under 30K
! if( $opt_forcejpeg || fsize( $fileNames{'montageGIF'} ) > $opt_maxgif ) {
# Write JPEG file
print( STDERR "Writing $fileNames{'montageJPEG'} ...\n" )
if $opt_debug;
$status = $montage->Write(
filename=>"JPEG:$fileNames{'montageJPEG'}",
! interlace=>'Plane',
quality=>70
);
handleMagickError( __FILE__, __LINE__, $fileNames{'montageJPEG'}, $status) if "$status";

View File

@ -1,5 +1,5 @@
*** webmagickrc.in.bak Tue Mar 24 07:45:52 1998
--- webmagickrc.in Wed May 20 02:38:55 1998
*** webmagickrc.in.orig Tue Mar 24 07:45:52 1998
--- webmagickrc.in Thu May 21 19:58:45 1998
***************
*** 32,38 ****
# Name of per-directory rc file
@ -17,3 +17,27 @@
# File naming
***************
*** 82,87 ****
--- 82,88 ----
# $opt_forcehtml = 0; # Force HTML files to be generated (default off)
# $opt_forcemontage = 0; # Force montage (default off)
# $opt_forcegif = 0; # Force GIF imagemaps (default off)
+ # $opt_forcejpeg = 0; # Force JPEG imagemaps (default off)
# $opt_help = 0; # Display usage message
# $opt_header = ''; # Imagemap extra page header (HTML)
# $opt_javascript = 1; # Enable JavaScript output
***************
*** 89,94 ****
--- 90,100 ----
# $opt_title = ''; # Page title (blank provides default title)
# $opt_address = ''; # Additonal address info for bottom of
# imagemap page
+ # $opt_pichtml = 0; # Write separate HTML for each picture
+ # $opt_pichtmlext = '.html'; # Use .shtml for SSI
+ # $opt_pichtmltarget = '';
+ # $opt_pichtmltop = '';
+ # $opt_pichtmlbottom = '';
#
# ImageMagick Montage settings