summaryrefslogtreecommitdiff
path: root/pngstruct.h
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2012-03-05 20:57:40 -0600
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2012-03-05 20:57:40 -0600
commit42a2b556e93879f4abe667eb96906aef1fb4e1b3 (patch)
tree9ff4a364b4a827760937b4ade4a9ebe2bd9970aa /pngstruct.h
parente2ae0f2f2b0b5cf96bd90635dcf9a21461e62678 (diff)
downloadlibpng-42a2b556e93879f4abe667eb96906aef1fb4e1b3.tar.gz
[libpng16] Made read 'inflate' handling like write 'deflate' handling. The
read code now claims and releases png_ptr->zstream, like the write code. The bug whereby the progressive reader failed to release the zstream is now fixed, all initialization is delayed, and the code checks for changed parameters on deflate rather than always calling deflatedEnd/deflateInit.
Diffstat (limited to 'pngstruct.h')
-rw-r--r--pngstruct.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/pngstruct.h b/pngstruct.h
index 467007ec2..87ea234b0 100644
--- a/pngstruct.h
+++ b/pngstruct.h
@@ -68,20 +68,8 @@ struct png_struct_def
z_stream zstream; /* pointer to decompression structure (below) */
png_bytep zbuf; /* buffer for zlib */
uInt zbuf_size; /* size of zbuf (typically 65536) */
-#ifdef PNG_WRITE_SUPPORTED
-
-/* Added in 1.5.4: state to keep track of whether the zstream has been
- * initialized and if so whether it is for IDAT or some other chunk.
- */
-#define PNG_ZLIB_UNINITIALIZED 0
-#define PNG_ZLIB_FOR_IDAT 1
-#define PNG_ZLIB_FOR_TEXT 2 /* anything other than IDAT */
-#define PNG_ZLIB_USE_MASK 3 /* bottom two bits */
-#define PNG_ZLIB_IN_USE 4 /* a flag value */
-
- png_uint_32 zlib_state; /* State of zlib initialization */
-/* End of material added at libpng 1.5.4 */
+#ifdef PNG_WRITE_SUPPORTED
int zlib_level; /* holds zlib compression level */
int zlib_method; /* holds zlib compression method */
int zlib_window_bits; /* holds zlib compression window bits */
@@ -89,8 +77,7 @@ struct png_struct_def
int zlib_strategy; /* holds zlib compression strategy */
#endif
/* Added at libpng 1.5.4 */
-#if defined(PNG_WRITE_COMPRESSED_TEXT_SUPPORTED) || \
- defined(PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED)
+#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
int zlib_text_level; /* holds zlib compression level */
int zlib_text_method; /* holds zlib compression method */
int zlib_text_window_bits; /* holds zlib compression window bits */
@@ -98,6 +85,14 @@ struct png_struct_def
int zlib_text_strategy; /* holds zlib compression strategy */
#endif
/* End of material added at libpng 1.5.4 */
+/* Added at libpng 1.6.0 */
+#ifdef PNG_WRITE_SUPPORTED
+ int zlib_set_level; /* Actual values set into the zstream on write */
+ int zlib_set_method;
+ int zlib_set_window_bits;
+ int zlib_set_mem_level;
+ int zlib_set_strategy;
+#endif
png_uint_32 width; /* width of image in pixels */
png_uint_32 height; /* height of image in pixels */