Commit Graph

211 Commits

Author SHA1 Message Date
John Bowler
f2aacefb3f [libpng16] Added the ability for contrib/libtests/makepng.c to make a PNG with just one
color. This is useful for debugging pngstest color inaccuracy reports.
2012-11-13 19:18:53 -06:00
John Bowler
4314d63792 [libpng16] Fixed an intermittent SEGV in pngstest. 2012-11-02 14:08:29 -05:00
Glenn Randers-Pehrson
bb39dc545c [libpng16] Imported from libpng-1.6.0beta31.tar 2012-11-01 08:26:57 -05:00
John Bowler
ab1477d662 [libpng16] Made PNG_NO_READ_GAMMA switch off interfaces that depend on
READ_GAMMA.  Prior to 1.6.0 switching off READ_GAMMA did unpredictable things
to the interfaces that use it (specifically, png_do_background in 1.4 would
simply display composite for grayscale images but do composition
with the incorrect arithmetic for color ones). In 1.6 the semantic
of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
depends on it; this obliges people who set it to consider whether they
really want it off if they happen to use any of the interfaces in
question (typically most users who disable it won't).
2012-10-27 06:57:12 -05:00
John Bowler
f0fb1746b0 [libpng16] Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail). 2012-10-26 08:29:45 -05:00
John Bowler
e6b710cb3f [libpng16] Made pngvalid so that it will build outside the libpng source tree. 2012-10-25 19:15:55 -05:00
Glenn Randers-Pehrson
75fde9e99a [libpng16] Imported from libpng-1.6.0beta30.tar 2012-10-24 11:37:08 -05:00
John Bowler
e15b1e8136 [libpng16] Added pngunknown files that were omitted from previous checkin 2012-09-30 14:10:43 -05:00
Glenn Randers-Pehrson
6ae34790cc [libpng16] Added -DZ_SOLO to contrib/pngminim/*/makefile so they will work
with zlib-1.2.7
2012-09-27 18:52:30 -05:00
John Bowler
53f7051b1b [libpng] Fixed contrib/examples/png2png.c 2012-09-01 13:26:41 -05:00
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
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
Glenn Randers-Pehrson
810c99583b [libpng16] Fixed some spelling errors. 2012-08-15 23:20:47 -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
0f08665bfb [libpng16] Imported from libpng-1.6.0beta27.tar 2012-08-11 18:31:44 -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
John Bowler
134c5761fa [libpng16] Fix new leak when text compression is disabled. 2012-08-10 10:49:21 -05:00
Glenn Randers-Pehrson
46cb5109bd [libpng16] Moved scripts/chkfmt to contrib/tools. 2012-06-25 14:14:17 -05:00
Glenn Randers-Pehrson
fc58b17772 [libpng16] Imported from libpng-1.6.0beta25.tar 2012-06-16 14:42:22 -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
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
John Bowler
15f6fd3492 [libpng16] checked in contrib/libtests/pngstest.c which was omitted 2012-04-30 13:59:58 -05:00
Glenn Randers-Pehrson
96027d919f [libpng16] Imported from libpng-1.6.0beta20.tar 2012-03-29 06:38:51 -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
c1217ee280 [libpng16] Write the profile MD5s from checksum-icc (and the date) 2012-03-22 07:53:00 -05:00
John Bowler
51d1e2be1b [libng16] Added checksum-icc.c to contrib/libtests 2012-03-22 07:36:13 -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
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
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
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
John Bowler
1ffbe8c7c1 [libpng] Committed new contrib/libtests/makepng.c that was overlooked
in a recent patch.
2012-03-09 12:21:51 -06:00
John Bowler
d072048925 [libpng16] Correct pngvalid error message 2012-03-05 21:10:11 -06:00
John Bowler
7d4fbb2fbb [libpng16] Validate the zTXt strings in pngvalid. 2012-03-05 21:02:49 -06:00
John Bowler
e2ae0f2f2b [libpng16] Fix tarith argument parsing 2012-03-05 20:43:27 -06:00
John Bowler
d6cf3a3791 [libpng16] Added a print out of the maximum observed error to 'tarith ascii' 2012-03-05 20:41:19 -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
Glenn Randers-Pehrson
434801a39c [libpng16] Bump version to 1.6.0beta16 2012-03-02 22:52:13 -06:00
John Bowler
6f237b6bf0 [libpng16] Remove whitespace at end of lines 2012-03-02 13:20:52 -06:00
John Bowler
a0ddf0b5f2 [libpng16] Minor update to pngstest.c, chmod 755 gentests.sh 2012-03-02 06:56:33 -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
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
df44c4c4d9 [libpng16] Imported from libpng-1.6.0beta13.tar 2012-02-24 11:45:34 -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