mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Attempt to detect configuration issues with pngdeflate,
which requires both the correct libpng and the correct zlib to function correctly.
This commit is contained in:
parent
34b7d62488
commit
9afb90f885
2
ANNOUNCE
2
ANNOUNCE
@ -69,6 +69,8 @@ Version 1.6.3beta05 [May 8, 2013]
|
|||||||
Added a call to png_set_packing()
|
Added a call to png_set_packing()
|
||||||
Initialize dimension values so if sscanf fails at least we have known
|
Initialize dimension values so if sscanf fails at least we have known
|
||||||
invalid values.
|
invalid values.
|
||||||
|
Attempt to detect configuration issues with pngdeflate, which requires
|
||||||
|
both the correct libpng and the correct zlib to function correctly.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
2
CHANGES
2
CHANGES
@ -4552,6 +4552,8 @@ Version 1.6.3beta05 [May 8, 2013]
|
|||||||
Added a call to png_set_packing()
|
Added a call to png_set_packing()
|
||||||
Initialize dimension values so if sscanf fails at least we have known
|
Initialize dimension values so if sscanf fails at least we have known
|
||||||
invalid values.
|
invalid values.
|
||||||
|
Attempt to detect configuration issues with pngdeflate, which requires
|
||||||
|
both the correct libpng and the correct zlib to function correctly.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
@ -188,7 +188,8 @@ endif
|
|||||||
$(srcdir)/scripts/pnglibconf.h.prebuilt:
|
$(srcdir)/scripts/pnglibconf.h.prebuilt:
|
||||||
@echo "Attempting to build $@" >&2
|
@echo "Attempting to build $@" >&2
|
||||||
@echo "This is a machine generated file, but if you want to make" >&2
|
@echo "This is a machine generated file, but if you want to make" >&2
|
||||||
@echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2
|
@echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2
|
||||||
|
@echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
# The following is necessary to ensure that the local pnglibconf.h is used, not
|
# The following is necessary to ensure that the local pnglibconf.h is used, not
|
||||||
|
|||||||
@ -25,20 +25,19 @@
|
|||||||
# include "../../png.h"
|
# include "../../png.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if PNG_LIBPNG_VER < 10600 /* 1.6.0 */
|
#if PNG_LIBPNG_VER < 10603 /* 1.6.3 */
|
||||||
# error pngdeflate will not work with libpng versions prior to 1.6
|
# error pngdeflate will not work with libpng versions prior to 1.6.3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifndef PNG_MAXIMUM_INFLATE_WINDOW
|
#ifndef PNG_MAXIMUM_INFLATE_WINDOW
|
||||||
# if PNG_LIBPNG_VER != 10600 && PNG_LIBPNG_VER != 10601 && \
|
# error pngdeflate not supported in this libpng version
|
||||||
PNG_LIBPNG_VER != 10602
|
|
||||||
# error pngdeflate not supported in this libpng version
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PNG_ZLIB_VERNUM >= 0x1240
|
||||||
|
|
||||||
/* Copied from pngpriv.h */
|
/* Copied from pngpriv.h */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
# define png_voidcast(type, value) static_cast<type>(value)
|
# define png_voidcast(type, value) static_cast<type>(value)
|
||||||
@ -726,8 +725,8 @@ fix_one(FILE *fp, FILE *fpIn, IDAT_info *info, png_uint_32 max_IDAT, int strip)
|
|||||||
break;
|
break;
|
||||||
/* Fall trhough */
|
/* Fall trhough */
|
||||||
|
|
||||||
default: /* Keep only IHDR, PLTE */
|
default: /* Keep only IHDR, PLTE, tRNS */
|
||||||
if (tag == png_IHDR || tag == png_PLTE)
|
if (tag == png_IHDR || tag == png_PLTE || tag == png_tRNS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
skip = 1;
|
skip = 1;
|
||||||
@ -994,8 +993,8 @@ usage(const char *prog, int rc)
|
|||||||
# endif
|
# endif
|
||||||
" --optimize (-o): Find the smallest deflate window size for the file.\n"
|
" --optimize (-o): Find the smallest deflate window size for the file.\n"
|
||||||
" Also outputs a summary for each file.\n"
|
" Also outputs a summary for each file.\n"
|
||||||
" --strip (-s): Remove chunks except for IHDR, PLTE, IEND, gAMA, sRGB.\n"
|
" --strip (-s): Remove chunks except for IHDR, PLTE, IEND, tRNS, gAMA,\n"
|
||||||
" If given twice remove gAMA and sRGB as well.\n"
|
" sRGB. If given twice remove gAMA and sRGB as well.\n"
|
||||||
" --errors (-e): Output errors from libpng (except too-far-back).\n");
|
" --errors (-e): Output errors from libpng (except too-far-back).\n");
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
" --warnings (-w): Output warnings from libpng.\n"
|
" --warnings (-w): Output warnings from libpng.\n"
|
||||||
@ -1169,6 +1168,16 @@ main(int argc, const char **argv)
|
|||||||
return err != 0;
|
return err != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* PNG_ZLIB_VERNUM < 0x1240 */
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "pngdeflate needs libpng with a zlib >=1.2.4 (not 0x%x)\n",
|
||||||
|
PNG_ZLIB_VERNUM);
|
||||||
|
return 77;
|
||||||
|
}
|
||||||
|
#endif /* PNG_ZLIB_VERNUM */
|
||||||
|
|
||||||
#else /* No read support */
|
#else /* No read support */
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@ -367,7 +367,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
|
|||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int ret; /* zlib return code */
|
int ret; /* zlib return code */
|
||||||
# if ZLIB_VERNUM >= 0x1240
|
# if PNG_ZLIB_VERNUM >= 0x1240
|
||||||
|
|
||||||
# if defined(PNG_SET_OPTION_SUPPORTED) && \
|
# if defined(PNG_SET_OPTION_SUPPORTED) && \
|
||||||
defined(PNG_MAXIMUM_INFLATE_WINDOW)
|
defined(PNG_MAXIMUM_INFLATE_WINDOW)
|
||||||
@ -394,7 +394,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
|
|||||||
|
|
||||||
if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
|
if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
|
||||||
{
|
{
|
||||||
# if ZLIB_VERNUM < 0x1240
|
# if PNG_ZLIB_VERNUM < 0x1240
|
||||||
ret = inflateReset(&png_ptr->zstream);
|
ret = inflateReset(&png_ptr->zstream);
|
||||||
# else
|
# else
|
||||||
ret = inflateReset2(&png_ptr->zstream, window_bits);
|
ret = inflateReset2(&png_ptr->zstream, window_bits);
|
||||||
@ -403,7 +403,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# if ZLIB_VERNUM < 0x1240
|
# if PNG_ZLIB_VERNUM < 0x1240
|
||||||
ret = inflateInit(&png_ptr->zstream);
|
ret = inflateInit(&png_ptr->zstream);
|
||||||
# else
|
# else
|
||||||
ret = inflateInit2(&png_ptr->zstream, window_bits);
|
ret = inflateInit2(&png_ptr->zstream, window_bits);
|
||||||
|
|||||||
@ -238,6 +238,7 @@ option ARM_NEON_CHECK disabled enables ARM_NEON
|
|||||||
setting Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
setting Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
||||||
setting Z_DEFAULT_STRATEGY default @Z_FILTERED
|
setting Z_DEFAULT_STRATEGY default @Z_FILTERED
|
||||||
setting Z_DEFAULT_NOFILTER_STRATEGY default @Z_DEFAULT_STRATEGY
|
setting Z_DEFAULT_NOFILTER_STRATEGY default @Z_DEFAULT_STRATEGY
|
||||||
|
setting ZLIB_VERNUM default @ZLIB_VERNUM
|
||||||
|
|
||||||
setting TEXT_Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
setting TEXT_Z_DEFAULT_COMPRESSION default @Z_DEFAULT_COMPRESSION
|
||||||
setting TEXT_Z_DEFAULT_STRATEGY default @Z_DEFAULT_STRATEGY
|
setting TEXT_Z_DEFAULT_STRATEGY default @Z_DEFAULT_STRATEGY
|
||||||
|
|||||||
@ -202,6 +202,7 @@
|
|||||||
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
|
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
|
||||||
#define PNG_WEIGHT_SHIFT 8
|
#define PNG_WEIGHT_SHIFT 8
|
||||||
#define PNG_ZBUF_SIZE 8192
|
#define PNG_ZBUF_SIZE 8192
|
||||||
|
#define PNG_ZLIB_VERNUM 0 /* unknown */
|
||||||
#define PNG_Z_DEFAULT_COMPRESSION (-1)
|
#define PNG_Z_DEFAULT_COMPRESSION (-1)
|
||||||
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
|
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
|
||||||
#define PNG_Z_DEFAULT_STRATEGY 1
|
#define PNG_Z_DEFAULT_STRATEGY 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user