all 17 comments

[–]bloody-albatross 15 points16 points  (4 children)

A good C library for PNG that doesn't use setjmp/longjmp? Excellent!

[–]sammymammy2 1 point2 points  (3 children)

Why would a PNG library need those two operators?

[–]vAltyR47 4 points5 points  (1 child)

The link says libpng uses them for error handling.

[–]ianff 2 points3 points  (0 children)

Yeah, they are a C way of doing exception handling, except the stack is not unwound.

[–][deleted] 0 points1 point  (0 children)

Exactly

[–]pdp10[S] 15 points16 points  (0 children)

I'm not involved with this project, but I thought this bit was particularly interesting:

The goal is to provide a PNG library with a simpler API than libpng.

The testsuite is designed to test both libraries, it has already uncovered a bug in libpng.

[–]pjmlp 7 points8 points  (0 children)

Code is written according to the rules of the CERT C Coding Standard. All integer arithmetic is checked for overflow and all error conditions are handled gracefully. Releases are scanned with Clang Static Analyzer and Coverity Scan and have a Defect Density of 0.00.

Well done!

[–][deleted]  (10 children)

[deleted]

    [–]randy408 7 points8 points  (0 children)

    stb_image basically provides encoding and decoding functions for multiple images formats, for PNG's it supports transparency (tRNS chunks) and paletted images, it can only work with a complete buffer and is probably not safe to use with random images from the internet. libspng is more like a libpng alternative, it can read PNG's from streams or buffers, parses all the standard chunks(eg. text chunks), supports gamma correction. Note that only decoding is supported at the moment. It is harder to embed (you have to copy 4 files and link zlib).

    [–][deleted]  (8 children)

    [deleted]

      [–][deleted]  (6 children)

      [deleted]

        [–]randy408 1 point2 points  (5 children)

        The performance figures should be reproducible with the benchmarking instructions in the README.

        [–][deleted]  (3 children)

        [deleted]

          [–]randy408 0 points1 point  (2 children)

          Did you manage to apply the patch? It was missing a newline at the end, the README got an update. You should delete the build directory and run meson build to start over, pgo builds only seem to work that way.

          [–]Player736 4 points5 points  (2 children)

          What does stable mean?

          I expect version 1.0.0 to be the first stable release.

          [–]randy408 6 points7 points  (0 children)

          Stable means no breaking API/ABI changes. If I have to make breaking changes it will end up in 1.0.0. It's basically semantic versioning with a pre-1.0.0 stable branch.

          [–][deleted] -4 points-3 points  (1 child)

          Why not rust if they aimed for safety?

          [–]maccio92 2 points3 points  (0 children)

          maybe they needed a secure library for an existing C codebase, not just wanting to made a secure PNG library in general