From 07882614bfd402132d2f8df23cc23c2c013b5f14 Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 11 Oct 2008 10:55:28 +0000 Subject: Did a lot of work on the imagecache, and the filehandler. Now both are functional, and used indirectly throught index.php, thus requiering login for access. --- forum/htdocs/imagecache.php | 62 --------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 forum/htdocs/imagecache.php (limited to 'forum/htdocs/imagecache.php') diff --git a/forum/htdocs/imagecache.php b/forum/htdocs/imagecache.php deleted file mode 100644 index f23a51d..0000000 --- a/forum/htdocs/imagecache.php +++ /dev/null @@ -1,62 +0,0 @@ - $maxwidth) $scale = $width / $maxwidth; - if($height / $scale > $maxheight) $scale = $height / $maxheight; - - $image_p = imagecreatetruecolor($width / $scale, $height / $scale); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width / $scale, $height / $scale, $width, $height); - - return $image_p; -} - - -$fullfilename = $IMAGECACHE . "/" . urlencode($filename); - -if(!file_exists($fullfilename)) { - - $url = parse_url($filename); - $filetype = strrchr($url["path"], '.'); - - if( true || ping($url["hostname"], 1000) != -1) { - - if(strcasecmp($filetype, ".jpeg") == 0 || strcasecmp($filetype, ".jpg") == 0) { - $image = imagecreatefromjpeg(urldecode($filename)); - if(!$image) die(404); - $image = rescale($image); - imagejpeg($image, $fullfilename, 90); - } else if(strcasecmp($filetype, ".gif") == 0) { - $image = imagecreatefromgif(urldecode($filename)); - if(!$image) die(404); - $image = rescale($image); - imagegif($image, $fullfilename); - } else if(strcasecmp($filetype, ".png") == 0) { - $image = imagecreatefrompng(urldecode($filename)); - if(!$image) die(404); - $image = rescale($image); - imagepng($image, $fullfilename); - } else { - echo "

Unknown image format " . $filetype . "

"; - } - - } -} - -header('Content-Description: File Transfer'); -header('Content-Type: image/jpeg'); -header('Content-Length: ' . filesize($fullfilename)); -header('Content-Disposition: inline; filename=' . basename($filename)); -readfile($fullfilename); - -?> \ No newline at end of file -- cgit v1.2.3