From b7e38f9c18386bdd8c564b71efc7748ba166464b Mon Sep 17 00:00:00 2001 From: filesite Date: Thu, 31 Oct 2024 19:29:10 +0800 Subject: [PATCH] add config support for image scale --- themes/beauty/controller/SiteController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index bd88ee9..ae0f41e 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -528,7 +528,8 @@ Class SiteController extends Controller { $imagick->scaleImage($width, $height, true); //生成缩略图,并自适应 $imagick->setImageFormat('jpeg'); - $imagick->setImageCompressionQuality(90); + $quality = !empty(FSC::$app['config']['smallImageQuality']) ? FSC::$app['config']['smallImageQuality'] : 90; + $imagick->setImageCompressionQuality($quality); $img_data = $imagick->getImageBlob(); $imagick->clear();