From 4daae301744199a01f2c506a239b8d20576e6b37 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 6 Oct 2011 21:37:47 -0500 Subject: [libpng15] #ifdef out png_progressive_combine_row() when interlacing is not supported. --- example.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'example.c') diff --git a/example.c b/example.c index c0d27f487..fc91f4a87 100644 --- a/example.c +++ b/example.c @@ -2,7 +2,7 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.6 [(PENDING RELEASE)] * This file has been placed in the public domain by the authors. * Maintained 1998-2011 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) @@ -341,11 +341,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ /* Add filler (or alpha) byte (before/after each RGB triplet) */ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Turn on interlace handling. REQUIRED if you are not using * png_read_image(). To see how to handle interlacing passes, * see the png_read_row() method below: */ number_passes = png_set_interlace_handling(png_ptr); +#else + number_passes = 1; +#endif /* PNG_READ_INTERLACING_SUPPORTED */ + /* Optional call to gamma correct and add the background to the palette * and update info structure. REQUIRED if you are expecting libpng to @@ -527,6 +532,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, */ png_bytep old_row = ((png_bytep *)our_data)[row_num]; +#ifdef PNG_READ_INTERLACING_SUPPORTED /* If both rows are allocated then copy the new row * data to the corresponding row data. */ @@ -555,6 +561,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, * to pass the current row as new_row, and the function will combine * the old row and the new row. */ +#endif /* PNG_READ_INTERLACING_SUPPORTED */ } end_callback(png_structp png_ptr, png_infop info) -- cgit v1.2.1