mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00

Improve and modernize png2pnm.c: * Remove the explicit reading of the input PNG file signature. Libpng is now able to read it, check it, and issue an appropriate error message in case of magic number mismatch or file corruption. (See the function `png_read_sig`.) * Remove the explicit allocation and dealocation of the image data. Libpng is now able to manage all the image data automatically. (See the function `png_read_png`.) * Specify the needed image transformations without a-priori checking the image type for applicability. * Use the `png_set_expand_gray_1_2_4_to_8` transformation. Since libpng version 1.2.9, this transformation (if needed) must be enabled separately from `png_set_expand`. Improve and modernize pnm2png.c: * Modify the allocation of image data, in order to match libpng's internal allocation model. * Transfer the ownership of the image data from the `pnm2png` function to libpng, which will manage and dealocate it at the right time. (See the functions `png_set_image_rows` and `png_data_freer`.) Refactor, clean up, etc.
This "contrib" directory contains contributions which are not necessarily under the libpng license, although all are open source. They are not part of libpng proper and are not used for building the library, although some are used for testing the library via "make check".