rcarmo / pngcanvas

A minimalist library to render PNG images using pure Python
MIT License
44 stars 9 forks source link

defilter code is not correct #5

Open bennoleslie opened 9 years ago

bennoleslie commented 9 years ago

The defilter code is not correct.

Identified issues:

1/ There is a badly indented 'else' clause. 2/ The defilter code does in place modification of row-data, but is passed an immutable tuple. 3/ The filter type is incorrectly passed, it should use the filter byte at the start of the scan line not the one in the header. 4/ The averaging algorithm is broken.

bennoleslie commented 9 years ago

Note: These issues are fixed in this branch: https://github.com/bennoleslie/pngcanvas/tree/fix-defilter-code-path however that depends on existing pull-requests to be merged.

BYK commented 9 years ago

Since the PR is merged, let's move forward with these patches too?