32 Commits

Author SHA1 Message Date
John Bowler
92e8581f12 api(PNGv3): Add support for mDCV and cLLI
This adds APIs to get/set the two remaining new PNG-v3 colour space
chunks.  The mDCV API matches that of cHRM.  Both chunks support
floating point APIs (all values in the two chunks are real numbers).

Both chunks have a new encoded type, a four-digit-precision fixed-point
number, which cannot be represented in the existing `png_fixed_point`
type, so a `png_uint_32` is used.

Test examples for cICP, cLLI and mDCV are now in pngtest.png, and a
necessary change to the pngunknown.c test program has been made to
accomodate the additions.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-08 23:22:50 +02:00
John Bowler
0cc367aaea [libpng16] fix: Write order of colourspace chunks should conform to PNG v3
cICP was written after PLTE, not before.  The other chunks were output
in an order which does not match the new PNG-v3 "priority" order.

This change outputs all chunks in the "priority" order; highest
precedence first.  This means that the PNGs so written conform to
PNG v3 (cICP), and allow a streaming app to handle chunks in order,
without buffering data which may later be overridden.

Note that PNG-v3 establishes the idea of dropping ancillary chunks
which are inconveniently ordered in the definition of how APNG chunks
are handled.

This is a cherry-pick of commit 945f2602a0ea05a7938b2f52df9ef16cf3440291
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-03 22:28:23 +02:00
Glenn Randers-Pehrson
db16b27d11 [libpng16] Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning. 2017-07-18 06:41:18 -05:00
Glenn Randers-Pehrson
cd37210184 [libpng16] Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
tags) to pngtest.png.
2017-07-16 16:38:01 -05: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
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
4e8d7ec5fc [devel] Added sCAL chunk to pngtest.png 2011-06-10 17:47:09 -05:00
Glenn Randers-Pehrson
4bc9f8472c [devel] Updated CHANGES, ANNOUNCE, and pngtest.png to reflect recent changes. 2011-04-17 18:58:38 -05:00
Glenn Randers-Pehrson
8abcf141fa [devel] Imported from libpng-1.5.3beta02.tar 2011-04-03 06:36:34 -05:00
Glenn Randers-Pehrson
b8e314072f [devel] Replaced pngtest.png with one that has the zTXt CMF optimized. 2011-04-02 08:28:31 -05:00
Glenn Randers-Pehrson
6bdea98992 [devel] Revised pngtest.c to set the zlib strategy, and restored pngtest.png 2011-03-31 21:14:55 -05:00
Glenn Randers-Pehrson
4a392c74cf [devel] Replace pngtest.png with one compressed with libpng-1.5.3beta01.
The zTXt chunk is 4 bytes larger than before.
2011-03-31 20:56:05 -05:00
Glenn Randers-Pehrson
b757b1b5ee [devel] Added the cHRM chunk to pngtest.png 2010-08-11 07:29:04 -05:00
Glenn Randers-Pehrson
d4028b4373 [devel] Added the sRGB chunk to pngtest.png 2010-08-04 13:07:09 -05:00
Glenn Randers-Pehrson
b4e6997999 [devel] New pngtest.png with nonzero offsets
Renamed "png_sucker" to "png_store" in pngvalid.c
2010-07-30 10:35:38 -05:00
Glenn Randers-Pehrson
0acc99fdcd [devel] Restored pngtest.png to the libpng-1.4.0beta7 version. 2009-11-12 12:23:07 -06:00
Glenn Randers-Pehrson
9d57241790 [devel] Bump to version 1.4.0beta97 2009-11-12 10:01:25 -06:00
Glenn Randers-Pehrson
30ec56c8d3 [devel] Fixed up some line-wrapping in the documentation. 2009-11-12 09:57:06 -06:00
Glenn Randers-Pehrson
7336dd4a97 [devel] Revised pngtest.png again.... 2009-11-12 08:19:37 -06:00
Glenn Randers-Pehrson
03c1bf96b2 [devel] Revised pngtest.png to put chunks in the same order written by pngtest
(evidently the same change made in libpng-1.0beta54 was lost).
2009-11-12 08:13:25 -06:00
Glenn Randers-Pehrson
a93c942070 Imported from libpng-1.4.0beta54.tar 2009-04-13 12:02:11 -05:00
Glenn Randers-Pehrson
d120996a49 Imported from libpng-1.4.0beta8.tar 2009-04-06 16:09:27 -05:00
Glenn Randers-Pehrson
6bc53be992 Imported from libpng-1.4.0beta7.tar 2009-04-06 16:09:25 -05:00
Glenn Randers-Pehrson
a4981d4ded Imported from libpng-1.2.7beta1.tar 2009-04-06 16:07:54 -05:00
Glenn Randers-Pehrson
272489dc69 Imported from libpng-1.2.6rc1.tar 2009-04-06 16:07:42 -05:00
Glenn Randers-Pehrson
cbe52d8720 Imported from libpng-0.99e.tar 2009-04-06 16:04:15 -05:00
Andreas Dilger
47a0c422ca Imported from libpng-0.96.tar 2009-04-06 16:04:08 -05:00
Guy Schalnat
c21f90c334 Imported from libpng-0.89c.tar 2009-04-06 16:04:05 -05:00
Guy Schalnat
e5a37797b4 Imported from libpng-0.89.tar 2009-04-06 16:04:05 -05:00
Guy Schalnat
51f0eb4584 Imported from libpng-0.81.tar 2009-04-06 16:04:01 -05:00
Guy Schalnat
0d5805822f Imported from libpng-0.71.tar 2009-04-06 16:04:01 -05:00