Skip to content

Commit

Permalink
Fix #7: libpng warning on linux (ignoring bad filter type)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Apr 22, 2016
1 parent 7eb0ffc commit f9b7794
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mss/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f9b7794

Please sign in to comment.