From f9b77942d8b694f1fdca198074a7a2e231f8b3b3 Mon Sep 17 00:00:00 2001 From: BoboTiG Date: Fri, 22 Apr 2016 19:53:39 +0200 Subject: [PATCH] Fix #7: libpng warning on linux (ignoring bad filter type) --- mss/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mss/helpers.py b/mss/helpers.py index 29cad415..5cc6c6a8 100644 --- a/mss/helpers.py +++ b/mss/helpers.py @@ -99,8 +99,9 @@ def to_png(self, data, width, height, output): b = pack line = (width * 3 + 3) & -4 padding = 0 if line % 8 == 0 else (line % 8) // 2 + filter = b(b'>B', 0) scanlines = b''.join( - [b'0' + data[y * line:y * line + line - padding] + [filter + data[y * line:y * line + line - padding] for y in range(height)]) magic = b(b'>8B', 137, 80, 78, 71, 13, 10, 26, 10)