From b5980ba875c17acf3b42ea66de6b5ed09f902abb Mon Sep 17 00:00:00 2001 From: Tuchuanhuhuhu Date: Wed, 15 Nov 2023 11:48:52 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8DPillow=2010=20?= =?UTF-8?q?=E7=9A=84API=E5=8F=98=E5=8A=A8=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=87=BA=E9=94=99=20fix=20#938?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/models/OpenAIVision.py | 2 +- modules/models/XMChat.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/models/OpenAIVision.py b/modules/models/OpenAIVision.py index 79481a38..1f8ae00d 100644 --- a/modules/models/OpenAIVision.py +++ b/modules/models/OpenAIVision.py @@ -84,7 +84,7 @@ def image_to_base64(image_path): # 按压缩比例调整图片大小 new_width = int(width * scale_ratio) new_height = int(height * scale_ratio) - img = img.resize((new_width, new_height), Image.ANTIALIAS) + img = img.resize((new_width, new_height), Image.LANCZOS) # 将图片转换为jpg格式的二进制数据 buffer = BytesIO() diff --git a/modules/models/XMChat.py b/modules/models/XMChat.py index 3e8cd27f..8453a02d 100644 --- a/modules/models/XMChat.py +++ b/modules/models/XMChat.py @@ -48,7 +48,7 @@ def image_to_base64(self, image_path): # 按压缩比例调整图片大小 new_width = int(width * scale_ratio) new_height = int(height * scale_ratio) - img = img.resize((new_width, new_height), Image.ANTIALIAS) + img = img.resize((new_width, new_height), Image.LANCZOS) # 将图片转换为jpg格式的二进制数据 buffer = BytesIO()