[libpng17] Ported recent changes from libpng16 to libpng17

Fixed 'minimal' builds. Various obviously useful minimal configurations
  don't build because of missing contrib/libtests test programs and overly
  complex dependencies in scripts/pnglibconf.dfa. This change adds
  contrib/conftest/*.dfa files that can be used in automatic build
  scripts to ensure that these configurations continue to build.
Enabled WRITE_INVERT and WRITE_PACK in contrib/pngminim/encoder.
This commit is contained in:
John Bowler
2013-11-22 17:41:20 -06:00
committed by Glenn Randers-Pehrson
parent 81824079b5
commit 7e2707e2af
35 changed files with 738 additions and 271 deletions

View File

@@ -50,7 +50,7 @@
# error "pngfix will not work with libpng prior to 1.6.3"
#endif
#ifdef PNG_READ_SUPPORTED
#if defined(PNG_READ_SUPPORTED) && defined(PNG_EASY_ACCESS_SUPPORTED)
/* zlib.h defines the structure z_stream, an instance of which is included
* in this structure and is required for decompressing the LZ compressed
* data in PNG files.
@@ -142,6 +142,11 @@
/* Is it safe to copy? */
#define SAFE_TO_COPY(chunk) (((chunk) & PNG_U32(0,0,0,32)) != 0)
/* Fix ups for builds with limited read support */
#ifndef PNG_ERROR_TEXT_SUPPORTED
# define png_error(a,b) png_err(a)
#endif
/********************************* UTILITIES **********************************/
/* UNREACHED is a value to cause an assert to fail. Because of the way the
* assert macro is written the string "UNREACHED" is produced in the error
@@ -3644,7 +3649,7 @@ read_png(struct control *control)
return rc;
}
static void
static int
one_file(struct global *global, const char *file_name, const char *out_name)
{
int rc;
@@ -3663,6 +3668,8 @@ one_file(struct global *global, const char *file_name, const char *out_name)
rc = read_png(&control);
rc |= control_end(&control);
return rc;
}
static void
@@ -4031,4 +4038,4 @@ main(void)
fprintf(stderr, "pngfix does not work without read support\n");
return 77;
}
#endif /* PNG_READ_SUPPORTED */
#endif /* PNG_READ_SUPPORTED && PNG_EASY_ACCESS_SUPPORTED */