The png library uses setjmp/longjmp to throw exceptions when reading. If this is not set up, the png library calls abort(). This change handles the errors and throws a C++ exception instead. This issue was found by testing images from pngsuite at http://www.schaik.com/pngsuite/. These images are included and a unit test was added to test both images that should be successful and images that should throw an exception.
145 B
32x32px
145 B
32x32px
![](/sij/mapnik/raw/commit/9e78712dc43d41b6833f05aab62b75259b2a6945/tests/data/pngsuite/basn0g04.png)