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'