$y) {$tx=$maxx; $ty=$y/$x*$maxx; $iy=($maxy-$ty)/2; $ix=0;} else {$ty=$maxy; $tx=$x/$y*$maxy; $ix=($maxx-$tx)/2;$iy=0;} } imagecopyresized($im2,$im,$ix,$iy,0,0,$tx,$ty,$x,$y); if ($dest=="smjpg") { header ("Content-type: image/jpeg"); imagejpeg($im2,"",75); #header ("Content-type: image/gif"); #imagepng($im2); } elseif ($dest) { imagepng($im2,$dest); chmod ($dest,0777); } else { header ("Content-type: image/gif"); imagepng($im2); } } function displaythumbnails ($data) { global $maxx,$maxy,$size; $x=0; if (!file_exists("thumbs")) { mkdir("thumbs",0777); } foreach ($data as $tmp) { $x++; list($file,$msg)=explode(",",$tmp); $file=chop($file); if (!file_exists("./thumbs/$file")) { createthumbnail($maxx,$maxy,$file,"./thumbs/$file"); } print ""; if (file_exists("./thumbs/$file")) { print " \n"; } } error_reporting(1); # supress warnings about not being able to create "descriptions" file if ($tn) {createthumbnail($maxx,$maxy,$tn); exit;} if ($smpic) {createthumbnail(300,300,$smpic,"smjpg"); exit;} if (!$slide) {$thumbnails=1;} $data=array(); if (file_exists("descriptions")) { $data=file("descriptions"); if (strtoupper(substr($data[0],0,6)) == "TITLE=") { $title=substr($data[0],6); $trash=array_shift($data); } } else { $handle=opendir('.'); while (false!==($file = readdir($handle))) { if ($file != "." && $file != ".." && (eregi(".gif",$file) || eregi(".jpg",$file))) { array_push($data,$file); } } closedir($handle); # try and create the description file $fp=fopen("descriptions","w"); if ($fp) { fputs($fp,"title=\n"); foreach ($data as $out) { fputs($fp,"$out\n"); } fclose($fp); chmod("descriptions",0777); } } ?> <?=$title?>

$max) {$slide=1;} $prev=$slide-1; $next=$slide+1; $file=substr($data[$slide-1],0,strcspn($data[$slide-1],',')); $msg=substr($data[$slide-1],strcspn($data[$slide-1],',')+1); $file=chop($file); ?> 1) {print "<-PREVIOUS   ";} ?> (TN) $x ";} else {print "$x ";} } ?> (TN) NEXT->";} print "
"; if ($size) { print "Bigger pics "; } else {print "Smaller pics "; } print "

"; ?> "; ?>
"; } ?>