From bc7992f4050effaa48189e9e5f2f4f855352aea2 Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 10 Mar 2023 20:09:40 +0800 Subject: [PATCH] f --- a.py | 2 +- draw-gen3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/a.py b/a.py index 3d1c318..7cf0bc0 100644 --- a/a.py +++ b/a.py @@ -119,7 +119,7 @@ def get_bg(): imgn = Image.open(io.BytesIO(base64.b64decode(line[5:-1]))) assert imgn.size == (X, Y) #print(imgn.mode) - if img is None: + if imgn.mode == 'RGB': img = imgn.convert(mode='RGBA') else: assert imgn.mode == 'RGBA' diff --git a/draw-gen3.py b/draw-gen3.py index 5a2e8b4..ecbd3d9 100644 --- a/draw-gen3.py +++ b/draw-gen3.py @@ -118,7 +118,7 @@ def get_bg(): imgn = Image.open(io.BytesIO(base64.b64decode(line[5:-1]))) assert imgn.size == (X, Y) #print(imgn.mode) - if img is None: + if imgn.mode == 'RGB': img = imgn.convert(mode='RGBA') else: assert imgn.mode == 'RGBA'