Commit Graph

701 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
72855fb11e [libpng16] Made progressive reading of interlaced images consistent with the
behavior of the sequential reader and consistent with the manual. The
row_callback now receives the proper pass number and unexpanded rows,
when png_combine_row is not used or not built, by moving some code
out of the PNG_READ_INTERLACING_SUPPORTED blocks.
2014-04-13 21:27:25 -05:00
Glenn Randers-Pehrson
fa26eb1678 [libpng16] Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that
interferes with "blocky" expansion of sub-8-bit interlaced PNG files.
2014-04-06 09:06:37 -05:00
Glenn Randers-Pehrson
05670156f3 [libpng16] Use "if (value != 0)" instead of "if (value)" consistently. 2014-03-08 12:39:52 -06:00
Glenn Randers-Pehrson
71d23c4d6e [libpng16] Bump version to 1.6.11beta01 2014-03-06 21:09:24 -06:00
Glenn Randers-Pehrson
4df37bfa4f [libpng16] Imported from libpng-1.6.10.tar 2014-03-06 12:49:17 -06:00
Glenn Randers-Pehrson
b8f433417f [libpng16] Removed unreachable return statement after png_chunk_error()
in pngrutil.c
2014-02-27 12:12:54 -06:00
Glenn Randers-Pehrson
45625eceb4 [libpng16] Don't recognize known sRGB profiles as sRGB if they have been hacked,
but don't reject them and don't issue a copyright violation warning.
Simplified code in pngrutil.c that decides whether to warn about an
incorrect ancillary PLTE chunk.
2014-02-22 23:09:27 -06:00
Glenn Randers-Pehrson
eb657ae68f [libpng16] Added png_ptr->process_mode = PNG_READ_IDAT_MODE in
png_push_read_chunk after recognizing the IDAT chunk, which avoids an
infinite loop while reading a datastream whose first IDAT chunk is of
zero-length.
2014-02-22 21:59:40 -06:00
Glenn Randers-Pehrson
9c5a1baea5 [libpng16] Check for info_ptr == NULL early in png_read_end() so we don't need
to run all the png_handle_*() and depend on them to return if info_ptr == NULL.
This improves the performance of png_read_end(png_ptr, NULL) and makes
it more robust against future programming errors.
2014-02-17 09:12:52 -06:00
Glenn Randers-Pehrson
9eec159ab0 [libpng16] Imported from libpng-1.6.10beta01.tar 2014-02-09 13:00:23 -06:00
John Bowler
414d7b5f7d [libpng16] Backport recent changes from libpng-1.7.0beta30 and beta31. 2014-02-06 11:39:25 -06:00
Glenn Randers-Pehrson
be3977de2c [libpng16] Imported from libpng-1.6.8.tar 2013-12-19 09:11:01 -06:00
Glenn Randers-Pehrson
3f8a2ed600 [libpng16] Removed or marked PNG_UNUSED some harmless "dead assignments"
reported by clang scan-build.
2013-11-25 10:38:21 -06:00
John Bowler
aaf1bb1ae1 [libpng16] Updated "last changed" dates 2013-11-22 15:40:52 -06:00
Glenn Randers-Pehrson
113213416c [libpng16] Conditionally compile some unused functions reported by -Wall
in pngminim.
2013-11-18 20:12:24 -06:00
Glenn Randers-Pehrson
0ea69cdfa9 [libpng16] Imported from libpng-1.6.7.tar 2013-11-14 12:28:05 -06:00
John Bowler
0441ff62e7 [libpng16] Remove spurious "#ifdef PNG_sRGB_SUPPORTED" from pngrutil.c 2013-10-04 19:28:48 -05:00
Glenn Randers-Pehrson
b3721757a0 [libpng16] Catch up with some recent changes that did not get merged. 2013-09-30 13:56:44 -05:00
John Bowler
8f381901e3 [libpng16] Avoid up-cast warnings in pngvalid.c. On ARM the alignment
requirements of png_modifier are greater than that of png_store and as a
consequence compilation of pngvalid.c results in a warning about increased
alignment requirements because of the bare cast to (png_modifier*). The code
is safe, because the pointer is known to point to a stack allocated
png_modifier, but this change avoids the warning.

  Fixed default behavior of ARM_NEON_API. If the ARM NEON API option was
    compiled without the CHECK option it defaulted to on, not off.

  Check user callback behavior in pngunknown.c. Previous versions compiled
    if SAVE_UNKNOWN was not available but did nothing since the callback
    was never implemented.

  Merged pngunknown.c with 1.7 version and back ported 1.7 improvements/fixes
