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]))) imgn = Image.open(io.BytesIO(base64.b64decode(line[5:-1])))
assert imgn.size == (X, Y) assert imgn.size == (X, Y)
#print(imgn.mode) #print(imgn.mode)
if img is None: if imgn.mode == 'RGB':
img = imgn.convert(mode='RGBA') img = imgn.convert(mode='RGBA')
else: else:
assert imgn.mode == 'RGBA' assert imgn.mode == 'RGBA'

View file

@ -118,7 +118,7 @@ def get_bg():
imgn = Image.open(io.BytesIO(base64.b64decode(line[5:-1]))) imgn = Image.open(io.BytesIO(base64.b64decode(line[5:-1])))
assert imgn.size == (X, Y) assert imgn.size == (X, Y)
#print(imgn.mode) #print(imgn.mode)
if img is None: if imgn.mode == 'RGB':
img = imgn.convert(mode='RGBA') img = imgn.convert(mode='RGBA')
else: else:
assert imgn.mode == 'RGBA' assert imgn.mode == 'RGBA'