mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
FORMAT PNG used libpng only to write 8-bit, non-interlaced images. Replace the libpng wrapper with a small native PNG encoder (signature, IHDR, a single Deflate-compressed IDAT using the "None" scanline filter, and IEND). It reuses the existing zlib-based ZlibDeflatingWriteBuffer for compression and zlib's crc32 for chunk checksums, so the result is a standard PNG datastream that any decoder can read. This removes the contrib/libpng submodule and the USE_LIBPNG build option; the format is now gated on USE_BASE64 only. There is no interlacing, no adaptive per-row filter selection, and no libpng-style setjmp/longjmp error handling — I/O errors propagate as normal exceptions. The encoder shrank from ~250 to ~130 lines. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>