降低缩略图质量

This commit is contained in:
Wisp X 2022-10-21 10:25:47 +08:00
parent d5230acdb3
commit bb37a11bfb

View File

@ -567,7 +567,7 @@ class ImageService
$height = (int)($h * $scale);
}
$img->fit($width, $height, fn($constraint) => $constraint->upsize())->encode('png')->save($pathname);
$img->fit($width, $height, fn($constraint) => $constraint->upsize())->encode('png', 60)->save($pathname);
$img->destroy();
} catch (\Throwable $e) {
Utils::e($e, '生成缩略图时出现异常');