*** webmagick.in.orig Tue Mar 24 07:45:45 1998 --- webmagick.in Thu Aug 13 01:26:44 1998 *************** *** 130,135 **** --- 130,136 ---- $opt_dirindexname, $opt_forcecache, $opt_forcegif, + $opt_forcejpeg, $opt_forcehtml, $opt_forcemontage, $opt_frame_name_dirview, *************** *** 144,150 **** --- 145,153 ---- $opt_framemarginheight, $opt_framemarginwidth, $opt_framestyle, + $opt_htmlext, $opt_header, + $opt_footer, $opt_help, $opt_htimage, $opt_iconpath, *************** *** 196,201 **** --- 199,209 ---- $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 $opt_webmagickrc = '.webmagickrc'; # global rc files ! @global_option_files = ("/etc/webmagickrc", "$ENV{'HOME'}/${opt_webmagickrc}"); # File naming --- 257,263 ---- # Name of per-directory rc file $opt_webmagickrc = '.webmagickrc'; # global rc files ! @global_option_files = ("@prefix@/etc/webmagickrc", "$ENV{'HOME'}/${opt_webmagickrc}"); # File naming *************** *** 299,311 **** --- 307,327 ---- $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_htmlext = '.html'; # Use .shtml for SSI $opt_header = ''; # Imagemap extra page header (HTML) + $opt_footer = ''; # Imagemap extra page footer (HTML) $opt_javascript = 1; # Enable JavaScript output $opt_readmevisible = 0; # Make README.html be first page. $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 *************** *** 642,650 **** --- 658,668 ---- 'dircolorlink=s' => \$opt_dircolorlink, 'dircolorvlink=s' => \$opt_dircolorvlink, 'dirindexname=s' => \$opt_dirindexname, + 'footer=s' => \$opt_footer, 'forcecache!' => \$opt_forcecache, 'forcegif!' => \$opt_forcegif, 'forcehtml!' => \$opt_forcehtml, + 'forcejpeg!' => \$opt_forcejpeg, 'forcemontage!' => \$opt_forcemontage, 'framemarginwidth=i' => \$opt_framemarginwidth, 'framemarginheight=i' => \$opt_framemarginheight, *************** *** 654,659 **** --- 672,678 ---- 'header=s' => \$opt_header, 'help!' => \$opt_help, 'htimage=s' => \$opt_htimage, + 'htmlext=s' => \$opt_htmlext, 'iconpath=s' => \$opt_iconpath, 'imgindexname=s' => \$opt_imgindexname, 'indexname=s' => \$opt_indexname, *************** *** 662,667 **** --- 681,691 ---- '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, *************** *** 900,906 **** sub wanted { my($dev,$ino,$mode,$nlink,$uid,$gid); ($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_); ! if ( -d $_ && !/^\..+/ ) { if( $_ ne '.' && get_rc_var('.', 'opt_prune', 0) ) { $File::Find::prune=1; # following funny logic is to avoid warnings about $prune --- 924,930 ---- sub wanted { my($dev,$ino,$mode,$nlink,$uid,$gid); ($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_); ! if ( -d $_ && -w $_ && !/^\..+/ ) { if( $_ ne '.' && get_rc_var('.', 'opt_prune', 0) ) { $File::Find::prune=1; # following funny logic is to avoid warnings about $prune *************** *** 1386,1397 **** --- 1410,1423 ---- 'dircolorlink' => $opt_dircolorlink, 'dircolorvlink' => $opt_dircolorvlink, 'dirindexname' => $opt_dirindexname, + 'footer' => $opt_footer, 'framemarginwidth' => $opt_framemarginwidth, 'framemarginheight' => $opt_framemarginheight, 'framebordersize' => $opt_framebordersize, 'frameborder' => $opt_frameborder, 'framestyle' => $opt_framestyle, 'header' => $opt_header, + 'htmlext' => $opt_htmlext, 'imgindexname' => $opt_imgindexname, 'indexname' => $opt_indexname, 'jsdirindex' => $fileNames{'jsDirIndex'}, *************** *** 1584,1590 **** --- 1610,1618 ---- # Save run status (source files and montage options) # writePerlIndexFiles(); + if( $opt_javascript ) { writeJavaScriptIndexFiles(); + } } # Clear error flag *************** *** 1682,1690 **** # my $nexthtml = ''; if( $haveReadme && $haveImages && $opt_framefmt_frames{$opt_framestyle}<=2 ) { ! $nexthtml .= " \"\" ! Images
"; } # --- 1710,1718 ---- # my $nexthtml = ''; if( $haveReadme && $haveImages && $opt_framefmt_frames{$opt_framestyle}<=2 ) { ! $nexthtml .= " \"\" ! Images
"; } # *************** *** 1729,1735 **** my $i; for( $i=1; $i <= $numPages; ++$i ) { $pageindexhtml .= ! " ${i}
\n"; } } --- 1757,1763 ---- my $i; for( $i=1; $i <= $numPages; ++$i ) { $pageindexhtml .= ! " ${i}
\n"; } } *************** *** 1769,1784 **** $pageframelink = $opt_readme; } else { # Point to first image page ! $pageframelink = "${opt_pageindexname}1.html"; } } else { if( $haveReadme && $opt_readmevisible ) { # Point to README.html ! $pageframelink = "${opt_pageindexname}1.html"; $imageFrameLink = $opt_readme; } else { # Point to first image page ! $pageframelink = "${opt_pageindexname}1.html"; $imageFrameLink = $fileNames{'htmlBlankPage'}; } } --- 1797,1812 ---- $pageframelink = $opt_readme; } else { # Point to first image page ! $pageframelink = "${opt_pageindexname}1$opt_htmlext"; } } else { if( $haveReadme && $opt_readmevisible ) { # Point to README.html ! $pageframelink = "${opt_pageindexname}1$opt_htmlext"; $imageFrameLink = $opt_readme; } else { # Point to first image page ! $pageframelink = "${opt_pageindexname}1$opt_htmlext"; $imageFrameLink = $fileNames{'htmlBlankPage'}; } } *************** *** 1860,1865 **** --- 1888,1894 ---- # ----- Output Top JavaScript Index File (usually "indexjs.html") ------- # + if( $opt_javascript ) { open( INDEX, ">$fileNames{'jsDirIndex'}") || die("$0: Failed to open file $fileNames{'jsDirIndex'} for output\n$@\n"); print( INDEX "\n" ); *************** *** 1873,1878 **** --- 1902,1908 ---- print( INDEX "\n" ); print( INDEX "\n" ); close( INDEX ); + } # ----- Output Frame Directory File (usally ".indexdir.html") ------ *************** *** 1965,1971 **** my $page; for ( $page = 1; $page <= $numPages; ++$page) { if ( $page != $pageNumber ) { ! $indexbar .= "${page}\n"; } else { $indexbar .= " ${page}\n"; } --- 1995,2001 ---- my $page; for ( $page = 1; $page <= $numPages; ++$page) { if ( $page != $pageNumber ) { ! $indexbar .= "${page}\n"; } else { $indexbar .= " ${page}\n"; } *************** *** 2005,2014 **** print( INDEX " VLINK=\"${opt_colorvlink}\"\n" ); print( INDEX " ALINK=\"${opt_coloralink}\">\n\n" ); # Leave page blank unless there is something to show if( $numimages > 0 ) { - print( INDEX "${opt_header}\n" ) if $opt_header; # Total HACK!!! if( $opt_framestyle == 1 ) { print( INDEX "

