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
4
png.h
4
png.h
@@ -1659,7 +1659,7 @@ PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
|
||||
int method));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
|
||||
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
|
||||
/* Also set zlib parameters for compressing non-IDAT chunks */
|
||||
PNG_EXPORT(222, void, png_set_text_compression_level,
|
||||
(png_structp png_ptr, int level));
|
||||
@@ -1678,7 +1678,7 @@ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structp
|
||||
|
||||
PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
|
||||
int method));
|
||||
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
|
||||
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
|
||||
|
||||
/* These next functions are called for input/output, memory, and error
|
||||
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
|
||||
|
||||
Reference in New Issue
Block a user