mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is
wrong (high by one) 25% of the time. Dividing by 257 with rounding is
wrong in 128 out of 65536 cases. Getting the right answer all the time
without division is easy.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
cc2770850a
commit
b2bee3374c
@@ -88,7 +88,7 @@ struct png_struct_def
|
||||
#endif
|
||||
/* Added at libpng 1.5.3 */
|
||||
#if defined(PNG_WRITE_COMPRESSED_TEXT_SUPPORTED) || \
|
||||
defined(PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION)
|
||||
defined(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 */
|
||||
|
||||
Reference in New Issue
Block a user