From c3bc3d8165e5970fe880e3ff209be893e47e20fa Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 26 Jan 2010 12:30:52 +0000 Subject: Make jpeg thumbnail quality configurable. --- utils/imagecache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/imagecache.php b/utils/imagecache.php index 39c741e..ba5fcb2 100644 --- a/utils/imagecache.php +++ b/utils/imagecache.php @@ -33,7 +33,7 @@ function errorImage($message) function getCachedImage($filename, $maxwidth, $maxheight) { - global $IMAGECACHE; + global $IMAGECACHE, $JPEG_CACHE_QUALITY; $fullfilename = $IMAGECACHE . "/" . $maxwidth . ":" . $maxheight . ":". urlencode($filename); // Test the storage dir @@ -61,7 +61,7 @@ function getCachedImage($filename, $maxwidth, $maxheight) $image = imagecreatefromjpeg(urldecode($filename)); if(!$image) errorImage("Could not read: ". $filename); $image = rescale($image, $maxwidth, $maxheight); - imagejpeg($image, $fullfilename, 90); + imagejpeg($image, $fullfilename, $JPEG_CACHE_QUALITY); break; case ".gif": @@ -95,4 +95,4 @@ function getCachedImage($filename, $maxwidth, $maxheight) readfile($fullfilename); } -?> \ No newline at end of file +?> -- cgit v1.2.3