Index of files \"$imageNames[$pageNumber - 1][0]\" through", --- 2035,2044 ---- print( INDEX " VLINK=\"${opt_colorvlink}\"\n" ); print( INDEX " ALINK=\"${opt_coloralink}\">\n\n" ); + print( INDEX "${opt_header}\n" ) if $opt_header; # Leave page blank unless there is something to show if( $numimages > 0 ) { # Total HACK!!! if( $opt_framestyle == 1 ) { print( INDEX "

Index of files \"$imageNames[$pageNumber - 1][0]\" through", *************** *** 2034,2045 **** print( INDEX "\n" ); my $imageNum; for( $imageNum = 0; $imageNum <= $#{$imageNames[$pageNumber - 1]}; ++$imageNum ) { ! print( INDEX " \n" ); } print( INDEX "\n" ); } # Print Copyright info on non-blank pages. if( $numimages > 0 ) { print( INDEX "

\n" ); --- 2064,2117 ---- print( INDEX "\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( !$opt_pichtmlext ) { ! $pichtml = $pic . ".html"; ! } else { ! $pichtml = $pic . $opt_pichtmlext; ! } ! open( PICHTML, ">$pichtml") ! || die("$0: Failed to open file $pichtml for output\n$@\n"); ! print( PICHTML "\n\n" ); ! print( PICHTML " $pic\n" ); ! print( PICHTML "\n" ); ! print( PICHTML "\n\n" ); ! print( PICHTML "$opt_pichtmltop") if $opt_pichtmltop; ! if ( $pic =~ /\.(jpg|jpeg?|gif|xbm)$/i ) { ! print( PICHTML "" ); ! } else { ! print( PICHTML "$pic ", fsize($pic), "" ); ! } ! print( PICHTML "$opt_pichtmlbottom\n") if $opt_pichtmlbottom; ! print( PICHTML "\n" ); ! print( PICHTML "\n" ); ! close ( PICHTML ); ! if ($opt_pichtmltarget) { ! $target = " TARGET=\"$opt_pichtmltarget\""; ! } ! print( INDEX " \n" ); + } else { + print( INDEX " \n" ); + } } print( INDEX "\n" ); } + print( INDEX "${opt_footer}\n" ) if $opt_footer; + # Print Copyright info on non-blank pages. if( $numimages > 0 ) { print( INDEX "
\n" ); *************** *** 2648,2653 **** --- 2720,2726 ---- 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"; --- 2732,2750 ---- 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"; *************** *** 2747,2762 **** # default URL if ( "${opt_htimage}" ne '' ) { print( IMAGEMAP "default " ! . abs_path_to_url("${sourceDirectory}/${opt_pageindexname}${pageNumber}.html") . "\n" ); } else { ! print( IMAGEMAP "default ${opt_pageindexname}${pageNumber}.html\n" ); } my $imageNum; for( $imageNum = 0; $imageNum <= $#{$imageNames[$pageNumber - 1]}; ++$imageNum ) { my $url = $imageNames[$pageNumber - 1][$imageNum]; my($x1,$y1,$x2,$y2); ($x1,$y1,$x2,$y2) = split(',', $imageThumbCoords[$pageNumber - 1][$imageNum]); if( $opt_maptype eq 'ncsa' ) { if ( "${opt_htimage}" ne '' ) { print( IMAGEMAP "rect " --- 2821,2843 ---- # default URL if ( "${opt_htimage}" ne '' ) { print( IMAGEMAP "default " ! . abs_path_to_url("${sourceDirectory}/${opt_pageindexname}${pageNumber}$opt_htmlext") . "\n" ); } else { ! print( IMAGEMAP "default ${opt_pageindexname}${pageNumber}$opt_htmlext\n" ); } my $imageNum; for( $imageNum = 0; $imageNum <= $#{$imageNames[$pageNumber - 1]}; ++$imageNum ) { my $url = $imageNames[$pageNumber - 1][$imageNum]; my($x1,$y1,$x2,$y2); ($x1,$y1,$x2,$y2) = split(',', $imageThumbCoords[$pageNumber - 1][$imageNum]); + if( $opt_pichtml ) { + if( !$opt_pichtmlext ) { + $url .= ".html"; + } else { + $url .= $opt_pichtmlext; + } + } if( $opt_maptype eq 'ncsa' ) { if ( "${opt_htimage}" ne '' ) { print( IMAGEMAP "rect " *************** *** 3345,3364 **** $fileNames{'montageServerMap'} = "${sourceDirectory}/${opt_pageindexname}${pageNumber}.map"; # Name for current HTML index page ! $fileNames{'htmlCurrentIndex'} = "${opt_pageindexname}${pageNumber}.html"; # Name for next HTML index page if($pageNumber == $numPages) { $fileNames{'htmlNextIndex'} = ''; } else { ! $fileNames{'htmlNextIndex'} = "${opt_pageindexname}${nextPageNumber}.html"; } # Name for previous HTML index page if($pageNumber == 1) { $fileNames{'htmlPrevIndex'} = ''; } else { ! $fileNames{'htmlPrevIndex'} = "${opt_pageindexname}${previousPageNumber}.html"; } --- 3426,3445 ---- $fileNames{'montageServerMap'} = "${sourceDirectory}/${opt_pageindexname}${pageNumber}.map"; # Name for current HTML index page ! $fileNames{'htmlCurrentIndex'} = "${opt_pageindexname}${pageNumber}$opt_htmlext"; # Name for next HTML index page if($pageNumber == $numPages) { $fileNames{'htmlNextIndex'} = ''; } else { ! $fileNames{'htmlNextIndex'} = "${opt_pageindexname}${nextPageNumber}$opt_htmlext"; } # Name for previous HTML index page if($pageNumber == 1) { $fileNames{'htmlPrevIndex'} = ''; } else { ! $fileNames{'htmlPrevIndex'} = "${opt_pageindexname}${previousPageNumber}$opt_htmlext"; }