From ae96cb809a5e8b4ee1454ea5e0212da006587e7d Mon Sep 17 00:00:00 2001 From: forchannot <100580891+forchannot@users.noreply.github.com> Date: Wed, 1 Nov 2023 17:15:27 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=9C=86=E5=A4=B4=E5=83=8F=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=20(#483)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :bug: 修复某些角色圆头像无法正常显示 * 加个判断 --- LittlePaimon/utils/image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LittlePaimon/utils/image.py b/LittlePaimon/utils/image.py index abb3b31..ce05776 100644 --- a/LittlePaimon/utils/image.py +++ b/LittlePaimon/utils/image.py @@ -417,7 +417,8 @@ class PMImage: """ 将图片转换为圆形 """ - # self.convert('RGBA') + if self.image.mode != 'RGBA': + self.image = self.convert('RGBA') w, h = self.size r2 = min(w, h) if w != h: