#!/usr/bin/perl use File::Basename; $cgi = basename $0; print "Content-Type: text/html\n\n"; $image = $ARGV[0]; $image =~ /img(\d+)/; print "
No image specified\n"; exit; } print "
$1\n"; } } print "
\n"; print "< Previous \n" if ( $prev ); print "Index\n"; if ( -f "IMG_$num.JPG" ) { $size = int( (stat("IMG_$num.JPG"))[7] / 1024 ); print " Fullsize ($size kB)\n"; } print " Next >\n" if ( $next ); } # showing fullsize already elsif ( $image =~ /IMG_(\d+).JPG/ ) { $num = $1; for $i ( 1 .. 10 ) { $prev = sprintf("%04d",$num-$i); last if ( -f "IMG_$prev.JPG" ); } if ( $prev == $num-10 ) { undef $prev; } for $i ( 1 .. 20 ) { $next = sprintf("%04d",$num+$i); print "\n"; last if ( -f "IMG_$next.JPG" ); } if ( $next == $num+20 ) { undef $next; } print "
\n"; print "< Previous \n" if ( $prev ); print "Index\n"; if ( -f "img$num.jpg" ) { $size = int( (stat("img$num.jpg"))[7] / 1024 ); print " Small ($size kB)\n"; } print " Next >\n" if ( $next ); } print "