From 59fd70e568fbc93922769333c55d8c1fa72cea9d Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 4 May 2011 02:20:44 -0700 Subject: issues with private photos - hitting internal size limits --- include/Photo.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/Photo.php') diff --git a/include/Photo.php b/include/Photo.php index 9934b9a39..707b0de5d 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -162,12 +162,20 @@ class Photo { } public function saveImage($path) { - imagejpeg($this->image,$path,100); + $quality = get_config('system','jpeg_quality'); + if((! $quality) || ($quality > 100)) + $quality = JPEG_QUALITY; + imagejpeg($this->image,$path,$quality); } public function imageString() { ob_start(); - imagejpeg($this->image,NULL,100); + + $quality = get_config('system','jpeg_quality'); + if((! $quality) || ($quality > 100)) + $quality = JPEG_QUALITY; + + imagejpeg($this->image,NULL,$quality); $s = ob_get_contents(); ob_end_clean(); return $s; -- cgit v1.2.3