mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Test backport
Tests backported from the multi-version compatible ones in libpng 1.7 Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
@@ -31,13 +31,6 @@
|
||||
# include "../../png.h"
|
||||
#endif
|
||||
|
||||
#if PNG_LIBPNG_VER < 10700
|
||||
/* READ_INTERLACING was used instead of READ_DEINTERLACE. */
|
||||
# ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
# define PNG_READ_DEINTERLACE_SUPPORTED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static int
|
||||
read_png(FILE *fp)
|
||||
{
|
||||
@@ -77,12 +70,12 @@ read_png(FILE *fp)
|
||||
|
||||
{
|
||||
png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
|
||||
# ifdef PNG_READ_DEINTERLACE_SUPPORTED
|
||||
# ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
int passes = png_set_interlace_handling(png_ptr);
|
||||
# else
|
||||
# else /* !READ_INTERLACING */
|
||||
int passes = png_get_interlace_type(png_ptr, info_ptr) ==
|
||||
PNG_INTERLACE_ADAM7 ? PNG_INTERLACE_ADAM7_PASSES : 1;
|
||||
# endif
|
||||
# endif /* !READ_INTERLACING */
|
||||
int pass;
|
||||
|
||||
png_start_read_image(png_ptr);
|
||||
@@ -91,10 +84,10 @@ read_png(FILE *fp)
|
||||
{
|
||||
png_uint_32 y = height;
|
||||
|
||||
# ifndef PNG_READ_DEINTERLACE_SUPPORTED
|
||||
# ifndef PNG_READ_INTERLACING_SUPPORTED
|
||||
if (passes == PNG_INTERLACE_ADAM7_PASSES)
|
||||
y = PNG_PASS_ROWS(y, pass);
|
||||
# endif
|
||||
# endif /* READ_INTERLACING */
|
||||
|
||||
/* NOTE: this trashes the row each time; interlace handling won't
|
||||
* work, but this avoids memory thrashing for speed testing.
|
||||
|
||||
Reference in New Issue
Block a user