From 1b29c1391153e9be8e11b7242076d3c0051720db Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 17 Jan 2005 20:14:55 +0000 Subject: [PATCH] Remove gif support, add png support. Don't overzoom large version of images. --- scripts/perl/web/mkindex.pl | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/perl/web/mkindex.pl b/scripts/perl/web/mkindex.pl index a1376ddee..47b5115b4 100755 --- a/scripts/perl/web/mkindex.pl +++ b/scripts/perl/web/mkindex.pl @@ -78,7 +78,7 @@ sub is_newer { # Make images (both large and small) # -@FILES = `ls $src/*.jpg $src/*.JPG $src/*.gif`; +@FILES = `ls $src/*.jpg $src/*.JPG $src/*.png`; foreach $file ( @FILES ) { chop $file; @@ -87,15 +87,15 @@ foreach $file ( @FILES ) { if ( is_newer( "$src/$file", "$ldir/$file" ) || ! -e "$ldir/$file" ) { print "Updating $ldir/$file\n"; system("cp -f $src/$file $ldir"); - system("mogrify -geometry $lwidth" . "X" . - "$lheight -interlace LINE -quality 80 $ldir/$file"); + system("mogrify -geometry \'$lwidth" . "X" . + "$lheight>\' -interlace LINE -quality 80 $ldir/$file"); } if ( is_newer( "$ldir/$file", "$sdir/$file" ) || ! -e "$sdir/$file" ) { print "Updating $sdir/$file\n"; system("cp -f $ldir/$file $sdir"); - system("mogrify -geometry $swidth" . "X" . - "$sheight -interlace LINE -quality 80 $sdir/$file"); + system("mogrify -geometry \'$swidth" . "X" . + "$sheight>\' -interlace LINE -quality 80 $sdir/$file"); } } @@ -134,7 +134,7 @@ open( MASTER, " ) { chop; - if ( m/\.jpg$/ || m/\.JPG$/ || m/\.gif$/ ) { + if ( m/\.jpg$/ || m/\.JPG$/ || m/\.png$/ ) { push @imagelist, $_; } else { # just ignore everything else @@ -190,7 +190,7 @@ while ( ) { print OUT "

\n"; $j = 1; $in_table = 0; - } elsif ( m/\.jpg$/ || m/\.JPG$/ || m/\.gif$/ ) { + } elsif ( m/\.jpg$/ || m/\.JPG$/ || m/\.png$/ ) { # insert image in 3 wide tables $in_table = 1; @@ -209,8 +209,8 @@ while ( ) { $linkname = `basename $i .jpg`; } elsif ( $i =~ m/\.JPG$/ ) { $linkname = `basename $i .JPG`; - } else { - $linkname = `basename $i .gif`; + } elsif ($i =~ m/\.png$/ ) { + $linkname = `basename $i .png`; } chop($linkname); # print OUT "\n"; @@ -334,7 +334,7 @@ while ( ) { # Generate Links # -# @FILES = `ls $src/*.jpg $src/*.JPG $src/*.gif`; +# @FILES = `ls $src/*.jpg $src/*.JPG $src/*.png`; $first = $imagelist[0]; if ( $first =~ m/\.jpg$/ ) { @@ -344,8 +344,8 @@ if ( $first =~ m/\.jpg$/ ) { # print " ext = JPG\n"; $firstname = `basename $first .JPG`; } else { - # print " ext = gif\n"; - $firstname = `basename $first .gif`; + # print " ext = png\n"; + $firstname = `basename $first .png`; } chop($firstname); @@ -357,8 +357,8 @@ if ( $last =~ m/\.jpg$/ ) { # print " ext = JPG\n"; $lastname = `basename $last .JPG`; } else { - # print " ext = gif\n"; - $lastname = `basename $last .gif`; + # print " ext = png\n"; + $lastname = `basename $last .png`; } chop($lastname); @@ -385,8 +385,8 @@ for ($i = 0; $i <= $#imagelist; $i++) { $linkname = `basename $file .JPG`; $ext = "JPG"; } else { - $linkname = `basename $file .gif`; - $ext = "gif"; + $linkname = `basename $file .png`; + $ext = "png"; } chop($linkname); $nice_name = $linkname; @@ -399,8 +399,8 @@ for ($i = 0; $i <= $#imagelist; $i++) { # print " ext = JPG\n"; $prevname = `basename $prev .JPG`; } else { - # print " ext = gif\n"; - $prevname = `basename $prev .gif`; + # print " ext = png\n"; + $prevname = `basename $prev .png`; } chop($prevname); @@ -409,7 +409,7 @@ for ($i = 0; $i <= $#imagelist; $i++) { } elsif ( $next =~ m/\.JPG$/ ) { $nextname = `basename $next .JPG`; } else { - $nextname = `basename $next .gif`; + $nextname = `basename $next .png`; } chop($nextname);