Commit Graph

1252 Commits

Author SHA1 Message Date
John Bowler
d099973c4f [libpng16] Made makepng and pngtest produce identical PNGs, add "--relaxed"
option to pngtest. The "--relaxed" option turns off the benign errors that are
enabled by default in pre-RC builds. makepng can now write ICC profiles
where the length has not been extended to a multiple of 4, and pngtest
now intercepts all libpng errors, allowing the previously-introduced
"--strict test" on no warnings to actually work.
2012-09-01 11:46:14 -05:00
Glenn Randers-Pehrson
97a77a6f7b [libpng16] Updated simplified API synopses and description of the png_image
structure in the manual.
2012-09-01 08:16:51 -05:00
Glenn Randers-Pehrson
b2aba47a6d [libpng16] Added contrib/examples/* to the *.zip and *.7z distributions. 2012-09-01 06:40:48 -05:00
John Bowler
ed3ca0e3eb [libpng16] Fixed the simplified API example programs and improved the error
message if the version field is not set.
2012-08-31 17:32:36 -05:00
Glenn Randers-Pehrson
fd043e5d0d [libpng16] Bump version to 1.6.0beta29 2012-08-29 14:18:24 -05:00
Glenn Randers-Pehrson
cc02f89eb2 [libpng16] Imported from libpng-1.6.0beta28.tar 2012-08-29 14:18:15 -05:00
John Bowler
14d0ca620e [libpng16] Cleaned up and corrected ICC profile handling.
contrib/libtests/makepng: corrected 'rgb' and 'gray' cases.  profile_error
    messages could be truncated; made a correct buffer size calculation and
    adjusted pngerror.c appropriately. png_icc_check_* checking improved;
    changed the functions to receive the correct color type of the PNG on read
    or write and check that it matches the color space of the profile (despite
    what the comments said before, there is danger in assuming the app will
    cope correctly with an RGB profile on a grayscale image and, since it
    violates the PNG spec, allowing it is certain to produce inconsistent
    app behavior and might even cause app crashes.) Check that profiles
    contain the tags needed to process the PNG (tags all required by the ICC
    spec). Removed unused PNG_STATIC from pngpriv.h.
2012-08-25 16:21:46 -05:00
Glenn Randers-Pehrson
702053d110 [libpng16] Bump version to 1.6.0beta28 2012-08-17 21:54:45 -05:00
John Bowler
d0eef28ee1 [libpng16] Added "tunknown" test and corrected a logic error in
png_handle_unknown() when SAVE support is absent.  Moved the shell test
scripts for contrib/libtests from the libpng top directory to contrib/libtests.
png_handle_unknown() must always read or skip the chunk, if
SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
a user callback an unknown chunk will not be read, leading to a read
error, which was revealed by the "tunknown" test.
2012-08-17 15:30:29 -05:00
John Bowler
3c1f6983c5 [libpng16] Corrected fix for unknown handling in pngtest. This reinstates the
libpng handling of unknown chunks other than vpAg and sTER (including
unsafe-to-copy chunks which were dropped before) and eliminates the
repositioning of vpAg and sTER in pngtest.png by changing pngtest.png
(so the chunks are where libpng would put them).
2012-08-16 20:47:34 -05:00
John Bowler
4a6c6df6c7 [libpng16] Allow fine grain control of unknown chunk APIs. This change allows
png_set_keep_unknown_chunks() to be turned off if not required and causes
both read and write to behave appropriately (on read this is only possible
if the user callback is used to handle unknown chunks).  The change
also removes the support for storing unknown chunks in the info_struct
if the only unknown handling enabled is via the callback, allowing libpng
to be configured with callback reading and none of the unnecessary code.
2012-08-16 16:12:13 -05:00
John Bowler
e9567514dd [libpng16] Unknown handling fixes and clean up. This adds more correct option
control of the unknown handling, corrects the pre-existing bug where
the per-chunk 'keep' setting is ignored and makes it possible to skip
IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
There is a new test program, test-unknown.c, which is a work in progress
(not currently part of the test suite).  Comments in the header files now
explain how the unknown handling works.
2012-08-15 22:53:00 -05:00
Glenn Randers-Pehrson
b593b3f035 [libpng16] Bump version to 1.6.0beta28 2012-08-11 18:32:36 -05:00
Glenn Randers-Pehrson
0f08665bfb [libpng16] Imported from libpng-1.6.0beta27.tar 2012-08-11 18:31:44 -05:00
John Bowler
aa9dea57d7 [libpng16] Work around gcc 3.x and Microsoft Visual Studio 2010 complaints.
Both object to the split initialization of num_chunks.
2012-08-10 19:04:08 -05:00
Glenn Randers-Pehrson
ece07cfe9c [libpng16] Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(),
and png_memcmp() macros.
2012-08-10 18:19:41 -05:00
Glenn Randers-Pehrson
dbb7e19fda [libpng16] Consistently use memset(), memcpy(), and memcmp() instead of the
png_memset(), png_memcpy(), and png_memcmp() macros.
2012-08-10 17:27:42 -05:00
John Bowler
e2098ba085 [libpng16] Make all three "make check" test programs work without READ or WRITE
support.  Now "make check" will succeed even if libpng is compiled with
-DPNG_NO_READ or -DPNG_NO_WRITE.  The tests performed are reduced, but the
basic reading and writing of a PNG file is always tested by one or more of
the tests.
2012-08-10 17:04:56 -05:00
Glenn Randers-Pehrson
26849f4693 [libpng16] Consistently use png_memset(), png_memcpy(), and png_memcmp(),
except in pngtest.c and example.c where these macros are not visible.
2012-08-10 16:01:45 -05:00
John Bowler
ad5a993954 [libpng16] Cause pngtest --strict to fail on any warning from libpng (not just
errors) and cause it not to fail at the comparison step if libpng lacks support
for writing chunks that it reads from the input (currently only implemented
for compressed text chunks).
2012-08-10 13:15:07 -05:00
John Bowler
865e14fd32 [libpng16] Revised comments about info_ptr->signature, added CHANGES entry. 2012-08-10 08:05:53 -05:00
John Bowler
8d3453a22d [libpng16] Insist on autotools 1.12.1 for git builds because there are security
issues with 1.12 and insisting on anything less would allow 1.12 to be used.
2012-08-09 22:57:35 -05:00
John Bowler
dff6f4c4f0 [libpng16Cleanup of png_set_filler(). This function does very different things
on read and write.  In libpng 1.6 the two cases can be distinguished and
considerable code cleanup, and extra error checking, is possible.  This
makes calls on the write side that have no effect be ignored with a
png_app_error(), which can be disabled in the app using
png_set_benign_errors(), and removes the spurious use of usr_channels
on the read side.
2012-08-09 21:17:56 -05:00
Glenn Randers-Pehrson
432c174b64 [libpng16] Eliminated use of png_sizeof(); use sizeof() instead, and use.
a consistent style for (sizeof type) and (sizeof (array))
2012-08-09 20:14:48 -05:00
John Bowler
5f5977e708 [libpng16] Re-eliminated the use of strcpy() in pngtest.c. An unncessary use
of strcpy() was accidentally re-introduced in libpng16; this change replaces
it with strncpy().
2012-08-09 16:42:42 -05:00
John Bowler
0a9f8eb272 [libpng16] Fixed configurations where floating point is completely disabled.
Because of the changes to support symbol prefixing PNG_INTERNAL_FUNCTION
declares floating point APIs during libpng builds even if they are completely
disabled. This requires the png floating point types (png_double*) to be
declared even though the functions are never actually defined.  This
change provides a dummy definition so that the declarations work, yet any
implementation will fail to compile because of an incomplete type.
2012-08-09 07:35:50 -05:00
Glenn Randers-Pehrson
01b813000a [libpng16] Removed references to png_zalloc() and png_zfree() from the manual.
They have not been exported to applications since libpng12.
2012-08-03 07:23:42 -05:00
Glenn Randers-Pehrson
0a9f26e219 [libpng16] Do not use __restrict when GNUC is <= 3.1 2012-07-21 11:16:17 -05:00
Glenn Randers-Pehrson
05ed18e7d1 [libpng16] Bump version to 1.6.0beta27 2012-07-21 11:02:42 -05:00
Glenn Randers-Pehrson
edb3523a9b [libpng16] Imported from libpng-1.6.0beta26.tar 2012-07-10 21:00:41 -05:00
Glenn Randers-Pehrson
46cb5109bd [libpng16] Moved scripts/chkfmt to contrib/tools. 2012-06-25 14:14:17 -05:00
Glenn Randers-Pehrson
5845d3eabd [libpng16] Removed scripts/makefile.cegcc from the *.zip and *.7z
distributions; it depends on configure, which is not included in those
archives.
2012-06-25 09:11:53 -05:00
Glenn Randers-Pehrson
4a37149f66 [libpng16] Bump version to 1.6.0beta26 2012-06-16 14:50:34 -05:00
Glenn Randers-Pehrson
96b917056d [libpng16] Revised png_set_keep_unknown_chunks() so num_chunks < 0 means
ignore all unknown chunks and all known chunks except for IHDR, PLTE, tRNS,
IDAT, and IEND.  Previously it only meant ignore all unknown chunks, the
same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
provide a list of chunks to be processed instead of a list of chunks to
ignore.  Revised contrib/gregbook/readpng2.c accordingly.
2012-06-16 13:26:28 -05:00
Glenn Randers-Pehrson
0546e4e579 [libpng16] Document deprecation of png_convert_to_rfc1123() and its
replacement with png_convert_to_rfc1123_buffer().
2012-06-12 13:06:52 -05:00
Glenn Randers-Pehrson
d630301d99 [libpng16] Bump version to 1.6.0beta25 2012-06-07 10:29:14 -05:00
Glenn Randers-Pehrson
905cc94e3d [libpng16] Don't check palette indexes if num_palette is 0 (as it can be in
MNG files).
2012-06-07 10:18:25 -05:00
Glenn Randers-Pehrson
8f424b8270 [libpng16] Bump version to 1.6.0beta24 2012-06-06 13:54:41 -05:00
Glenn Randers-Pehrson
14ca47b453 [libpng16] Improved performance of new do_check_palette_indexes() function
(only update the value when it actually increases, move test for whether
the check is wanted out of the function.
2012-06-06 13:30:30 -05:00
Glenn Randers-Pehrson
b1e7771d5e [libpng16] Do not depend upon a GCC feature macro being available for use in
generating the linker mapfile symbol prefix.
2012-06-03 19:30:02 -05:00
Glenn Randers-Pehrson
ff7b7ba060 [libpng16] Made fixes for new optimization warnings from gcc 4.7.0.
The compiler performs an optimization which is safe; however it then warns
about it.  Changing the type of 'palette_number' in pngvalid.c removes the
warning.
2012-06-03 19:17:48 -05:00
Glenn Randers-Pehrson
1935d0738f [libpng16] Revised CMakeLists.txt to not attempt to make a symlink under mingw. 2012-05-29 05:50:04 -05:00
Glenn Randers-Pehrson
04c1c078b9 [libpng16] Bump version to 1.6.0beta23 2012-05-23 13:19:38 -05:00
Glenn Randers-Pehrson
8f4d67218e [libpng16] Imported from libpng-1.6.0beta22.tar 2012-05-23 13:19:30 -05:00
John Bowler
b45416921b [libpng16] Removed need for -Wno-cast-align with clang. clang correctly warns
on alignment increasing pointer casts when -Wcast-align is passed. This
fixes the cases clang warns about either (pngread.c) by eliminating the
casts from png_bytep to png_uint_16p or, for pngrutil.c where the cast
is previously verified or pngstest.c where it is OK by introducing new
png_aligncast macros to do the cast in a way that clang accepts.
2012-04-30 06:31:54 -05:00
Glenn Randers-Pehrson
040575c80b [libpng16] Bump version to 1.6.0beta22 2012-04-28 06:34:57 -05:00
Glenn Randers-Pehrson
bc2a57f657 [libpng16] Changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE in
scripts/makefile.freebsd
2012-04-28 05:48:21 -05:00
Glenn Randers-Pehrson
cd39adb561 [libpng16] Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
declaration of png_handle_unknown().
2012-04-23 23:12:39 -05:00
Glenn Randers-Pehrson
b4f5c42092 [libpng16] Revised scripts/makefile.darwin: use system zlib; remove quotes
around architecture list; add missing ppc architecture; add architecture
options to shared library link; don't try to create a shared lib based on
missing RELEASE variable (Toby Thain).
2012-04-13 12:36:22 -05:00
Glenn Randers-Pehrson
e243a1fbd8 [libpng16] Enable png_set_check_for_invalid_index() for both read and write. 2012-04-13 12:35:21 -05:00
Glenn Randers-Pehrson
f229d4df3a [libpng16] Bump version to 1.6.0beta21 2012-03-29 07:42:45 -05:00
Glenn Randers-Pehrson
96027d919f [libpng16] Imported from libpng-1.6.0beta20.tar 2012-03-29 06:38:51 -05:00
John Bowler
921648a997 [libpng16] Recognize known sRGB ICC profiles while reading; prefer writing the
iCCP profile over writing the sRGB chunk, controlled by the
    PNG_sRGB_PROFILE_CHECKS option.
2012-03-28 23:36:12 -05:00
John Bowler
23a30f8583 [libpng16] Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice. 2012-03-28 11:38:02 -05:00
Glenn Randers-Pehrson
48015617d3 [libpng16] Recognize known sRGB ICC profiles while reading and issue a warning
about it, if PNG_WARN_IF_iCCP_IS_sRGB_SUPPORTED is defined.
2012-03-28 10:58:01 -05:00
John Bowler
13a87d9682 [libpng16] Fixed ICC profile parsing and sRGB profile recognition
and moved checksum-icc.c from contrib/libtests to contrib/tools.
2012-03-28 09:51:43 -05:00
John Bowler
51d1e2be1b [libng16] Added checksum-icc.c to contrib/libtests 2012-03-22 07:36:13 -05:00
Glenn Randers-Pehrson
8fbd60ded2 [libpng16] Recognize known sRGB ICC profiles while reading and handle them as
if the sRGB chunk had appeared instead.
2012-03-21 09:18:15 -05:00
John Bowler
b11b31aea2 [libpng16] Changed chunk handler warnings into benign errors, incrementally
load iCCP
2012-03-21 07:55:46 -05:00
Glenn Randers-Pehrson
51624965e2 [libpng16] Bump version to 1.6.0beta20 2012-03-19 11:04:48 -05:00
John Bowler
eda53e5770 [libpng16] Avoid the double gamma correction warning in the simplified API.
This allows the --strict option to pass in the pngstest checks
2012-03-18 22:46:28 -05:00
John Bowler
2bc76ffaf1 [ibpng16] Added application error reporting and added chunk names to read
benign errors; also added --strict to pngstest - not enabled
yet because a warning is produced.
2012-03-18 22:37:25 -05:00
John Bowler
66efa24241 [libpng16] Removed erroneous setting of DETECT_UNINITIALIZED and added more
checks. The code now does a png_error if an attempt is made to do the
row initialization twice; this is an application error and it has
serious consequences because the transform data in png_struct is
changed by each call.
2012-03-18 21:10:29 -05:00
John Bowler
0c11b5f8e7 [libpng16] Work around for duplicate row start calls; added warning messages.
This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
fails to call one of the 'start' routines (not enabled in libpng-1.5
because it is technically an API change, since it did normally work
before.)  It also makes duplicate calls to png_read_start_row (an
internal function called at the start of the image read) benign, as
they were before changes to use png_inflate_claim. Somehow webkit is
causing this to happen; this is probably a mis-feature in the zlib
changes so this commit is only a work-round.
2012-03-18 14:39:41 -05:00
Glenn Randers-Pehrson
f5dcba6b9b [libpng16] Never mind, undid previous change. 2012-03-17 00:21:45 -05:00
Glenn Randers-Pehrson
c26d6e9aac [libpng16] Revised png_set_text_2() to avoid possible memory corruption
when writing.
2012-03-16 23:19:02 -05:00
Glenn Randers-Pehrson
42ed02ed9a [libpng16] Reverted png_set_itxt(); it would not compile without warnings. 2012-03-16 23:17:27 -05:00
Glenn Randers-Pehrson
31d66245ea [libpng16] Added png_set_itxt() (work in progress) 2012-03-16 13:53:25 -05:00
Glenn Randers-Pehrson
d9d7a7e8f0 [libpng16] Fixed ANNOUNCE and CHANGES re simplified API and benign errors. 2012-03-16 11:04:30 -05:00
Glenn Randers-Pehrson
d15d124d6d [libpng16] Bump version to 1.6.0beta19 2012-03-16 08:35:36 -05:00
John Bowler
aa816c4444 [libpng16] Added configuration support for benign errors and changed the read
default. Also changed some warnings in the iCCP and sRGB handling
from to benign errors. Configuration now makes read benign
errors warnings and write benign errors to errors by default (thus
changing the behavior on read).  The simplified API always forces
read benign errors to errors (regardless of the system default, unless
this is disabled in which case the simplified API can't be built.)
2012-03-16 07:39:49 -05:00
John Bowler
209b3e4b79 [libpng16] Added output flushing to aid debugging under Visual Studio.
This is necessary because the VS2010 output window otherwise simply loses
the error messages on error (they weren't flushed to the window before
the process exited, apparently!)
2012-03-16 07:14:01 -05:00
Glenn Randers-Pehrson
f2715a558a [libpng16] Revised example.c to put text strings in a temporary character array
instead of directly assigning string constants to png_textp members.
This avoids compiler warnings when -Wwrite-strings is enabled.
2012-03-15 19:52:03 -05:00
John Bowler
845ee6af72 [libpng16] Fixed a compiler warning under Cygwin (Windows-7, 32-bit system) 2012-03-10 21:05:19 -06:00
John Bowler
9ff37ea94f [libpng16] Fix an off-by-one error in the palette index checking function. 2012-03-10 20:03:06 -06:00
Glenn Randers-Pehrson
35f2e1768b [libpng16] In pngtest, treat benign errors as errors if "-strict" is present. 2012-03-10 19:42:03 -06:00
Glenn Randers-Pehrson
945cb1f9be [libpng16] Issue a png_benign_error() instead of png_warning() about bad
palette index.
2012-03-10 08:48:04 -06:00
Glenn Randers-Pehrson
71db131882 [libpng16] Bump version to 1.6.0beta18 2012-03-09 22:15:09 -06:00
John Bowler
9066919600 [libpng16] If benign errors are disabled use maximum window on ancillary
inflate.  This works round a bug introduced in 1.5.4 where compressed ancillary
chunks could end up with a too-small windowBits value in the deflate
header.
2012-03-09 22:03:13 -06:00
John Bowler
b5d0051dcb [libpng16] Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c.  A new shared keyword check routine was also added
and the 'zbuf' is no longer allocated on progressive read.  It is now
possible to call png_inflate() incrementally.
2012-03-09 09:15:18 -06:00
Glenn Randers-Pehrson
6038b80277 [libpng16] Reject iCCP chunk after the first, even if the first one is invalid. 2012-03-08 10:40:07 -06:00
Glenn Randers-Pehrson
b57c1c9e6e [libpng16] Bump version to 1.6.0beta17 2012-03-05 21:35:40 -06:00
John Bowler
6225b0e61e [libpng16] Added code to validate the windowBits value passed to deflateInit2().
If the call to deflateInit2() is wrong a png_warning will be issued
(in fact this is harmless, but the PNG data produced may be sub-optimal).
2012-03-05 21:26:57 -06:00
John Bowler
7d4fbb2fbb [libpng16] Validate the zTXt strings in pngvalid. 2012-03-05 21:02:49 -06:00
John Bowler
42a2b556e9 [libpng16] Made read 'inflate' handling like write 'deflate' handling. The
read code now claims and releases png_ptr->zstream, like the write code.
The bug whereby the progressive reader failed to release the zstream
is now fixed, all initialization is delayed, and the code checks for
changed parameters on deflate rather than always calling
deflatedEnd/deflateInit.
2012-03-05 20:57:40 -06:00
John Bowler
e741cd592e [libpng16] Added contrib/libtests/tarith.c to test internal arithmetic
functions from png.c. This is a libpng maintainer program used to validate
changes to the internal arithmetic functions.
2012-03-04 20:48:57 -06:00
John Bowler
0ae4f7b705 [libpng16] Changed png_inflate() and calling routines to avoid overflow
problems.  This is an intermediate check-in that solves the immediate problems
and introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
Further changes will be made to make ICC profile handling more secure.
2012-03-03 21:10:26 -06:00
John Bowler
29a6ba01a7 [libpng16] Fixed build warnings (MSVC, GCC, GCC v3). Cygwin GCC with default
options declares 'index' as a global, causing a warning if it is used as a
local variable.  GCC 64-bit warns about assigning a (size_t) (unsigned 64-bit)
to an (int) (signed 32-bit).  MSVC, however, warns about using the
unary '-' operator on an unsigned value (even though it is well defined
by ANSI-C to be ~x+1).  The padding calculation was changed to use a
different method.  Removed the tests on png_ptr->pass.
2012-03-03 20:49:03 -06:00
Glenn Randers-Pehrson
eeb1bb678d [libng16] Added palette-index checking while writing.
Relocated palette-index checking function from pngrutil.c to pngtrans.c
2012-03-02 22:10:15 -06:00
Glenn Randers-Pehrson
8e92cd51c6 [libpng16] Bump version to 1.6.0beta16 2012-03-02 14:04:36 -06:00
Glenn Randers-Pehrson
363387c9c0 [libpng16] Imported from libpng-1.6.0beta15.tar 2012-03-02 13:45:00 -06:00
John Bowler
6f237b6bf0 [libpng16] Remove whitespace at end of lines 2012-03-02 13:20:52 -06:00
John Bowler
cf49919686 [libpng16] Fixed some bugs in ICC profile writing. The code should now accept
all potentially valid ICC profiles and reject obviously invalid ones.
It now uses png_error() to do so rather than casually writing a PNG
without the necessary color data.
2012-03-01 21:54:07 -06:00
Glenn Randers-Pehrson
363ae65e2b [libpng16] Added tests for invalid palette index while reading and writing
(work in progress, the latter isn't finished).
2012-03-01 21:39:29 -06:00
John Bowler
cb129a6234 [libpng16] Improved pngstest fine tuning of error numbers, new test file
generator.  The generator generates images that test the full range of sample
values, allow the error numbers in pngstest to be tuned and checked.  makepng
also allows generation of images with extra chunks, although this is
still work-in-progress.
2012-03-01 21:26:54 -06:00
John Bowler
dee7577330 [libpng16] Added PNG_IMAGE_FLAG_FAST for the benefit of applications that
store intermediate files, or intermediate in-memory data, while processing
image data with the simplified API.  The option makes the files larger
but faster to write and read.  pngstest now uses this by default; this
can be disabled with the --slow option.
2012-03-01 18:55:54 -06:00
John Bowler
1c25b9b06b [libpng16] Fixed transparent pixel and 16-bit rgb tests in pngstest and removed
a spurious check in pngwrite.c
2012-02-29 10:49:28 -06:00
John Bowler
0a92b23c4b [libpng16] Rewrote pngstest.c for substantial speed improvement. 2012-02-29 06:47:55 -06:00
Glenn Randers-Pehrson
5408b613f8 [libpng16] Removed unused "current_text" members of png_struct
and the png_free() of png_ptr->current_text from pngread.c
2012-02-27 08:09:42 -06:00
Glenn Randers-Pehrson
b7e32059d3 [libpng16] Bump version to 1.6.0beta15 2012-02-26 21:38:19 -06:00
Glenn Randers-Pehrson
faf38eea03 [libpng16] Imported from libpng-1.6.0beta14.tar 2012-02-26 21:38:09 -06:00
Glenn Randers-Pehrson
9eb125e927 [libpng16] Updated Makefile.in
Added information about the new limits in the manual.
2012-02-24 22:04:53 -06:00
Glenn Randers-Pehrson
16bb03b8b4 [libpng16] Bump version to 1.6.0beta14 2012-02-24 11:52:56 -06:00
Glenn Randers-Pehrson
4690b89eaa [libpng16] Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new pngusr.dfa
to reset the user limits to safe ones if PNG_SAFE_LIMITS is defined.
To enable, use CPPFLAGS=-DPNG_SAFE_LIMITS on the configure command
or put #define PNG_SAFE_LIMITS_SUPPORTED in pnglibconf.h.prebuilt.
(Reverted previous implementation of PNG_SECURE.)
2012-02-24 11:43:31 -06:00
Glenn Randers-Pehrson
10c0693210 [libpng16] Added PNG_SECURE feature to pnglibconf.dfa and new pngusr.dfa file
to reset the user limits to safe ones if PNG_SECURE is defined.
2012-02-23 18:41:13 -06:00
Glenn Randers-Pehrson
17ba5de88f [libpng16] Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
    now that png_ptr->buffer is inaccessible to applications, the special
    handling is no longer useful.
2012-02-21 14:49:56 -06:00
Glenn Randers-Pehrson
7d5bf79d88 [libpng16] Bump version to 1.6.0beta13 2012-02-18 22:54:56 -06:00
Glenn Randers-Pehrson
a4badc4b50 [libpng16] Imported from libpng-1.6.0beta12.tar 2012-02-17 17:07:54 -06:00
Glenn Randers-Pehrson
b0606ea043 [libpng16] Increase num_palette to invalid_index + 1, not to invalid_index. 2012-02-16 20:48:28 -06:00
Glenn Randers-Pehrson
566fb611b6 [libpng16] Bump version to 1.6.0beta12 2012-02-16 20:24:39 -06:00
Glenn Randers-Pehrson
67dba43998 [libpng16] Check for invalid palette index while reading paletted PNG. When
one is found, issue a warning and increase png_ptr->num_palette accordingly.
Apps are responsible for checking to see if that happened.
2012-02-16 20:15:13 -06:00
John Bowler
bce7988230 [libpng16] Fixed fixed/float API export conditionals. 1) If FIXED_POINT or
FLOATING_POINT options were switched off, png.h ended up with lone ';'
    characters.  This is not valid ANSI-C outside a function.  The ';'
    characters have been moved inside the definition of PNG_FP_EXPORT and
    PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration
    of the corresponding functions were completely omitted, even though some
    of them are still used internally.  The result is still valid, but
    produces warnings from gcc with some warning options (including -Wall). The
    fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION
    when png.h is included from pngpriv.h.
2012-02-13 11:45:22 -06:00
Glenn Randers-Pehrson
864270e18f [libpng16] Fixed a memory overwrite bug in simplified read of RGB PNG with
Fixed a memory overwrite bug in simplified read of RGB PNG with
non-linear gamma Also bugs in the error checking in pngread.c and changed
quite a lot of the checks in pngstest.c to be correct; either correctly
written or not over-optimistic.  The pngstest changes are insufficient to
allow all possible RGB transforms to be passed; pngstest cmppixel needs
to be rewritten to make it clearer which errors it allows and then changed
to permit known inaccuracies.
2012-02-10 17:13:13 -06:00
John Bowler
aa725a375c [libpng16] Corrected estimate of error in libpng png_set_rgb_to_gray API.
The API is extremely inaccurate for sRGB conversions because it uses an 8-bit
intermediate linear value and it does not use the sRGB transform, so it
suffers from the known instability in gamma transforms for values close
to 0 (see Poynton).  The net result is that the calculation has a maximum
error of 14.99/255; 0.5/255^(1/2.2).  pngstest now uses 15 for the
permitted 8-bit error. This may still not be enough because of arithmetic
error.
2012-02-04 15:11:16 -06:00
Glenn Randers-Pehrson
5578c3719e [libpng16] Updated documentation about the simplified API. 2012-02-04 10:31:38 -06:00
Glenn Randers-Pehrson
ce3c7330ba [libpng16] Revised test-pngstest.sh to report PASS/FAIL for each image. 2012-02-04 07:35:34 -06:00
John Bowler
c8348f80d5 [libpng16] Fix character count in pngstest command in
projects/owatcom/pngstest.tgt
2012-02-03 21:40:07 -06:00
Glenn Randers-Pehrson
3449169622 [libpng16] Bump version to 1.6.0beta11 2012-02-03 02:01:02 -06:00
Glenn Randers-Pehrson
ead660ae1e [libpng16] Imported from libpng-1.6.0beta10.tar 2012-02-03 01:56:26 -06:00
Glenn Randers-Pehrson
04afaab56a [libpng16] Bump version to 1.6.0beta10 2012-02-03 00:39:02 -06:00
Glenn Randers-Pehrson
781a90b358 [libpng16] Updated list of test images in CMakeLists.txt 2012-02-02 15:48:55 -06:00
John Bowler
61d7058b5b [libpng16] Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests 2012-02-02 08:37:11 -06:00
Glenn Randers-Pehrson
db6850b389 [libpng16] Bump version to 1.6.0beta10 2012-02-01 15:41:43 -06:00
Glenn Randers-Pehrson
eda298bc01 [libpng] Note in CHANGES that Makefile.in and configure were reverted
to libpng-1.6.0beta05 versions.
2012-02-01 15:27:17 -06:00
Glenn Randers-Pehrson
0d4d0b4d32 [libpng16] Bump version to libpng-1.6.0beta09.tar 2012-01-31 22:58:08 -06:00
Glenn Randers-Pehrson
816ff328d2 [libpng16] Updated CHANGES and ANNOUNCE with new information about autogen.sh 2012-01-31 22:26:34 -06:00
John Bowler
3167541570 [libpng16] Fixed 'prefix' builds on clean systems. The generation of pngprefix.h
should not require itself.
2012-01-31 21:01:49 -06:00
John Bowler
42369ccd85 [libpng16] Added symbol prefixing that allows all the libpng external symbols
to be prefixed (suggested by Reuben Hawkins).  This is work in progress that
breaks some non-configure builds.
2012-01-31 07:28:13 -06:00
John Bowler
572b078d8c [libpng16] Cleaned up pngpriv.h to consistently declare all functions and data.
Also eliminated PNG_CONST_DATA, which is apparently not needed but we
can't be sure until it is gone.
2012-01-31 07:09:34 -06:00
John Bowler
40ca77a721 [libpng16] Improved pngstest speed by not doing redundant tests and add const
to the background parameter of png_image_finish_read. The --background
option is now done automagically only when required, so that commandline
option no longer exists.
2012-01-28 23:19:42 -06:00
John Bowler
05cbe5ae28 [libpng16] Moved automake options to AM_INIT_AUTOMAKE in configure.ac
Added color-tests, silent-rules (Not yet implemented in Makefile.am) and
version checking to configure.ac
2012-01-28 18:06:55 -06:00
Glenn Randers-Pehrson
5cdff4144e [libpng16] Divide pngstest into separate runs for basic and transparent images. 2012-01-28 01:07:34 -06:00
John Bowler
feecc898d9 [libpng16] Check libtool/libtoolize version number (2.4.2) in configure.ac 2012-01-28 00:48:08 -06:00
John Bowler
3a1d63dc69 [libpng16] Fixed Image::colormap misalignment in pngstest.c 2012-01-28 00:11:53 -06:00
Glenn Randers-Pehrson
573a51143a [libpng16] bump version to 1.6.0beta08 2012-01-27 22:37:58 -06:00
Glenn Randers-Pehrson
aaf1179ec1 [libpng16] Added two images to contrib/pngsuite (1-bit and 2-bit transparent
grayscale), and renamed three whose names were inconsistent with those in
pngsuite/README.txt.
2012-01-27 20:07:00 -06:00
John Bowler
a23f3dbcb6 [libpng16] Freeze libtool files in the 'scripts' directory.
This version of autogen.sh attempts to dissuade people from running it when
it is not, or should not, be necessary.
2012-01-27 10:24:21 -06:00
Glenn Randers-Pehrson
a12d2328b4 [libpng16] Set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms
(C. Yapp).
2012-01-26 17:39:05 -06:00
Glenn Randers-Pehrson
95a8a665e4 [libpng16] Conditionalize the install rules for MINGW and CYGWIN
in CMakeLists.txt
2012-01-25 16:46:05 -06:00
John Bowler
da2194c0d5 [libpng16] Rewrote autogen.sh to run autoreconf
instead of running tools one-by-one.
2012-01-25 08:30:24 -06:00
John Bowler
1eb2c48458 [libpng16] Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
(replaced with 3-character indentation).  Obsolete macros identified by
autoupdate have been removed; the replacements are all in 2.59 so
the pre-req hasn't been changed.  --enable-werror checks for support
for -Werror (or the given argument) in the compiler.  This mimics the
gcc configure option by allowing -Werror to be turned on safely; without
the option the tests written in configure itself fail compilation because
they cause compiler warnings.
2012-01-25 08:07:29 -06:00
John Bowler
8fb6c6a9b3 [libpng16] Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites.
2012-01-25 07:47:44 -06:00
Glenn Randers-Pehrson
99c7ad2904 [libpng16] bump version to 1.6.0beta07 2012-01-24 08:06:01 -06:00
John Bowler
5635573cfc [libpng16] Fixed Min/GW uninstall to remove libpng.dll.a 2012-01-23 23:01:27 -06:00
John Bowler
5bc90389bf [libpng16] Added color-map support to simplified API.
This is an initial version for review; the documentation has not yet been
updated.
2012-01-23 22:43:22 -06:00
Glenn Randers-Pehrson
2312167d51 [libpng16] Increased warning buffer in pngerror.c from 128 to 192. 2012-01-23 22:34:15 -06:00
John Bowler
04336ba10f [libpng16] Add palette support to the simplified APIs. This commit
changes some of the macro definitions in png.h, app code may need
corresponding changes.
2012-01-16 07:48:36 -06:00
John Bowler
00c6a9a62c [libpng16] Fix bug in pngerror.c: some long warnings were being improperly
truncated (bug introduced in libpng-1.5.3beta05).
2012-01-14 19:44:43 -06:00
Glenn Randers-Pehrson
0501c1c570 [libpng16] Describe new simplified API in the manual pages
and cleaned up some indentation problems.
2012-01-11 14:00:52 -06:00
Glenn Randers-Pehrson
d9fc0622a1 [libpng16] bump version to 1.6.0beta05 2011-12-29 21:13:53 -06:00
Glenn Randers-Pehrson
6e4184249c [libpng16] Imported from libpng-1.6.0beta04.tar 2011-12-29 21:01:01 -06:00
Glenn Randers-Pehrson
04ab33560f [libpng16] Revised contrib/pngminus/pnm2png.c to avoid warnings
when png_uint_32 and unsigned long are of different sizes.
2011-12-29 10:24:50 -06:00
John Bowler
fcd301daed [libpng16] Changed png_memcpy to C assignment where appropriate. Changed all
those uses of png_memcpy that were doing a simple assignment to assignments
(all those cases where the thing being copied is a non-array C L-value.)
Added some error checking to png_set_*() routines and removed the
reference to the non-exported function png_memcpy() from example.c. Fixed
the Visual C 64-bit build - it requires jmp_buf to be aligned, but it had
become misaligned.
2011-12-28 21:34:27 -06:00
Gilles Espinasse
f87ef8bcb5 [ibpng16] Moved AC_MSG_CHECKING([if libraries can be versioned]) later
to the proper location in configure.ac (Gilles Espinasse).
2011-12-26 13:10:01 -06:00
John Bowler
5d56786eff [libpng16] Implemented 'restrict' for png_info and png_struct.
Added new "png_structrp" typedef. Because of the
way libpng works both png_info and png_struct are always accessed via a
single pointer.  This means adding C99 'restrict' to the pointer gives
the compiler some opportunity to optimize the code.  This change allows that.
2011-12-24 09:12:00 -06:00
Glenn Randers-Pehrson
939310bac1 [libpng16] Update CHANGES and ANNOUNCE 2011-12-24 08:27:41 -06:00
John Bowler
29fca0d497 [libpng16] Enabled png_get_sCAL_fixed() if floating point APIs are enabled.
Previously it was disabled whenever internal fixed point arithmetic was
selected, which meant it didn't exist even on systems where FP was available
but not preferred.
2011-12-24 07:57:43 -06:00
John Bowler
df477e4652 [libpng16] Eliminated png_info_destroy. It is now used only in png.c
and only calls one other internal function and memset.
2011-12-24 07:47:02 -06:00
Glenn Randers-Pehrson
67ee8cee39 [libpng16] bump version to 1.6.0beta04 2011-12-22 08:34:26 -06:00
Glenn Randers-Pehrson
28d9339777 [libpng16] Imported from libpng-1.6.0beta03.tar 2011-12-22 08:14:43 -06:00
John Bowler
d332c67da7 [libpng16] Start-up code size improvements, error handler flexibility.
These changes alter how the tricky allocation of the initial png_struct and
png_info structures are handled. png_info is now handled in pretty much the
same way as everything else, except that the allocations handle NULL return
silently.  png_struct is changed in a similar way on allocation and on
deallocation a 'safety' error handler is put in place (which should never
be required).  The error handler itself is changed to permit mismatches
in the application and libpng error buffer size; however, this means a
silent change to the API to return the jmp_buf if the size doesn't match
the size from the libpng compilation; libpng now allocates the memory and
this may fail.  Overall these changes result in slight code size
reductions; however, this is a reduction in code that is always executed
so is particularly valuable.  Overall on a 64-bit system the libpng DLL
decreases in code size by 1733 bytes.  pngerror.o increases in size by
about 465 bytes because of the new functionality.
2011-12-21 17:36:12 -06:00
Glenn Randers-Pehrson
b74fb4e49c [libpng15] Bump version to libpng-1.6.0beta03 2011-12-21 08:43:21 -06:00
Glenn Randers-Pehrson
a6f369b150 [libpng16] Imported from libpng-1.6.0beta02.tar 2011-12-21 08:29:30 -06:00
John Bowler
681c1fc02a [libpng16] Correct configure builds where build and source directories are
separate.  The include path of 'config.h' was erroneously made relative in
pngvalid.c in libpng 1.5.7.
2011-12-18 06:20:22 -06:00
John Bowler
ba6fbc57ba [libpng16] Revised config.h handling; added bsconfig.h, deleted pngconfig.h 2011-12-17 14:21:54 -06:00
Glenn Randers-Pehrson
0b3634bcc4 [libpng16] Reverted install of pngconfig.h 2011-12-17 09:57:00 -06:00
Glenn Randers-Pehrson
efaeadaa86 [libpng16] Added pngconfig.h file. This indirect reference to config.h avoids
problems with build scripts that search for config.h and find an
inappropriate one in the standard paths.
2011-12-17 09:06:34 -06:00
Glenn Randers-Pehrson
c4f94cbd08 [libpng15] Bump version to libpng-1.6.0beta02 2011-12-15 13:11:25 -06:00
Glenn Randers-Pehrson
26aad85204 [libpng16] Imported from libpng-1.6.0beta01.tar 2011-12-15 10:31:17 -06:00
John Bowler
c4081f05c8 [libpng16] Updated CMakeLists.txt to account for relocated and new test programs. 2011-12-08 09:53:00 -06:00
John Bowler
eb26ee6602 [libpng16] Fixed race conditions in parallel make builds. With higher degrees
of parallelism during 'make' the use of the same temporary file names such
as 'dfn*' can result in a race where a temporary file from one arm of the
build is deleted or overwritten in another arm.  This changes the
temporary files for suffix rules to always use $* and ensures that the
non-suffix rules use unique file names.
2011-12-08 09:37:24 -06:00
John Bowler
12924f33bd [libpng16] Fixed minor memset/sizeof errors in pngvalid.c. 2011-12-05 12:36:04 -06:00
Glenn Randers-Pehrson
ec6d6fa51b [libpng16] Put CRLF line endings in the owatcom project files. 2011-12-03 20:26:27 -06:00
Glenn Randers-Pehrson
1f0eaa046c [libpng16] Revised pngconf.h to use " __declspec(restrict)" if MSC_VER >= 1400. 2011-12-01 21:45:34 -06:00
John Bowler
405a398b3e [libpng16] New 'tools' directory containing tools used to generate libpng code. 2011-11-28 23:57:45 -06:00
Glenn Randers-Pehrson
8888ea4479 [libpng16] Revised #if PNG_DO_BC blocks in png.c (use #ifdef and add #else) 2011-11-28 11:29:10 -06:00
Glenn Randers-Pehrson
0b26ac5dee [libpng16] Replaced an "#if" with "ifdef" in pngrtran.c 2011-11-28 10:38:41 -06:00
Glenn Randers-Pehrson
b72bc15e22 [libpng16] Added entry in CHANGES and ANNOUNCE about removing configure files. 2011-11-26 21:17:55 -06:00
John Bowler
baeb6d1e92 [libpng16] Added ANSI-C (C90) headers; eliminated the use of FAR/far. 2011-11-26 18:21:02 -06:00
Glenn Randers-Pehrson
7455cbf47e [libpng16] Update internal version numbering and SO-numbers 2011-11-24 14:49:01 -06:00
Glenn Randers-Pehrson
87fadd5eee [libpng16] Updated version numbering in png.h 2011-11-24 14:35:13 -06:00
Glenn Randers-Pehrson
5b79cd52f4 [libpng16] Moved pngvalid.c into contrib/libtests
and rebuilt Makefile.in and configure, etc., with autoconf-2.68
2011-11-24 10:56:20 -06:00
John Bowler
36082cffcd [libpng16] Added example programs for the new 'simplified' API. 2011-11-24 08:22:24 -06:00
Glenn Randers-Pehrson
15ea1fa337 [libpng15] Bump version to libpng-1.6.0alpha01 2011-11-23 15:34:03 -06:00
Glenn Randers-Pehrson
12fb29f951 [libpng15] Reject invalid compression flag, method when reading the iTXt chunk. 2011-11-22 11:53:49 -06:00
Glenn Randers-Pehrson
e7ad104ac3 [libpng15] Reject invalid compression flag when reading the iTXt chunk. 2011-11-22 11:03:20 -06:00
Glenn Randers-Pehrson
8e83631361 [libpng15] Added MINGW support to CMakeLists.txt 2011-11-21 12:37:13 -06:00
John Bowler
3706d730d1 [libpng15] Allow row_stride==0 to indicate default stride in simplified API 2011-11-21 10:28:06 -06:00
Glenn Randers-Pehrson
29fca795b9 [libpng15] Validate time settings passed to pngset()
and png_convert_to_rfc1123(). (Frank Busse).
2011-11-19 15:08:04 -06:00
Glenn Randers-Pehrson
bd2fa5def6 [libpng15] Removed "zTXt" from warning in generic chunk decompression function.
Bug report by Franke Busse
2011-11-19 13:28:08 -06:00
Glenn Randers-Pehrson
36251d3f76 [libpng15] Bump version to libpng-1.5.7beta05 2011-11-17 21:39:58 -06:00
Glenn Randers-Pehrson
d92c1fcd55 [libpng15] Imported from libpng-1.5.7beta04.tar 2011-11-17 21:39:49 -06:00
Glenn Randers-Pehrson
7e97c182a8 [libpng15] Bump version to libpng-1.5.7beta04 2011-11-16 23:27:38 -06:00
John Bowler
17878c6e65 [libpng15] Work around compilers that don't support declaration of const data.
Some compilers fault 'extern const' data declarations (because the data is
not initialized); this turns on const-ness only for compilers where
this is known to work.
2011-11-16 22:37:46 -06:00
Glenn Randers-Pehrson
c4253c4683 [libpng15] Updated CHANGES and ANNOUNCE with latest changes 2011-11-16 22:23:30 -06:00
John Bowler
4fa96a42f7 [libpng15] Fixes for C++ compilation using g++ When libpng source is compiled
using g++. The compiler imposes C++ rules on the C source; thus it
    is desireable to make the source work with either C or C++ rules
    without throwing away useful error information.  This change adds
    png_voidcast to allow C semantic (void*) cases or the corresponding
    C++ static_cast operation, as appropriate.
2011-11-16 16:39:16 -06:00
John Bowler
18c5cfafeb [libpng15] Multiple transform bug fixes plus a work-round for double gamma
correction.
2011-11-16 14:26:34 -06:00
John Bowler
ed9f84475d [libpng15] Update pngstest to remove compiler warnings, add to libpng tests 2011-11-16 11:52:27 -06:00
John Bowler
1eb188932b [libpng15] Added contrib/pngtests 2011-11-16 11:40:59 -06:00
Glenn Randers-Pehrson
8596468e51 [libpng15] Removed PNG_CONST from the sRGB table declarations
in pngpriv.h and png.c
2011-11-16 08:52:36 -06:00