Compression changes/fixes

Simplified API: change handling of PNG_IMAGE_FLAG_FAST to use
PNG_COMPRESSION_HIGH_SPEED, and PNG_COMPRESSION_HIGH otherwise.

Compression: add missing break statements that caused some compression settings
to fall through to the 'HIGH' setting.

Internal: remove png_struct::flags, it only stored the 'library mismatch' flag
and that could never be accessed (because immediately after it was set the
png_struct, which was on the stack, was eliminated.)

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2016-06-08 08:37:20 -07:00
parent b70b51ba17
commit d52c8eba99
5 changed files with 29 additions and 56 deletions

View File

@@ -618,22 +618,6 @@
#define PNG_HAVE_IEND 0x10U
#define PNG_HAVE_PNG_SIGNATURE 0x20U
/* Flags for the png_ptr->flags.
* TODO: change to bit fields.
*/
#define PNG_FLAG_LIBRARY_MISMATCH 0x001U
/*#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x002U NO LONGER USED */
/*#define PNG_FLAG_CRC_ANCILLARY_USE 0x004U NO LONGER USED */
/*#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x008U NO LONGER USED */
/*#define PNG_FLAG_CRC_CRITICAL_USE 0x010U NO LONGER USED */
/*#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x020U NO LONGER USED */
/*#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x040U NEVER USED */
/*#define PNG_FLAG_STRIP_ERROR_TEXT 0x080U NEVER USED */
/*#define PNG_FLAG_IDAT_ERRORS_WARN 0x100U NEVER SET */
/*#define PNG_FLAG_BENIGN_ERRORS_WARN 0x200U NO LONGER USED */
/*#define PNG_FLAG_APP_WARNINGS_WARN 0x400U NO LONGER USED */
/*#define PNG_FLAG_APP_ERRORS_WARN 0x800U NO LONGER USED */
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* See below for the definitions of the tables used in these macros */
@@ -968,12 +952,6 @@ PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr,
double fp, png_const_charp text),PNG_EMPTY);
#endif
/* Check the user version string for compatibility, returns false if the version
* numbers aren't compatible.
*/
PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr,
png_const_charp user_png_ver),PNG_EMPTY);
/* Internal base allocator - no messages, NULL on failure to allocate. This
* does, however, call the application provided allocator and that could call
* png_error (although that would be a bug in the application implementation.)