2013-09-30 11:24:17 -05:00
John Bowler
15a80443de [libpng16] Allow HANDLE_AS_UNKNOWN to work when other options are configured
off. Also fixed the pngminim makefiles to work when $(MAKEFLAGS) contains stuff
which terminates the make options (as by default in recent versions of Gentoo).
2013-09-21 10:06:32 -05:00
Glenn Randers-Pehrson
6f8f004fe1 [libpng16] Added #ifdef PNG_READ_SUPPORTED/endif around the
png_chunk_unknown_handling() function, and restored the unknown-chunk
handling code from libpng-1.6.6.

Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net

Glenn R-P
2013-09-20 15:40:15 -05:00
Glenn Randers-Pehrson
873f16fe2f [libpng16] Reverted the change to unknown handling #defines; the change
breaks 'NOREAD' builds.
2013-09-20 14:28:50 -05:00
Glenn Randers-Pehrson
7ae451f527 [libpng16] Bump version to 1.6.7beta01 2013-09-16 11:47:17 -05:00
Glenn Randers-Pehrson
391459424e [libpng16] Imported from libpng-1.6.6.tar 2013-09-16 10:39:16 -05:00
Glenn Randers-Pehrson
53ae7dc514 [libpng16] Imported from libpng-1.6.5.tar 2013-09-14 09:44:09 -05:00
Glenn Randers-Pehrson
cd6a3ef31f [libpng16] Bump version to 1.6.5beta01 2013-09-12 08:02:22 -05:00
Glenn Randers-Pehrson
209d3eb5c6 [libpng16] Imported from libpng-1.6.4.tar 2013-09-12 07:27:14 -05:00
Glenn Randers-Pehrson
8c49ddcf56 [libpng16] Imported from libpng-1.6.4beta02.tar 2013-08-29 19:39:34 -05:00
Glenn Randers-Pehrson
324402044f [libpng16] Imported from libpng-1.6.4beta01.tar 2013-08-21 18:45:24 -05:00
Glenn Randers-Pehrson
685d79e27a [libpng16] Delay calling png_init_filter_functions() until a row with nonzero
filter is found.
2013-08-20 21:15:31 -05:00
Glenn Randers-Pehrson
847e9efb66 [libpng16] Imported from libpng-1.6.3.tar 2013-07-17 19:13:23 -05:00
Glenn Randers-Pehrson
db56fa18c2 [libpng16] Revised "/*SAFE*/" comment in pngrutil.c 2013-07-15 10:09:54 -05:00
Glenn Randers-Pehrson
bc8e40d611 [libpng16] Added "/* SAFE */" comments in pngrutil.c and pngrtran.c
where warnings may be erroneously issued by code-checking applications.
Revised manual about changes in iTXt chunk handling made in libpng-1.6.0.
2013-07-15 08:44:53 -05:00
Glenn Randers-Pehrson
56a1a66656 [libpng16] Imported from libpng-1.6.3beta09.tar 2013-06-27 18:01:30 -05:00
John Bowler
9afb90f885 [libpng16] Attempt to detect configuration issues with pngdeflate,
which requires both the correct libpng and the correct zlib to function
correctly.
2013-05-08 14:21:46 -05:00
John Bowler
294d0b8408 [libpng16] Detect wrong libpng versions linked to pngdeflate, which currently
only works with libpng versions that can be made to reliably fail when
    the deflate data contains an out-of-window reference.  This means only
    1.6 and later.
  Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning
    message which it is easier to work round than ignore.
2013-05-08 08:56:45 -05:00
Glenn Randers-Pehrson
62c6fbbd29 [libpng16] Check that PNG_MAXIMUM_INFLATE_WINDOW is defined before using it. 2013-05-07 23:16:06 -05:00
John Bowler
0c7ac064d3 [libpng16] Added an option to force maximum window size for inflating.
For inflate, reverted previous fixes.
Added fixitxt and pngdeflate to the built programs and removed warnings
from the source code and timepng that are revealed as a result.  Fixed
fixitxt when the chunk length is more than 65535 (untested, no test case).
2013-05-07 21:59:05 -05:00
Glenn Randers-Pehrson
db67cba8d4 [libpng16] Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
2013-05-07 14:31:35 -05:00
Glenn Randers-Pehrson
2fd3434fa4 [libpng16] Imported from libpng-1.6.3beta04.tar 2013-05-06 09:55:18 -05:00
Glenn Randers-Pehrson
127b08a265 [libpng16] Calculate our own zlib windowBits when decoding rather than
trusting the CMF bytes in the PNG datastream.
2013-05-05 22:13:47 -05:00
Glenn Randers-Pehrson
399430dac2 [libpng16] Update "last changed" comments. 2013-04-25 09:52:00 -05:00
Glenn Randers-Pehrson
3f677d1c65 [libpng16] Bump version to 1.6.3beta01 2013-04-25 09:19:04 -05:00
Glenn Randers-Pehrson
809355b4aa [libpng16] Imported from libpng-1.6.2.tar 2013-04-25 07:29:41 -05:00
Glenn Randers-Pehrson
6e1c74b39b [libpng16] Imported from libpng-1.6.2rc03.tar 2013-04-22 11:36:05 -05:00
Glenn Randers-Pehrson
67a289ffa9 [libpng16] Fixed some spelling/typos 2013-04-19 19:03:34 -05:00
Glenn Randers-Pehrson
7ef0c46488 [libpng16] Updated "last changed" comments. 2013-04-18 07:25:45 -05:00
John Bowler
43c07e1b48 [libpng16] Fixed incorrect warning of excess deflate data. End condition - the
warning would be produced if the end of the deflate stream wasn't read
in the last row.  The warning is harmless.
2013-04-07 21:33:30 -05:00
Glenn Randers-Pehrson
5087805e7c [libpng16] Imported from libpng-1.6.1.tar 2013-03-27 20:36:57 -05:00
John Bowler
caa3f296df [libpng16] Eliminated another warning from the Intel C compiler. 2013-03-10 21:40:27 -05:00
John Bowler
2286a7cef4 [libpng16] Eliminated a warning from the Intel C compiler. The warning is
technically valid, although a reasonable treatment of division would
show it to be incorrect.
2013-03-10 21:35:35 -05:00
Glenn Randers-Pehrson
8c87dc88d6 [libpng16] Imported from libpng-1.6.1beta06.tar 2013-03-04 17:56:46 -06:00
Glenn Randers-Pehrson
4ea113b7f0 [libng16] Reverted recent change that eliminated a warning about storing
an unhandled chunk.
2013-03-02 16:03:45 -06:00
Glenn Randers-Pehrson
871b1d0fab [libpng16] Bump version to 1.6.1beta05 2013-03-02 15:03:15 -06:00
Glenn Randers-Pehrson
f3af706c2a [libpng16] Imported from libpng-1.6.0beta05.tar 2013-03-01 21:38:03 -06:00
Glenn Randers-Pehrson
96cf4bde0e [libpng16] Fixed bug introduced in libpng-1.6.0beta28 that causes libpng to
handle chunks even when they have been tagged PNG_HANDLE_CHUNK_NEVER.
2013-03-01 20:04:06 -06:00
Glenn Randers-Pehrson
adb9613699 [libpng16] Imported from libpng-1.6.1beta02.tar 2013-02-18 21:25:47 -06:00
Glenn Randers-Pehrson
3b8e7e869d [libpng16] Imported from libpng-1.6.1beta01.tar 2013-02-16 10:48:29 -06:00
Glenn Randers-Pehrson
5851280929 [libpng16] Imported from libpng-1.6.0beta37.tar 2013-01-10 12:20:59 -06:00
John Bowler
6cf32b460f [libpng16] Rearranged the ARM-NEON optimizations: Isolated the machine specific
code to the hardware subdirectory and added comments to pngrutil.c so that
implementors of other optimizations know what to do.
2012-12-15 07:55:54 -06:00
John Bowler
f758d6c813 [libpng16] Rearranged the ARM-NEON optimizations: Isolated the machine specific
code to the hardware subdirectory and added comments to pngrutil.c so that
implementors of other optimizations know what to do.
2012-12-13 11:26:50 -06:00
Glenn Randers-Pehrson
5b9a28f2b8 [libpng16] Trivial editing of commentary in pngrutil.c 2012-11-25 12:46:24 -06:00
John Bowler
520803d57e [libpng16] Removed non-working ICC profile support code. There was too much
code for too little gain; implementing full ICC color correction is maybe
desireable but is left up to applications.
2012-11-01 08:12:47 -05:00
John Bowler
f8dfd123e2 [libpng16] Changed ICC profile support to allow use of an external color
management system (CMS). In practice it is not possible to obtain cHRM
information reliably using just the end-point tags because they do not exist
in the vast majority of profiles.  Instead it is necessary to run the endpoints
through the ICC colorimetric intent transform (as described in the v4
spec).  Since this is likely to be too much code inside libpng for too
little gain (it implies a fairly complete CMS implementation) the code
has been changed to allow an external CMS to be used.  This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
2012-10-25 19:30:02 -05:00
John Bowler
b98681b49a [libpng16] Improved ICC profile handling including cHRM chunk generation and
fixed Cygwin+MSVC build errors. The ICC profile handling now includes more
checking.  Several errors that caused rejection of the profile are now
handled with a warning in such a way that the invalid profiles will be
read by default in release (but not pre-RC) builds but will not be
written by default.  The easy part of handling a cHRM chunk is written,
where the ICC profile contains the required data.  The more difficult
part plus guessing a gAMA value requires code to pass selected RGB values
through the profile.
2012-09-04 16:35:20 -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
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
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
3744f94fd1 [libpng16] Removed trailing blanks 2012-08-10 19:22:53 -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
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
Glenn Randers-Pehrson
4430b91363 [libpng16] Restore info_ptr members that were deleted by the previous
patch; they are needed by png_set_IHDR() for both read and write.  Fix
some ifdefs that caused the contrib/pngminim/ applications to not compile.
2012-08-09 22:24:04 -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
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
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
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
f7677a348e [libpng16] Use uLong 64 bits for crc32 return in profile check 2012-03-21 23:52:41 -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
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
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
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
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
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
6f237b6bf0 [libpng16] Remove whitespace at end of lines 2012-03-02 13:20:52 -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
1531bd61a0 [libpng16] Updated copyright year to 2012 2012-01-01 14:45:04 -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
67ee8cee39 [libpng16] bump version to 1.6.0beta04 2011-12-22 08:34:26 -06:00
John Bowler
40b2603687 [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-22 08:09:15 -06:00
Glenn Randers-Pehrson
13831bc06e [libpng16] Updated "last changed" dates 2011-12-21 08:28:28 -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
12fb29f951 [libpng15] Reject invalid compression flag, method when reading the iTXt chunk. 2011-11-22 11:53:49 -06:00
Glenn Randers-Pehrson
8500b7720b [libpng15] Also allow uncompressed iTXt 2011-11-22 11:40:39 -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
8501129c17 [libpng15] Removed some "#if 0" blocks of test code that remained in pngrutil.c 2011-11-21 11:21:29 -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
Mans Rullgard
e7acc6ac3d [libpng15] Added run-time detection of ARM/NEON support 2011-11-16 13:48:18 -06:00
John Bowler
e6fb691c49 [libpng15] Fixes to alpha swap on read, simplified write and filler add code 2011-11-08 21:35:16 -06:00
John Bowler
7875d534cb [libpng15] Simplified read/write API initial version; basic read/write tested
on a variety of images, limited documentation (in the header file.)
2011-11-07 22:33:49 -06:00
John Bowler
fcc0263191 [libpng15] Paeth filter speed improvements from work by Siarhei Siamashka. This
changes the 'Paeth' reconstruction function to improve the GCC code
generation on x86. The changes are only part of the suggested ones;
just the changes that definitely improve speed and remain simple.
The changes also slightly increase the clarity of the code. In a
2011-11-03 18:31:00 -05:00
John Bowler
aff44028ba [libpng15] Fixed bug in pngvalid on early allocation failure; fixed type cast
in pngmem.c; pngvalid would attempt to call png_error() if the allocation
of a png_struct or png_info failed. This would probably have led to a
crash.  The pngmem.c implementation of png_malloc() included a cast
to png_size_t which would fail on large allocations on 16-bit systems.
2011-11-03 16:11:08 -05:00
Mans Rullgard
d3a94802d8 [libpng15] Added support for ARM processor (Mans Rullgard) 2011-11-03 00:47:55 -05:00
Glenn Randers-Pehrson
2b7d730e27 [libpng15] Bump version to libpng-1.5.7beta01 2011-11-02 23:14:13 -05:00
Glenn Randers-Pehrson
bc6726bc04 [libpng15] Imported from libpng-1.5.6.tar 2011-11-02 22:48:36 -05:00
Glenn Randers-Pehrson
1876366b17 [libpng15] Fixed a spelling error. 2011-10-27 22:09:22 -05:00
John Bowler
92ef313c77 [libpng15] Fixed compiler warnings with Intel and MSYS compilers.
The logical shift fix for Microsoft Visual C is required by other compilers,
so this enables that fix for all compilers when using compile-time constants.
Under MSYS 'byte' is a name declared in a system header file, so we
changed the name of a local variable to avoid the warnings that result.
2011-10-27 19:53:14 -05:00
Glenn Randers-Pehrson
cb75699dff [libpng15] Renamed the LSR() macro to PNG_LSR() and added PNG_LSL() macro. 2011-10-27 16:59:03 -05:00
Glenn Randers-Pehrson
8db19980fa [libpng15] Add leading zero to some 1-digit hex constants (0xf -> 0x0f). 2011-10-27 16:17:24 -05:00
Glenn Randers-Pehrson
ef02d563a3 [libpng15] Added LSR() macro to defend against buggy compilers that evaluate
non-taken code branches and complain about out-of-range shifts.
2011-10-27 12:05:58 -05:00
Glenn Randers-Pehrson
93254f66fc [libpng15] Imported from libpng-1.5.6rc01.tar 2011-10-26 08:48:23 -05:00
Mans Rullgard
1c42276a39 [libpng15] New png_struct member png_ptr->old_prev_row 2011-10-17 16:52:19 -05:00
Mans Rullgard
c9e27d026d [libpng15] Made png_ptr->prev_row an aligned pointer into png_ptr->big_prev_row
and removed a redundant assignment (Mans Rullgard).
2011-10-17 15:25:03 -05:00
John Bowler
fb5b3ac013 [libpng15] Prevent libpng overwriting unused bits at the end of the image when
is not byte aligned, while reading. Prior to libpng-1.5.6 libpng would
overwrite the end of the image if the row width is not an exact multiple
of 8 bits and the image is not interlaced.
2011-10-16 22:52:56 -05:00
John Bowler
4e68aa7e40 [libpng15] Further optimization of png_combine_row() in the interlaced case. 2011-10-11 16:01:33 -05:00
John Bowler
8be28e3eb6 [libpng15] Optimized png_combine_row() when rows are aligned This gains a
small percentage for 16-bit and 32-bit pixels in the typical case where the
output row buffers are appropriately aligned. The optimization was not
previously possible because the png_struct buffer was always misaligned.
2011-10-07 18:36:37 -05:00
John Bowler
ac8375d000 [libpng15] Align png_struct::row_buf - previously it was always unaligned,
caused by a bug in the code that attempted to align it; the code needs to
subtract one from the pointer to take account of the filter byte prepended to
each row.
2011-10-06 22:27:16 -05:00
Glenn Randers-Pehrson
fa7d7934f6 [libpng15] Replaced a short but frequently-used memcpy() in png_combine_row()
with a loop.
2011-10-05 21:09:22 -05:00
Glenn Randers-Pehrson
435cf87469 [libpng15] Bump version to libpng-1.5.6beta04 2011-10-05 16:42:16 -05:00
Glenn Randers-Pehrson
bb5cb1476b [libpng15] Bump version to libpng-1.5.6beta02 2011-09-22 12:48:19 -05:00
Glenn Randers-Pehrson
115020d985 [libpng15] Imported from libpng-1.5.6beta01.tar 2011-09-22 09:51:23 -05:00
Glenn Randers-Pehrson
3e2263abf2 [libpng15] Imported from libpng-1.5.5.tar 2011-09-22 08:45:04 -05:00
John Bowler
751561218f [libpng15] Constant changes for 64-bit compatibility (removal of L suffixes).
The 16-bit cases still use "L" as we don't have a 16-bit test system.
2011-09-09 17:21:44 -05:00
John Bowler
f3f7e14727 [libpng15] Fixed 64-bit compilation errors (gcc). The errors fixed relate
to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world.  This produces potential truncation errors which the
compiler correctly flags.
2011-09-09 07:32:37 -05:00
John Bowler
736f40f459 [devel] Fixes to rgb_to_gray and cHRM XYZ APIs 2011-08-25 16:19:44 -05:00
Glenn Randers-Pehrson
03d6b482b5 [devel] Imported from libpng-1.5.5beta03.tar 2011-07-27 12:41:15 -05:00
John Bowler
a5bcab7854 [devel] Enabled compilation with g++ compiler. This compiler does not
recognize the file extension, so it always compiles with C++ rules.  Made minor
changes to pngrutil.c to cast results where C++ expects it but C does not.
2011-07-14 23:02:11 -05:00
Glenn Randers-Pehrson
d404b6d488 [devel] Imported from libpng-1.5.4.tar 2011-07-07 06:26:30 -05:00
John Bowler
8d261262d9 [devel] Fixed pngvalid, simplified macros, added checking for 0 in sCAL. 2011-06-18 13:37:11 -05:00
Glenn Randers-Pehrson
ef217b76a3 [devel] Updated comments that mention 1.5.3; changed them to 1.5.4. 2011-06-15 12:58:27 -05:00
John Bowler
550bab03fb [devel] Removed the ACCURATE and LEGACY options (they are no longer useable)
Fixed some compiliation problems with scaling options.
2011-06-14 06:17:26 -05:00
Glenn Randers-Pehrson
254a513fd1 [devel] Fixed png_handle_sCAL which is broken in 1.5 2011-06-10 17:45:48 -05:00
John Bowler
9994f25733 [devel] pngvalid: add memory overwrite and palette image checks
also minor cleanup in the libpng code itself (pngrtran.c and pngrutil.c) and some
extra checking there.
2011-05-15 18:52:39 -05:00
John Bowler
cb0b29631f [devel] Documented png_set_alpha_mode(), other changes in libpng.3 and
libpng-manual.txt.
  The cHRM chunk now sets the defaults for png_set_rgb_to_gray() (when negative
    parameters are supplied by the caller), while in the absence of cHRM
    sRGB/Rec 709 values are still used.
  The bKGD chunk no longer overwrites the background value set by
    png_set_background(), allowing the latter to be used before the file
    header is read. It never performed any useful function to override
    the default anyway.

Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
2011-05-12 21:48:29 -05:00
John Bowler
88b77cc6f3 [devel] Remove png_snprintf, add formatted warning messages.
This change adds internal APIs to allow png_warning messages to have parameters
 without requiring the host OS to implelment snprintf.  As a side effect the
 dependency of the RFC1132 code on stdio is removed and PNG_NO_WARNINGS does
 actually work now.
2011-05-05 06:49:55 -05:00
John Bowler
4a12f4a22a [devel] Cleanup of conditional compilation code and of background/gamma
handling. Internal changes only except for a new option to avoid compiling
in the png_build_grayscale_palette API (which is not used at all internally.)
The main change is to move the transform tests (READ_TRANSFORMS,
WRITE_TRANSFORMS) up one level to the caller of the APIs.
2011-04-17 18:34:22 -05:00
Glenn Randers-Pehrson
b75b24103d [devel] Added some whitespace in comments. 2011-04-16 19:35:05 -05:00
Glenn Randers-Pehrson
65a24d0638 [devel] Add comment in pngtest.c about setting zlib strategy for text
compression
2011-04-01 20:41:53 -05:00
Glenn Randers-Pehrson
5975f31ff0 [devel] Added PNG_READ_COMPRESSED_TEXT_SUPPORTED macro. 2011-04-01 13:15:36 -05:00
Glenn Randers-Pehrson
dcc3505c7b [devel] Imported from libpng-1.5.2.tar 2011-03-31 11:29:05 -05:00
Glenn Randers-Pehrson
f27592a0cd [devel] Fixed a long-standing bug in png_handle_sPLT() when
PNG_NO_POINTER_INDEXING is defined.
2011-03-21 18:05:40 -05:00
Glenn Randers-Pehrson
cad6798a8c [devel] Imported from libpng-1.5.2beta01.tar 2011-02-13 06:13:39 -06:00
John Bowler
4d56296443 [devel] Implement expansion to 16 bits 2011-02-12 09:01:20 -06:00
Glenn Randers-Pehrson
3d3aae1697 --amend [devel] Imported from libpng-1.5.1.tar 2011-02-02 23:00:03 -06:00
John Bowler
168a433352 [devel] Eliminate more GCC shadow warnings 2011-01-16 19:32:22 -06:00
Glenn Randers-Pehrson
b764c60a12 [devel] Imported from libpng-1.5.1beta03.tar 2011-01-14 21:20:20 -06:00
Glenn Randers-Pehrson
5c92dec542 [devel] The wrong pngrutil.c (version 1.4.1) was checked in. 2011-01-07 18:28:47 -06:00
Glenn Randers-Pehrson
20788d3b90 [devel] Add typecasts to stifle compiler warnings in pngrutil.c 2011-01-06 09:01:04 -06:00
Glenn Randers-Pehrson
f5ea1b7095 [devel] Imported from libpng-1.5.0.tar 2011-01-06 06:45:07 -06:00
Glenn Randers-Pehrson
64b863cd2a [devel] Update copyright year and bump to version libpng-1.5.0rc07 2011-01-04 09:58:33 -06:00
John Bowler
660c6e4d70 [devel] Fixed interlace image handling and add test cases (John Bowler) 2010-12-19 06:22:23 -06:00
Glenn Randers-Pehrson
d546f4399f [devel] Added the private PNG_UNUSED() macro definition in pngpriv.h.
(adapted from the UNUSED() macro in pngvalid.c by John Bowler)
2010-12-04 20:41:36 -06:00
Glenn Randers-Pehrson
b3edc73afa [devel] Changes to remove gcc warnings (John Bowler)
Certain optional gcc warning flags resulted in warnings in libpng code.
With these changes only -Wconversion and -Wcast-qual cannot be turned on.
Changes are trivial rearrangements of code.  -Wconversion is not possible
for pngrutil.c (because of the widespread use of += et al on variables
smaller than (int) or (unsigned int)) and -Wcast-qual is not possible
with pngwio.c and pngwutil.c because the 'write' callback and zlib
compression both fail to declare their input buffers with 'const'.
2010-11-21 14:06:41 -06:00
Glenn Randers-Pehrson
105c416007 [devel] Added comment in pngrutil.c about some extra parentheses. 2010-11-20 22:59:47 -06:00
Glenn Randers-Pehrson
a581556b17 [master] Revised png_get_uint_32, png_get_int_32, png_get_uint_16 (Cosmin)
Moved reading of file signature into png_read_sig (Cosmin)
Fixed atomicity of chunk header serialization (Cosmin)
Added test for io_state in pngtest.c (Cosmin)
Added "#!/bin/sh" at the top of contrib/pngminim/*/gather.sh scripts.
2010-11-20 21:48:29 -06:00
Glenn Randers-Pehrson
ccadcae40b [devel] Added whitespace in pngrutil.c, pngwtran.c, and pngwutil.c 2010-10-23 17:29:13 -05:00
Glenn Randers-Pehrson
33893095b5 [devel] Used a consistent structure for the pngget.c functions.
added some whitespace in pngrio.c and pngrutil.c
2010-10-23 13:20:18 -05:00
Glenn Randers-Pehrson
f197d6d0f6 [devel] Imported from libpng-1.5.0beta52.tar 2010-10-15 19:28:22 -05:00
Glenn Randers-Pehrson
f0eda4e8d7 [devel] Imported from libpng-1.5.0beta51.tar 2010-10-15 15:08:42 -05:00
Glenn Randers-Pehrson
7e1fabe2f7 [devel] Imported from libpng-1.5.0beta50.tar 2010-10-14 07:35:45 -05:00
Glenn Randers-Pehrson
bc363eca41 [devel] Removed some unwanted spaces 2010-10-12 21:17:00 -05:00
Glenn Randers-Pehrson
d233287325 [devel] Removed space after (type cast). 2010-10-12 19:19:28 -05:00
Glenn Randers-Pehrson
c127057f7d [devel] Suppressed a compiler warning in png_handle_sPLT(). 2010-10-12 12:47:48 -05:00
Glenn Randers-Pehrson
1b49a71df4 [devel] Imported from libpng-1.5.0beta49.tar 2010-10-07 21:01:17 -05:00
Glenn Randers-Pehrson
83b4fc4af4 [devel] Imported from libpng-1.5.0beta48.tar 2010-10-04 23:06:09 -05:00
Glenn Randers-Pehrson
b0876110ca [devel] Fixed problem with symbols creation in Makefile.am which was assuming
that CCP writes to standard output by default (Martin Banky).
2010-10-04 22:24:14 -05:00
Glenn Randers-Pehrson
bcb3aac3c5 [devel] Fixed a number of problems with 64-bit compilation reported by Visual
Studio 2010 (John Bowler).
2010-09-10 22:05:27 -05:00
Glenn Randers-Pehrson
39515c9ee0 [devel] Imported from libpng-1.5.0beta46.tar 2010-08-28 06:25:21 -05:00
Glenn Randers-Pehrson
a7119547e2 [devel] Imported from libpng-1.5.0beta45.tar 2010-08-26 07:10:48 -05:00
Glenn Randers-Pehrson
9b362b1e4f [devel] Bump to version libpng-1.5.0beta45 2010-08-24 09:05:02 -05:00
Glenn Randers-Pehrson
67439c4701 [devel] Addressed various issues identified by GCC, mostly signed/unsigned
and shortening problems on assignment but also a few difficult to optimize
(for GCC) loops (John Bowler).
2010-08-19 07:01:09 -05:00
Glenn Randers-Pehrson
e600c51355 [devel]Made all API functions that have const arguments and constant string
literal pointers declare them (John Bowler).
Many APIs did not change their arguments but were not declared using
PNG_CONST.  This change corrects this.  In a few cases APIs that return
constant string literal pointers have also been changed to declare this.
Unlike the argument change this may require app changes; however the
results could never be written to (the app would crash on some platforms
where strings are not writable), so this seems advisable.
2010-08-18 07:25:46 -05:00
Glenn Randers-Pehrson
363f96e717 [devel] Imported from libpng-1.5.0beta41.tar 2010-08-11 09:04:31 -05:00
Glenn Randers-Pehrson
836fe66e24 [devel] Imported from libpng-1.5.0beta40.tar 2010-08-06 06:57:32 -05:00
Glenn Randers-Pehrson
2c700f970c [devel] Imported from libpng-1.5.0beta39.tar 2010-08-02 08:02:00 -05:00
Glenn Randers-Pehrson
3df324d845 [devel] Expanded TAB characters, again. 2010-07-31 13:45:04 -05:00
Glenn Randers-Pehrson
48dc6ebf5c [devel] Revised png_get_int_16() to be similar to png_get_int_32(). 2010-07-31 07:09:58 -05:00
Glenn Randers-Pehrson
4009a76e97 [devel] Implemented remaining "_fixed" functions and corrected warnings
that were recently introduced, mostly resulting from
safe but uncast assignments to shorter integers.  Also added a zlib
VStudio release library project because the latest zlib Official Windows
build does not include such a thing.
2010-07-31 06:34:36 -05:00
Glenn Randers-Pehrson
4eb18e9ca2 [devel] Imported from libpng-1.5.0beta37.tar 2010-07-30 14:47:53 -05:00
Glenn Randers-Pehrson
53c7502663 [devel] Added a typecast in png_get_int_32() to avoid compiler warning. 2010-07-30 09:58:34 -05:00
Glenn Randers-Pehrson
233357ef0e [devel] Fixed some spelling and indentation. 2010-07-29 21:49:38 -05:00
Glenn Randers-Pehrson
2be8b64af2 [devel] Update documentation 2010-07-29 19:09:18 -05:00
Glenn Randers-Pehrson
29034c5076 [devel] Expanded the new TAB characters. 2010-07-29 17:58:49 -05:00
Glenn Randers-Pehrson
31aee0d0c0 [devel]
Fixed point APIs are now supported throughout (no missing APIs).
  Internal fixed point arithmetic support exists for all internal floating
    point operations.
  sCAL validates the floating point strings it is passed.
  Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2
  Two new APIs exist to get the number of passes without turning on the
    PNG_INTERLACE transform and to get the number of rows in the current
    pass.
  A new test program, pngvalid.c, validates the gamma code.
  Errors in the 16 bit gamma correction (overflows) have been corrected.
  cHRM chunk testing is done consistently (previously the floating point
    API bypassed it, because the test really didn't work on FP, now the test
    is performed on the actual values to be stored in the PNG file so it
    works in the FP case too.)
  Most floating point APIs now simply call the fixed point APIs after
    converting the values to the fixed point form used in the PNG file.
  The standard headers no longer include zlib.h, which is currently only
    required for pngstruct.h and can therefore be internal.
  (Patches by John Bowler)
2010-07-29 17:39:14 -05:00
Glenn Randers-Pehrson
915bab5fc7 [devel] Bump to version libpng-1.5.0beta35 2010-07-24 08:25:31 -05:00
Glenn Randers-Pehrson
d9d4cecaad [devel] Removed some newly-added TAB characters. 2010-07-12 07:12:09 -05:00
Glenn Randers-Pehrson
39a8bb71d3 [devel] Imported from libpng-1.5.0beta34.tar 2010-07-12 06:45:23 -05:00
Glenn Randers-Pehrson
8f9de7acbd [devel] Bump back to version libpng-1.5.0beta34 2010-07-06 07:46:10 -05:00
Glenn Randers-Pehrson
289500ab8d [devel] Imported from libpng-1.5.0beta33.tar 2010-06-28 20:21:22 -05:00
Glenn Randers-Pehrson
6cac43c974 [devel] Changed char *msg to PNG_CONST char *msg in pngrutil.c 2010-06-26 12:33:17 -05:00
Glenn Randers-Pehrson
a272d8fe3d [devel] Made FIXED and FLOATING options consistent in the APIs they enable
and disable.  Corrected scripts/options.awk to handle both command line
options and options specified in the .dfa files.
2010-06-25 21:45:31 -05:00
Glenn Randers-Pehrson
4db344230d [devel] Imported from libpng-1.5.0beta32.tar 2010-06-25 20:18:44 -05:00
Glenn Randers-Pehrson
821b7106b2 [devel] Imported from libpng-1.5.0beta31.tar 2010-06-25 20:06:43 -05:00
Glenn Randers-Pehrson
ef3831a1fe [devel] Imported from libpng-1.5.0beta30.tar 2010-06-25 20:06:40 -05:00