From 6ad7260871a4afe06304a2591cc9351da8544181 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Oct 2017 23:26:15 +0530 Subject: [PATCH] Dont compress PNG files --- kitty/icat.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kitty/icat.py b/kitty/icat.py index 39198ba87..cc3801451 100755 --- a/kitty/icat.py +++ b/kitty/icat.py @@ -106,8 +106,13 @@ def set_cursor(cmd, width, height): def write_chunked(data, mode, width, height): - data = standard_b64encode(zlib.compress(data)) - cmd = {'a': 'T', 'o': 'z'} + cmd = {'a': 'T'} + if mode == 'PNG': + cmd['S'] = len(data) + else: + data = zlib.compress(data) + cmd['o'] = 'z' + data = standard_b64encode(data) add_format_code(cmd, mode, width, height) set_cursor(cmd, width, height) while data: