This commit is contained in:
JerryXiao 2023-03-10 20:09:40 +08:00
parent 32069e5b1f
commit bc7992f405
2 changed files with 2 additions and 2 deletions

2
a.py
View File

@ -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'

View File

@ -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'