Imported from libpng-1.4.0beta14.tar

This commit is contained in:
Glenn Randers-Pehrson
2006-11-14 10:53:30 -06:00
parent 3779c69674
commit 6b12c08bfc
56 changed files with 1112 additions and 130 deletions

View File

@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* Last changed in libpng 1.2.11 June 7, 2006
* Last changed in libpng 1.4.0 November 14, 2006
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2006 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -181,6 +181,8 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
png_structp png_ptr=*ptr_ptr;
if(png_ptr == NULL) return;
do
{
if (user_png_ver[i] != png_libpng_ver[i])
@@ -258,6 +260,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
void PNGAPI
png_read_info(png_structp png_ptr, png_infop info_ptr)
{
if(png_ptr == NULL) return;
png_debug(1, "in png_read_info\n");
/* If we haven't checked all of the PNG signature bytes, do so now. */
if (png_ptr->sig_bytes < 8)
@@ -468,6 +471,7 @@ void PNGAPI
png_read_update_info(png_structp png_ptr, png_infop info_ptr)
{
png_debug(1, "in png_read_update_info\n");
if(png_ptr == NULL) return;
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
png_read_start_row(png_ptr);
else
@@ -486,6 +490,7 @@ void PNGAPI
png_start_read_image(png_structp png_ptr)
{
png_debug(1, "in png_start_read_image\n");
if(png_ptr == NULL) return;
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
png_read_start_row(png_ptr);
}
@@ -501,6 +506,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
const int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
#endif
int ret;
if(png_ptr == NULL) return;
png_debug2(1, "in png_read_row (row %lu, pass %d)\n",
(unsigned long) png_ptr->row_number, png_ptr->pass);
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
@@ -751,6 +757,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
png_bytepp dp;
png_debug(1, "in png_read_rows\n");
if(png_ptr == NULL) return;
rp = row;
dp = display_row;
if (rp != NULL && dp != NULL)
@@ -799,6 +806,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
png_bytepp rp;
png_debug(1, "in png_read_image\n");
if(png_ptr == NULL) return;
#ifdef PNG_READ_INTERLACING_SUPPORTED
pass = png_set_interlace_handling(png_ptr);
@@ -836,6 +844,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
png_uint_32 length;
png_debug(1, "in png_read_end\n");
if(png_ptr == NULL) return;
png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
do
@@ -1221,6 +1230,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
void PNGAPI
png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn)
{
if(png_ptr == NULL) return;
png_ptr->read_row_fn = read_row_fn;
}
@@ -1234,6 +1244,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
{
int row;
if(png_ptr == NULL) return;
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
/* invert the alpha channel from opacity to transparency
*/