summaryrefslogtreecommitdiff
path: root/pngwutil.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-04-01 08:12:24 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-04-01 08:12:24 -0500
commit3bb8683a796b347dfe6e2f7957ac36af4653bb3c (patch)
treeac2f41d2a21fe7e51b72abd3ed646ba2f1d48db1 /pngwutil.c
parentbef60dc624f35bbe850787ac3db08e7bdcf8e434 (diff)
downloadlibpng-3bb8683a796b347dfe6e2f7957ac36af4653bb3c.tar.gz
[devel] Only compile the new zlib re-initializing code when text or iCCP
is supported.
Diffstat (limited to 'pngwutil.c')
-rw-r--r--pngwutil.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pngwutil.c b/pngwutil.c
index 957789bd0..25d714cf9 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -687,9 +687,6 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
png_ptr->zlib_text_method = 8;
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
- /* png_warning(png_ptr, "Initialize compressor for IDAT"); */
- /* Free memory from previously opened zstream */
- deflateEnd(&png_ptr->zstream);
/* Initialize the zlib compressor */
ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
png_ptr->zlib_method, png_ptr->zlib_window_bits,
@@ -788,6 +785,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
int ret;
unsigned int z_cmf; /* zlib compression method and flags */
+#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
if (png_ptr->mode & PNG_ZLIB_READY_FOR_ZTXT)
{
/* png_warning(png_ptr, "Initialize compressor for IDAT"); */
@@ -817,6 +815,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
}
png_ptr->mode &= ~PNG_ZLIB_READY_FOR_ZTXT; /* Ready for IDAT */
}
+#endif /* PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED */
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;