[SDL] SDL_pnglite - a lightweight PNG reader/writer

Alexander Sabourenkov llxxnntt at gmail.com
Fri Jan 29 16:23:29 PST 2016


In an unexpected bout of inspiration I sat and patched it up to:

 a) differ as less as possible from SDL2_image's IMG_LoadPNG_RW() in results

 b) preserve as much as possible information when writing out a surface

SDL_pnglite is a small library based on libpnglite to read and write PNG
files to/from SDL_Surfaces. The only dependency is zlib. It also is very
suitable for static linking.

Testing the loader over PngSuite set shows results identical (as in
resulting surfaces)  to IMG_Load() modulo lacking support for 16bit depth
and interlacing. A single discrepancy is due to a bug in SDL2_image.

The save path, on the other hand, writes out paletted surfaces as such and
preserves colorkey transparency in all cases.

Tests were done on x86_64 and an emulated arm1176, so I'm reasonably sure
there are no obvious endianness-related bugs.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20160130/e3145a1e/attachment.htm>

More information about the SDL mailing list