#!%%PERL%% -s
select(STDOUT); $| = 1; # set unbuffered
$dataroot = "%%GRIDROOT%%" ;
#print "Content-type: image/jpeg\n\n" ;
print "Content-type: text/html\n\n" ;
#($gridpix = $ENV{'PATH_INFO'}) =~ s|^/|| ;
$_ = $ENV{'QUERY_STRING'} ;
#$_ = "2319102115470094&4&1200&675&6&2";
/(\d+)&(\d+)&(\d+)/;
$dir = $1;
$width = $2;
$height = $3;
#print "
" ;
#system "/usr/bin/sed -e 's/%width%/$width/' -e 's/%height%/$height/' -e 's,%dir%,/famsf/gridpix/$dir/thumbnails,' -e 's,/cgi-bin/getimg2,http://128.32.45.101/cgi-bin/getimg7,' $dataroot/$dir/files.html" ;
if (-r "$dataroot/$dir/files.html") {
system "/usr/bin/sed -e 's/%width%/$width/' -e 's/%height%/$height/' -e 's,%dir%,/famsf/gridpix/$dir/thumbnails,' -e 's,updir.gif\">,updir.gif\">,' $dataroot/$dir/files.html" ;
}
else {
print "" ;
print "The folder you requested (\"$dir\") does not exist on this server.\n";
print "" ;
}