Disable optim. when recompressing clipboard PNG
Far too slow for big (10MB+) PNG
This commit is contained in:
1
TODO.md
1
TODO.md
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- Image viewer:
|
- Image viewer:
|
||||||
- hflickable: support kinetic scrolling disabler
|
- hflickable: support kinetic scrolling disabler
|
||||||
|
- settings
|
||||||
|
|
||||||
- compress png in a thread
|
- compress png in a thread
|
||||||
- verify upload cancellation
|
- verify upload cancellation
|
||||||
|
@@ -598,7 +598,7 @@ class MatrixClient(nio.AsyncClient):
|
|||||||
|
|
||||||
async def get_path() -> Path:
|
async def get_path() -> Path:
|
||||||
with io.BytesIO(image) as inp, io.BytesIO() as buffer:
|
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:
|
async with aiofiles.open(temp.name, "wb") as file:
|
||||||
await file.write(buffer.getvalue())
|
await file.write(buffer.getvalue())
|
||||||
|
Reference in New Issue
Block a user