From 286b7a951a6e1033e2d45a87628cf8c0eae8ae3a Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 21 Jul 2020 23:09:07 -0400 Subject: [PATCH] Disable optim. when recompressing clipboard PNG Far too slow for big (10MB+) PNG --- TODO.md | 1 + src/backend/matrix_client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index eebdd486..3cd42c4b 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ - Image viewer: - hflickable: support kinetic scrolling disabler + - settings - compress png in a thread - verify upload cancellation diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index c155f2aa..bed92840 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -598,7 +598,7 @@ class MatrixClient(nio.AsyncClient): async def get_path() -> Path: with io.BytesIO(image) as inp, io.BytesIO() as buffer: - PILImage.open(inp).save(buffer, "PNG", optimize=True) + PILImage.open(inp).save(buffer, "PNG") async with aiofiles.open(temp.name, "wb") as file: await file.write(buffer.getvalue())