diff --git a/pngrutil.c b/pngrutil.c index d47643174..47c1a2221 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -278,8 +278,7 @@ png_crc_error(png_structp png_ptr) return (0); } -#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \ - defined(PNG_READ_iCCP_SUPPORTED) +#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED static png_size_t png_inflate(png_structp png_ptr, png_bytep data, png_size_t size, png_bytep output, png_size_t output_size) @@ -536,7 +535,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, *newlength = prefix_size; } -#endif +#endif /* PNG_READ_COMPRESSED_TEXT_SUPPORTED */ /* Read and check the IDHR chunk */ void /* PRIVATE */ diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa index b1afba13a..b214a1a35 100644 --- a/scripts/pnglibconf.dfa +++ b/scripts/pnglibconf.dfa @@ -506,7 +506,7 @@ chunk cHRM chunk gAMA chunk hIST chunk iCCP -chunk iTXt requires TEXT +chunk iTXt chunk oFFs chunk pCAL chunk sCAL @@ -517,7 +517,7 @@ chunk sRGB chunk tEXt requires TEXT chunk tIME chunk tRNS -chunk zTXt requires TEXT +chunk zTXt # This only affects support of the optional PLTE chunk in RGB and RGBA # images. Notice that READ_ANCILLARY_CHUNKS therefore disables part @@ -546,9 +546,21 @@ option SAVE_INT_32 requires WRITE # png_save_int_32 is required by the ancillary chunks oFFs and pCAL +option READ_iCCP enables READ_COMPRESSED_TEXT +option READ_iTXt enables READ_COMPRESSED_TEXT +option READ_sPLT enables READ_COMPRESSED_TEXT +option READ_zTXt enables READ_COMPRESSED_TEXT +option READ_COMPRESSED_TEXT enables READ_TEXT + option WRITE_oFFs enables SAVE_INT_32 option WRITE_pCAL enables SAVE_INT_32 +option WRITE_iCCP enables WRITE_COMPRESSED_TEXT +option WRITE_iTXt enables WRITE_COMPRESSED_TEXT +option WRITE_sPLT enables WRITE_COMPRESSED_TEXT +option WRITE_zTXt enables WRITE_COMPRESSED_TEXT +option WRITE_COMPRESSED_TEXT enables WRITE_TEXT + # Turn this off to disable png_read_png() and png_write_png() and # leave the row_pointers member out of the info structure. diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt index d0a6092f4..a27650267 100644 --- a/scripts/pnglibconf.h.prebuilt +++ b/scripts/pnglibconf.h.prebuilt @@ -113,6 +113,7 @@ #define PNG_READ_USER_CHUNKS_SUPPORTED #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_zTXt_SUPPORTED +#define PNG_READ_COMPRESSED_TEXT_SUPPORTED #define PNG_SAVE_INT_32_SUPPORTED #define PNG_sBIT_SUPPORTED #define PNG_sCAL_SUPPORTED @@ -176,6 +177,7 @@ #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_zTXt_SUPPORTED #define PNG_zTXt_SUPPORTED +#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ /*#undef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED*/ /* end of options */