From d908520b7ebde8e209a5db89a505f959ad6b76c4 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 23 Feb 2010 09:21:02 +0000 Subject: New imagecache generation system. --- utils/imagecache.php | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'utils/imagecache.php') diff --git a/utils/imagecache.php b/utils/imagecache.php index 8aaaba9..811ba0c 100644 --- a/utils/imagecache.php +++ b/utils/imagecache.php @@ -1,6 +1,18 @@ width = $w; + $this->height = $h; + } +}; function rescale($image, $maxwidth, $maxheight) { @@ -31,8 +43,26 @@ function errorImage($message) imagedestroy($im); } -function getCachedImage($filename, $maxwidth, $maxheight) +function getCachedImage($filename, $mod, $cat) { + global $modules; + loadModule($mod); + if(!$modules[$mod]) die(404); + + $size = $modules[$mod]->getImageSize($cat); + $maxwidth = $size->width; + $maxheight = $size->height; + + /* + if($mod == "discography") { + if($cat == "cover") { $maxwidth = 100; $maxheight = 100; } + } + if($mod == "gallery") { + if($cat == "randomimage") { $maxwidth = 100; $maxheight = 100; } + if($cat == "photo") { $maxwidth = 100; $maxheight = 100; } + if($cat == "albumicon") { $maxwidth = 100; $maxheight = 100; } + } + */ global $IMAGECACHE, $JPEG_CACHE_QUALITY; $fullfilename = $IMAGECACHE . "/" . $maxwidth . ":" . $maxheight . ":". urlencode($filename); -- cgit v1.2.3