loadpng deficiencies (was Re: [AD] GIF patent / support)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Chris wrote:


Also, I'm not too fond of loadpng. When I last looked, it still did some questionable things (reducing 16-bit down to 8-bit when loading,


It doesn't.  I suppose you mean this:

   /* Convert 16-bit to 8-bit. */
   if (bit_depth == 16)
   png_set_strip_16(png_ptr);

This strips 16-bits _per colour component_ down to 8-bits per colour component, which is all that Allegro supports.

saves 8-bit bitmaps by accessing bmp->line[0] and assuming linear memory,


I will fix this in the next version.

and saving 24-bit bitmaps as 32-bit PNGs,


It doesn't.

even though 15/16-bit bitmaps save as 24-bit PNGs).


PNG doesn't support what Allegro calls 15/16-bit images. From http://www.libpng.org/pub/png/book/chapter08.html : "RGB (truecolor) PNGs ... are supported in only two depths: 8 and 16 bits per sample, corresponding to 24 and 48 bits per pixel."

BTW, I wrote zlib/libpng installation instructions for mingw users here: http://members.ozadsl.com.au/~tjaden/loadpng/mingw.html . I think that's pretty easy.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/