Fixes for !READ_INTERLACE/!READ_PNG interpendencies

The reliance of png_read_png on interlace handling and some minor issues in the
test programs where they failed to correctly check for interlace handling were
exposed by the ability to write interlaced images even if WRITE_INTERLACING is
turned off.  This is fixed here.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-11-22 21:37:16 -08:00
parent b69df74b8e
commit 6803b09cb7
4 changed files with 33 additions and 9 deletions

View File

@@ -36,7 +36,8 @@
# include <setjmp.h> /* because png.h did *not* include this */
#endif
#if defined(PNG_INFO_IMAGE_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)
#if defined(PNG_INFO_IMAGE_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)\
&& defined(PNG_READ_PNG_SUPPORTED)
/* If a transform is valid on both read and write this implies that if the
* transform is applied to read it must also be applied on write to produce
* meaningful data. This is because these transforms when performed on read
@@ -1676,7 +1677,7 @@ main(const int argc, const char * const * const argv)
return errors != 0;
}
}
#else /* !PNG_INFO_IMAGE_SUPPORTED || !PNG_READ_SUPPORTED */
#else /* !INFO_IMAGE || !SEQUENTIAL_READ || !READ_PNG*/
int
main(void)
{