Return a stream of RGB24 instead of a garbled mess of consecutive pngs

This commit is contained in:
calledit 2025-01-29 12:27:24 +01:00 committed by GitHub
parent 37bbf63500
commit dbf1c17610
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,9 +135,7 @@ def b_command(
os.makedirs(output_dir, exist_ok=True)
def img_to_byte_array(img: PILImage) -> bytes:
buff = io.BytesIO()
img.save(buff, format="PNG")
return buff.getvalue()
return img.convert('RGB').tobytes("raw", "RGB")
async def connect_stdin_stdout():
loop = asyncio.get_event_loop()