3 ms·
Having implemented most of the PNG specification from scratch in the past month, I agree with all of the features highlighted by the author in the article's int
by nayuki 4y ago
Having implemented most of the PNG specification from scratch in the past month, I agree with all of the features highlighted by the author in the article's introduction. Although there are some minor things I don't like, overall it is a very well-designed format that has minimal ambiguity and stands the test of time.
You can find my modern Java PNG library at: https://www.nayuki.io/page/png-library https://www.nayuki.io/page/png-library , https://github.com/nayuki/PNG-library https://github.com/nayuki/PNG-library
I also made a web-based tool to dissect PNG files and show all the fields and errors: https://www.nayuki.io/page/png-file-chunk-inspector https://www.nayuki.io/page/png-file-chunk-inspector
And my own "minimum-viable PNG writer" in ~140 lines of Java back in the year 2012: https://www.nayuki.io/page/dumb-png-output-java https://www.nayuki.io/page/dumb-png-output-java
- gred 4y ago> What makes this library modern? It [...] consumes more CPU and memory to simplify the logic and improve reliability. Intriguingly unapologetic, but I think I'll stick to the PNG libraries that are mature enough to be both reliable and fast :-)
- nayuki 4y agoThese might change your mind on reliability: https://github.com/glennrp/libpng/issues https://github.com/glennrp/libpng/issues ; http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html section "Security and Crash Bugs in Older Versions"; https://www.cvedetails.com/vulnerability-list/vendor_id-7294/Libpng.html https://www.cvedetails.com/vulnerability-list/vendor_id-7294... Regarding performance, I already lost the game before it started because I'm writing Java. If I wanted to squeeze CPU time, I would be writing C/C++/asm. So I decided to aim for conciseness and reliability instead of the endless stream of vulnerabilities.
- gred 4y agoPoint made, but I was actually thinking of the default Java platform support for writing PNG files (javax.imageio + zlib, which has a decent track record). https://www.cvedetails.com/product/111843/Zlib-Zlib.html?vendor_id=13265 https://www.cvedetails.com/product/111843/Zlib-Zlib.html?ven...