diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-10-05 13:59:56 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-10-05 13:59:56 +0000 |
commit | 7b3e75da51c72dc4529250beb1906eb2cce0cab1 (patch) | |
tree | 410f346a6dd5b2b717a3064d4b88ae0ed69bda68 /Build/source/libs | |
parent | 24094d5066ab4365b4373f34d4623354993ff148 (diff) |
libpng 1.5.5
git-svn-id: svn://tug.org/texlive/trunk@24209 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs')
-rw-r--r-- | Build/source/libs/README | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.4/ANNOUNCE | 195 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog (renamed from Build/source/libs/libpng/libpng-1.5.4-PATCHES/ChangeLog) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes (renamed from Build/source/libs/libpng/libpng-1.5.4-PATCHES/TL-Changes) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE | 91 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/CHANGES (renamed from Build/source/libs/libpng/libpng-1.5.4/CHANGES) | 106 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/CMakeLists.txt) | 138 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/INSTALL (renamed from Build/source/libs/libpng/libpng-1.5.4/INSTALL) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/LICENSE (renamed from Build/source/libs/libpng/libpng-1.5.4/LICENSE) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/Makefile.am (renamed from Build/source/libs/libpng/libpng-1.5.4/Makefile.am) | 20 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/Makefile.in (renamed from Build/source/libs/libpng/libpng-1.5.4/Makefile.in) | 30 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/README (renamed from Build/source/libs/libpng/libpng-1.5.4/README) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/TODO (renamed from Build/source/libs/libpng/libpng-1.5.4/TODO) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/aclocal.m4 (renamed from Build/source/libs/libpng/libpng-1.5.4/aclocal.m4) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/autogen.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/autogen.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/config.h.in (renamed from Build/source/libs/libpng/libpng-1.5.4/config.h.in) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/configure (renamed from Build/source/libs/libpng/libpng-1.5.4/configure) | 63 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/configure.ac (renamed from Build/source/libs/libpng/libpng-1.5.4/configure.ac) | 26 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/COPYING) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/LICENSE) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32 (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.mingw32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.sgi) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.unx) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32 (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.w32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/makevms.com) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readppm.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-win.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-x.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-win.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-x.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/toucan.png) | bin | 12901 -> 12901 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/wpng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/makefile) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.dfa) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.std) | 20 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3 (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.tc3) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makevms.com) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.bat) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.sh) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/README) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g01.png) | bin | 164 -> 164 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g02.png) | bin | 104 -> 104 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g04.png) | bin | 145 -> 145 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g08.png) | bin | 138 -> 138 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g16.png) | bin | 167 -> 167 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c08.png) | bin | 145 -> 145 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c16.png) | bin | 302 -> 302 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p01.png) | bin | 112 -> 112 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p02.png) | bin | 146 -> 146 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p04.png) | bin | 216 -> 216 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p08.png) | bin | 1286 -> 1286 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a08.png) | bin | 126 -> 126 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a16.png) | bin | 2206 -> 2206 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a08.png) | bin | 184 -> 184 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a16.png) | bin | 3435 -> 3435 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn1g04.png) | bin | 429 -> 429 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn2c16.png) | bin | 2041 -> 2041 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn2c16.png) | bin | 2041 -> 2041 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbrn2c08.png) | bin | 1633 -> 1633 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn1g16.png) | bin | 1313 -> 1313 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn3p08.png) | bin | 1496 -> 1496 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbyn3p08.png) | bin | 1499 -> 1499 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n1g08.png) | bin | 719 -> 719 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n2c08.png) | bin | 1594 -> 1594 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n3p08.png) | bin | 1476 -> 1476 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp1n3p08.png) | bin | 1483 -> 1483 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.c) | 106 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.h) | 14 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/README.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.c) | 251 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsp) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsw) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.ico) | bin | 766 -> 766 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.png) | bin | 208 -> 208 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.rc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/cexcept.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h (renamed from Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/resource.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/example.c (renamed from Build/source/libs/libpng/libpng-1.5.4/example.c) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/libpng-config.in (renamed from Build/source/libs/libpng/libpng-1.5.4/libpng-config.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/libpng-manual.txt) | 306 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/libpng.3 (renamed from Build/source/libs/libpng/libpng-1.5.4/libpng.3) | 344 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in (renamed from Build/source/libs/libpng/libpng-1.5.4/libpng.pc.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/libpngpf.3 (renamed from Build/source/libs/libpng/libpng-1.5.4/libpngpf.3) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/png.5 (renamed from Build/source/libs/libpng/libpng-1.5.4/png.5) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/png.c (renamed from Build/source/libs/libpng/libpng-1.5.4/png.c) | 415 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/png.h (renamed from Build/source/libs/libpng/libpng-1.5.4/png.h) | 62 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg (renamed from Build/source/libs/libpng/libpng-1.5.4/pngbar.jpg) | bin | 2498 -> 2498 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngbar.png (renamed from Build/source/libs/libpng/libpng-1.5.4/pngbar.png) | bin | 2399 -> 2399 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngconf.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pngconf.h) | 79 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngdebug.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pngdebug.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngerror.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngerror.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngget.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngget.c) | 99 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pnginfo.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pnginfo.h) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pnglibconf.h) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngmem.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngmem.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngnow.png (renamed from Build/source/libs/libpng/libpng-1.5.4/pngnow.png) | bin | 2069 -> 2069 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngpread.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngpread.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngpriv.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pngpriv.h) | 171 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngread.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngread.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngrio.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngrio.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngrtran.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngrtran.c) | 404 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngrutil.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngrutil.c) | 148 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngset.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngset.c) | 70 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngstruct.h (renamed from Build/source/libs/libpng/libpng-1.5.4/pngstruct.h) | 11 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngtest.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngtest.c) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngtest.png (renamed from Build/source/libs/libpng/libpng-1.5.4/pngtest.png) | bin | 8695 -> 8695 bytes | |||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngtrans.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngtrans.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngvalid.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngvalid.c) | 1546 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngwio.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngwio.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngwrite.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngwrite.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngwtran.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngwtran.c) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/pngwutil.c (renamed from Build/source/libs/libpng/libpng-1.5.4/pngwutil.c) | 16 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.tgt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.wpj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngconfig.mak) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngtest.tgt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngvalid.tgt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/PRJ0041.mak) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README_zlib.txt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.sln) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/pngtest.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/zlib.vcproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/libpng/libpng.vcxproj) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pnglibconf/pnglibconf.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngtest/pngtest.vcxproj) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngvalid/pngvalid.vcxproj) | 4 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/readme.txt) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/vstudio.sln) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib.props) | 5 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj (renamed from Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib/zlib.vcxproj) | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/README.txt) | 12 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/SCOPTIONS.ppc) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/checksym.awk) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/chkfmt) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/def.dfn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/descrip.mms) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-body.in) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-head.in) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/libpng.pc.in) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.32sunu) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.64sunu) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.acorn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.aix) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.amiga) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.atari) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bc32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.beos) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bor) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.cegcc) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.darwin) | 5 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dec) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dj2) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.elf) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.freebsd) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.gcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hp64) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpgcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpux) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ibmc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.intel) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.knr) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.linux) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.mips) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.msc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ne12bsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.netbsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.openbsd) | 2 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sco) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sggcc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sgi) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.so9) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris-x86) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.std) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sunos) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.tc3) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32 (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.vcwin32) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/makevms.com) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/options.awk) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.dfa) | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.h.prebuilt) | 4 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.mak) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/pngwin.rc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/smakefile.ppc) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/sym.dfn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.def) | 6 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.dfn) | 0 | ||||
-rw-r--r-- | Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn (renamed from Build/source/libs/libpng/libpng-1.5.4/scripts/vers.dfn) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/test-pngtest.sh) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-full.sh) | 0 | ||||
-rwxr-xr-x | Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh (renamed from Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-simple.sh) | 0 |
220 files changed, 3393 insertions, 1430 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README index d8b541bb98f..29c7a1e2c55 100644 --- a/Build/source/libs/README +++ b/Build/source/libs/README @@ -26,7 +26,7 @@ graphite 2.3.1 - checked 25apr11 icu 4.8.1 - http://download.icu-project.org/files/icu4c/ with modifications required for xetex, also used by bibtexu -libpng 1.5.4 - checked 21jul11 +libpng 1.5.5 - checked 5oct11 http://www.libpng.org/ - used by many http://www.libpng.org/pub/png/pngcode.html diff --git a/Build/source/libs/libpng/libpng-1.5.4/ANNOUNCE b/Build/source/libs/libpng/libpng-1.5.4/ANNOUNCE deleted file mode 100644 index 2a9fb656118..00000000000 --- a/Build/source/libs/libpng/libpng-1.5.4/ANNOUNCE +++ /dev/null @@ -1,195 +0,0 @@ - -Libpng 1.5.4 - July 7, 2011 - -This is a public release of libpng, intended for use in production codes. - -Files available for download: - -Source files with LF line endings (for Unix/Linux) and with a -"configure" script - - libpng-1.5.4.tar.xz (LZMA-compressed, recommended) - libpng-1.5.4.tar.gz - libpng-1.5.4.tar.bz2 - -Source files with CRLF line endings (for Windows), without the -"configure" script - - lpng154.7z (LZMA-compressed, recommended) - lpng154.zip - -Other information: - - libpng-1.5.4-README.txt - libpng-1.5.4-LICENSE.txt - -Changes since the last public release (1.5.2): - - Re-initialize the zlib compressor before compressing non-IDAT chunks. - Added API functions to set parameters for zlib compression of non-IDAT - chunks. - Updated scripts/symbols.def with new API functions. - Only compile the new zlib re-initializing code when text or iCCP is - supported, using PNG_WRITE_COMPRESSED_TEXT_SUPPORTED macro. - Improved the optimization of the zlib CMF byte (see libpng-1.2.6). - Optimize the zlib CMF byte in non-IDAT compressed chunks - Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have - snprintf, and the "__STRICT_ANSI__" detects that condition more reliably - than __STDC__ (John Bowler). - Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells - the compiler that a user supplied callback (the error handler) does not - return, yet there is no guarantee in practice that the application code - will correctly implement the error handler because the compiler only - issues a warning if there is a mistake (John Bowler). - Removed the no-longer-used PNG_DEPSTRUCT macro. - Updated the zlib version to 1.2.5 in the VStudio project. - Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in - pngwutil.c (John Bowler). - Fixed bug with stripping the filler or alpha channel when writing, that - was introduced in libpng-1.5.2 (bug report by Andrew Church). - Updated pngtest.png with the new zlib CMF optimization. - Cleaned up conditional compilation code and of background/gamma handling - Internal changes only except a new option to avoid compiling 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. This avoids - calls to spurious functions if all transforms are disabled and slightly - simplifies those functions. Pngvalid modified to handle this. - A minor change is to stop the strip_16 and expand_16 interfaces from - disabling each other; this allows the future alpha premultiplication - code to use 16-bit intermediate values while still producing 8-bit output. - png_do_background and png_do_gamma have been simplified to take a single - pointer to the png_struct rather than pointers to every item required - from the png_struct. This makes no practical difference to the internal - code. - A serious bug in the pngvalid internal routine 'standard_display_init' has - been fixed - this failed to initialize the red channel and accidentally - initialized the alpha channel twice. - Changed png_struct jmp_buf member name from png_jmpbuf to tmp_jmpbuf to - avoid a clash with the png_jmpbuf macro on some platforms. - Added appropriate feature test macros to ensure libpng sees the correct API - _POSIX_SOURCE is defined in pngpriv.h, pngtest.c and pngvalid.c to ensure - that POSIX conformant systems disable non-POSIX APIs. _ISOC99_SOURCE is - defined in pngpriv.h to obtain the ISO C99 snprintf definition, when - available. - Removed png_snprintf and added formatted warning messages. This change adds - internal APIs to allow png_warning messages to have parameters without - requiring the host OS to implement snprintf. As a side effect the - dependency of the tIME-supporting RFC1132 code on stdio is removed and - PNG_NO_WARNINGS does actually work now. - Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte - optimization configureable. - Internal functions were added to claim/release the z_stream and, hopefully, - make the code more robust. Also deflateEnd checking is added - previously - libpng would ignore an error at the end of the stream. - Removed the -D_ALL_SOURCE from definitions for AIX in CMakeLists.txt - Implemented premultiplied alpha support: png_set_alpha_mode API - Added expand_16 support to the high level interface. - Added named value and 'flag' gamma support to png_set_gamma. Made a minor - change from the previous (unreleased) ABI/API to hide the exact value used - for Macs - it's not a good idea to embed this in the ABI! - Moved macro definitions for PNG_HAVE_IHDR, PNG_HAVE_PLTE, and PNG_AFTER_IDAT - from pngpriv.h to png.h because they must be visible to applications - that call png_set_unknown_chunks(). - Check for up->location !PNG_AFTER_IDAT when writing unknown chunks - before IDAT. - Improved "pngvalid --speed" to exclude more of pngvalid from the time. - Documented png_set_alpha_mode(), other changes in libpng.3/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. - Added memory overwrite and palette image checks to pngvalid.c - Previously palette image code was poorly checked. Since the transformation - code has a special palette path in most cases this was a severe weakness. - Minor cleanup and some extra checking in pngrutil.c and pngrtran.c. When - expanding an indexed image, always expand to RGBA if transparency is - present. - Reversed earlier 1.5.3 change of transformation order; move png_expand_16 - back where it was. The change doesn't work because it requires 16-bit - gamma tables when the code only generates 8-bit ones. This fails - silently; the libpng code just doesn't do any gamma correction. Moving - the tests back leaves the old, inaccurate, 8-bit gamma calculations, but - these are clearly better than none! - png_set_background() and png_expand_16() did not work together correctly. - This problem is present in 1.5.2; if png_set_background is called with - need_expand false and the matching 16 bit color libpng erroneously just - treats it as an 8-bit color because of where png_do_expand_16 is in the - transform list. This simple fix reduces the supplied colour to 8-bits, - so it gets smashed, but this is better than the current behavior. - Added tests for expand16, more fixes for palette image tests to pngvalid. - Corrects the code for palette image tests and disables attempts to - validate palette colors. - Fixed uninitialized memory read in png_format_buffer() (Bug report by - Frank Busse, related to CVE-2004-0421). - Fixed png_handle_sCAL which is broken in 1.5; added sCAL to pngtest.png - Revised documentation about png_set_user_limits() to say that it also affects - png writing. - Revised handling of png_set_user_limits() so that it can increase the - limit beyond the PNG_USER_WIDTH|HEIGHT_MAX; previously it could only - reduce it. - Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is - wrong (high by one) 25% of the time. Dividing by 257 with rounding is - wrong in 128 out of 65536 cases. Getting the right answer all the time - without division is easy. - Added "_SUPPORTED" to the PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION macro. - Added projects/owatcom, an IDE project for OpenWatcom to replace - scripts/makefile.watcom. This project works with OpenWatcom 1.9. The - IDE autogenerates appropriate makefiles (libpng.mk) for batch processing. - The project is configurable, unlike the Visual Studio project, so long - as the developer has an awk. - Changed png_set_gAMA to limit the gamma value range so that the inverse - of the stored value cannot overflow the fixed point representation, - and changed other things OpenWatcom warns about. - Revised pngvalid.c to test PNG_ALPHA_MODE_SUPPORTED correctly. This allows - pngvalid to build when ALPHA_MODE is not supported, which is required if - it is to build on libpng 1.4. - Removed string/memory macros that are no longer used and are not - necessarily fully supportable, particularly png_strncpy and png_snprintf. - Added log option to pngvalid.c and attempted to improve gamma messages. - People found the presence of a beta release following an rc release - to be confusing; therefore we bump the version to libpng-1.5.4beta01 - and there will be no libpng-1.5.3 release. - Moved definitions of PNG_HAVE_IHDR, PNG_AFTER_IDAT, and PNG_HAVE_PLTE - outside of an unknown-chunk block in png.h because they are also - needed for other uses. - Added png_set_scale_16() API, to match inaccurate results from previous - libpng versions, configurable with PNG_READ_SCALE_16_TO_8_SUPPORTED. - Fixed a problem in png_do_expand_palette() exposed by optimization in - 1.5.3beta06 - Also removed a spurious and confusing "trans" member ("trans") from png_info. - The palette expand optimization prevented expansion to an intermediate RGBA - form if tRNS was present but alpha was marked to be stripped; this exposed - a check for tRNS in png_do_expand_palette() which is inconsistent with the - code elsewhere in libpng. - Added PNG_TRANSFORM_SCALE_16 to the high-level read transforms. - If PNG_READ_16_TO_8_ACCURATE_SCALE is not enabled, png_set_scale_16() - and png_do_scale_16_to_8() aren't built. - Revised contrib/visupng, gregbook, and pngminim to demonstrate scale_16_to_8 - Fixed pngvalid, simplified macros, added checking for 0 in sCAL. - The ACCURATE scale macro is no longer defined in libpng-1.5 - call the - png_scale_16_to_8 API. Made sure that PNG_READ_16_TO_8 is still defined - if the png_strip_16_to_8 API is present. png_check_fp_number now - maintains some state so that positive, negative and zero values are - identified. sCAL uses these to be strictly spec conformant. - Define PNG_ALLOCATED to "restrict" only if MSC_VER >= 1400. - -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 -*/ } -#endif - -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 diff --git a/Build/source/libs/libpng/libpng-1.5.4-PATCHES/ChangeLog b/Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog index 26311ea5079..26311ea5079 100644 --- a/Build/source/libs/libpng/libpng-1.5.4-PATCHES/ChangeLog +++ b/Build/source/libs/libpng/libpng-1.5.5-PATCHES/ChangeLog diff --git a/Build/source/libs/libpng/libpng-1.5.4-PATCHES/TL-Changes b/Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes index 544b459f5b4..448e42ba672 100644 --- a/Build/source/libs/libpng/libpng-1.5.4-PATCHES/TL-Changes +++ b/Build/source/libs/libpng/libpng-1.5.5-PATCHES/TL-Changes @@ -1,5 +1,5 @@ -Changes applied to the libpng-1.5.4/ tree as obtained from: - http://www.libpng.org/ libpng-1.5.4.tar.xz +Changes applied to the libpng-1.5.5/ tree as obtained from: + http://www.libpng.org/ libpng-1.5.5.tar.xz Copied: scripts/pnglibconf.h.prebuilt -> pnglibconf.h diff --git a/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE b/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE new file mode 100644 index 00000000000..9f3e677be14 --- /dev/null +++ b/Build/source/libs/libpng/libpng-1.5.5/ANNOUNCE @@ -0,0 +1,91 @@ + +Libpng 1.5.5 - September 22, 2011 + +This is a public release of libpng, intended for use in production codes. + +Files available for download: + +Source files with LF line endings (for Unix/Linux) and with a +"configure" script + + libpng-1.5.5.tar.xz (LZMA-compressed, recommended) + libpng-1.5.5.tar.gz + libpng-1.5.5.tar.bz2 + +Source files with CRLF line endings (for Windows), without the +"configure" script + + lpng155.7z (LZMA-compressed, recommended) + lpng155.zip + +Other information: + + libpng-1.5.5-README.txt + libpng-1.5.5-LICENSE.txt + +Changes since the last public release (1.5.4): + + Fixed some typos and made other minor changes in the manual. + Updated contrib/pngminus/makefile.std (Samuli Souminen) + Revised Makefile.am and Makefile.in to look in the right directory for + pnglibconf.h.prebuilt + 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. + Minor editing of libpng.3 and libpng-manual.txt. + Revised CMakeLists.txt (Clifford Yapp) + Updated commentary about the png_rgb_to_gray() default coefficients + in the manual and in pngrtran.c + Prevent unexpected API exports from non-libpng DLLs on Windows. The "_DLL" + is removed from the test of whether a DLL is being built (this erroneously + caused the libpng APIs to be marked as DLL exports in static builds under + Microsoft Visual Studio). Almost all of the libpng building configuration + is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in + pngconf.h, though, so that it is colocated with the import definition (it + is no longer used anywhere in the installed headers). The VStudio project + definitions have been cleaned up: "_USRDLL" has been removed from the + static library builds (this was incorrect), and PNG_USE_DLL has been added + to pngvalid to test the functionality (pngtest does not supply it, + deliberately). The spurious "_EXPORTS" has been removed from the + libpng build (all these errors were a result of copy/paste between project + configurations.) + Added new types and internal functions for CIE RGB end point handling to + pngpriv.h (functions yet to be implemented). + Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt + (Clifford Yap) + Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler): + The rgb_to_gray code had errors when combined with gamma correction. + Some pixels were treated as true grey when they weren't and such pixels + and true grey ones were not gamma corrected (the original value of the + red component was used instead). APIs to get and set cHRM using color + space end points have been added and the rgb_to_gray code that defaults + based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT + VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected. + A considerable number of tests has been added to pngvalid for the + rgb_to_gray transform. + Arithmetic errors in rgb_to_gray whereby the calculated gray value was + truncated to the bit depth rather than rounded have been fixed except in + the 8-bit non-gamma-corrected case (where consistency seems more important + than correctness.) The code still has considerable inaccuracies in the + 8-bit case because 8-bit linear arithmetic is used. + Added "$(ARCH)" option to makefile.darwin + Added SunOS support to configure.ac and Makefile.am + Changed png_chunk_benign_error() to png_warning() in png.c, in + png_XYZ_from_xy_checked(). + 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 that the + compiler correctly flags. + 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. + +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 +*/ } +#endif diff --git a/Build/source/libs/libpng/libpng-1.5.4/CHANGES b/Build/source/libs/libpng/libpng-1.5.5/CHANGES index 628d7f04533..dd31a96aee9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/CHANGES +++ b/Build/source/libs/libpng/libpng-1.5.5/CHANGES @@ -1,5 +1,4 @@ #if 0 -libpng_changes(){ /* CHANGES - changes for libpng Version 0.2 @@ -180,7 +179,7 @@ Version 0.96 [May, 1997] Fixed serious bug with < 8bpp images introduced in 0.95 Fixed 256-color transparency bug (Greg Roelofs) Fixed up documentation (Greg Roelofs, Laszlo Nyul) - Fixed "error" in pngconf.h for Linux setjmp() behaviour + Fixed "error" in pngconf.h for Linux setjmp() behavior Fixed DOS medium model support (Tim Wegner) Fixed png_check_keyword() for case with error in static string text Added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul) @@ -204,8 +203,8 @@ Version 0.97 [January, 1998] Added more conditions for png_do_background, to avoid changing black pixels to background when a background is supplied and no pixels are transparent - Repaired PNG_NO_STDIO behaviour - Tested NODIV support and made it default behaviour (Greg Roelofs) + Repaired PNG_NO_STDIO behavior + Tested NODIV support and made it default behavior (Greg Roelofs) Added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler) Regularized version numbering scheme and bumped shared-library major version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs) @@ -1778,7 +1777,7 @@ Version 1.2.13beta1 [October 2, 2006] Removed AC_FUNC_MALLOC from configure.ac Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h Change "logical" to "bitwise" throughout documentation. - Detect and fix attempt to write wrong iCCP profile length. + Detect and fix attempt to write wrong iCCP profile length (CVE-2006-7244) Version 1.0.21, 1.2.13 [November 14, 2006] Fix potential buffer overflow in sPLT chunk handler. @@ -2361,7 +2360,7 @@ Version 1.4.0beta72 [August 1, 2009] Version 1.4.0beta73 [August 1, 2009] Reject attempt to write iCCP chunk with negative embedded profile length - (JD Chen) + (JD Chen) (CVE-2009-5063). Version 1.4.0beta74 [August 8, 2009] Changed png_ptr and info_ptr member "trans" to "trans_alpha". @@ -3149,8 +3148,8 @@ version 1.5.1beta01 [January 8, 2011] in version 1.5.0beta36 but is not noted in the CHANGES. Similarly, it was changed from png_charpp to png_const_bytepp in png_set_iCCP(). Ensure that png_rgb_to_gray ignores palette mapped images, if libpng - internally happens to call it with one. - Fixed a failure to handle palette mapped images correctly. + internally happens to call it with one, and fixed a failure to handle + palette mapped images correctly. This fixes CVE-2690. Version 1.5.1beta02 [January 14, 2011] Fixed a bug in handling of interlaced images (bero at arklinux.org). @@ -3289,8 +3288,8 @@ Version 1.5.2 [March 31, 2011] Version 1.5.3beta01 [April 1, 2011] Re-initialize the zlib compressor before compressing non-IDAT chunks. - Added API functions to set parameters for zlib compression of non-IDAT - chunks. + Added API functions (png_set_text_compression_level() and four others) to + set parameters for zlib compression of non-IDAT chunks. Version 1.5.3beta02 [April 3, 2011] Updated scripts/symbols.def with new API functions. @@ -3347,7 +3346,7 @@ Version 1.5.3beta05 [May 6, 2011] dependency of the tIME-supporting RFC1132 code on stdio is removed and PNG_NO_WARNINGS does actually work now. Pass "" instead of '\0' to png_default_error() in png_err(). This mistake - was introduced in libpng-1.2.20beta01. + was introduced in libpng-1.2.20beta01. This fixes CVE-2011-2691. Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte optimization configureable. IDAT compression failed if preceded by a compressed text chunk (bug @@ -3378,7 +3377,8 @@ Version 1.5.3beta08 [May 16, 2011] Documented png_set_alpha_mode(), other changes in libpng.3/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. + sRGB/Rec 709 values are still used. This introduced a divide-by-zero + bug in png_handle_cHRM(). 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 @@ -3418,7 +3418,8 @@ Version 1.5.3rc02 [June 8, 2011] Frank Busse, CVE-2011-2501, related to CVE-2004-0421). Version 1.5.3beta11 [June 11, 2011] - Fixed png_handle_sCAL which is broken in 1.5; added sCAL to pngtest.png + Fixed png_handle_sCAL which is broken in 1.5. This fixes CVE 2011-2692. + Added sCAL to pngtest.png Revised documentation about png_set_user_limits() to say that it also affects png writing. Revised handling of png_set_user_limits() so that it can increase the @@ -3507,6 +3508,84 @@ Version 1.5.4rc01 [June 30, 2011] Define PNG_ALLOCATED to "restrict" only if MSC_VER >= 1400. Version 1.5.4 [July 7, 2011] + No changes. + +Version 1.5.5beta01 [July 13, 2011] + Fixed some typos and made other minor changes in the manual. + Updated contrib/pngminus/makefile.std (Samuli Souminen) + +Version 1.5.5beta02 [July 14, 2011] + Revised Makefile.am and Makefile.in to look in the right directory for + pnglibconf.h.prebuilt + +Version 1.5.5beta03 [July 27, 2011] + 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. + Minor editing of libpng.3 and libpng-manual.txt. + +Version 1.5.5beta04 [July 29, 2011] + Revised CMakeLists.txt (Clifford Yapp) + Updated commentary about the png_rgb_to_gray() default coefficients + in the manual and in pngrtran.c + +Version 1.5.5beta05 [August 17, 2011] + Prevent unexpected API exports from non-libpng DLLs on Windows. The "_DLL" + is removed from the test of whether a DLL is being built (this erroneously + caused the libpng APIs to be marked as DLL exports in static builds under + Microsoft Visual Studio). Almost all of the libpng building configuration + is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in + pngconf.h, though, so that it is colocated with the import definition (it + is no longer used anywhere in the installed headers). The VStudio project + definitions have been cleaned up: "_USRDLL" has been removed from the + static library builds (this was incorrect), and PNG_USE_DLL has been added + to pngvalid to test the functionality (pngtest does not supply it, + deliberately). The spurious "_EXPORTS" has been removed from the + libpng build (all these errors were a result of copy/paste between project + configurations.) + Added new types and internal functions for CIE RGB end point handling to + pngpriv.h (functions yet to be implemented). + +Version 1.5.5beta06 [August 26, 2011] + Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt + (Clifford Yap) + Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler): + The rgb_to_gray code had errors when combined with gamma correction. + Some pixels were treated as true grey when they weren't and such pixels + and true grey ones were not gamma corrected (the original value of the + red component was used instead). APIs to get and set cHRM using color + space end points have been added and the rgb_to_gray code that defaults + based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT + VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected. + A considerable number of tests has been added to pngvalid for the + rgb_to_gray transform. + Arithmetic errors in rgb_to_gray whereby the calculated gray value was + truncated to the bit depth rather than rounded have been fixed except in + the 8-bit non-gamma-corrected case (where consistency seems more important + than correctness.) The code still has considerable inaccuracies in the + 8-bit case because 8-bit linear arithmetic is used. + +Version 1.5.5beta07 [September 7, 2011] + Added "$(ARCH)" option to makefile.darwin + Added SunOS support to configure.ac and Makefile.am + Changed png_chunk_benign_error() to png_warning() in png.c, in + png_XYZ_from_xy_checked(). + +Version 1.5.5beta08 [September 10, 2011] + 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 that the + compiler correctly flags. + Relocated new HAVE_SOLARIS_LD definition in configure.ac + 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. + +Version 1.5.5rc01 [September 17, 2011] + Removed "L" suffixes from constants in pngpriv.h + +Version 1.5.5 [September 22, 2011] + No changes. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit @@ -3515,5 +3594,4 @@ to subscribe) or to glennrp at users.sourceforge.net Glenn R-P -*/ } #endif diff --git a/Build/source/libs/libpng/libpng-1.5.4/CMakeLists.txt b/Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt index cc158508d11..72e5269c226 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/CMakeLists.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/CMakeLists.txt @@ -1,3 +1,11 @@ +# CMakeLists.txt + +# Copyright (C) 2007-2011 Glenn Randers-Pehrson + +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + cmake_minimum_required(VERSION 2.4.4) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) @@ -25,15 +33,9 @@ endif() project(libpng C) enable_testing() -# Copyright (C) 2007-2011 Glenn Randers-Pehrson - -# This code is released under the libpng license. -# For conditions of distribution and use, see the disclaimer -# and license in png.h - set(PNGLIB_MAJOR 1) set(PNGLIB_MINOR 5) -set(PNGLIB_RELEASE 4) +set(PNGLIB_RELEASE 5) set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) @@ -156,7 +158,6 @@ if(PNG_SHARED OR NOT MSVC) add_definitions(-DZLIB_DLL) endif() - if(PNG_CONSOLE_IO_SUPPORTED) add_definitions(-DPNG_CONSOLE_IO_SUPPORTED) endif() @@ -201,7 +202,6 @@ if(PNG_STATIC) target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY}) endif() - if(PNG_SHARED AND WIN32) set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL) endif() @@ -213,24 +213,32 @@ if(PNG_TESTS AND PNG_SHARED) add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png) endif() -# +# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set +IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) + IF(WIN32) + SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "bin") + ELSE(WIN32) + SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib") + ENDIF(WIN32) +ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) + # Set a variable with CMake code which: # Creates a symlink from src to dest (if possible) or alternatively # copies if different. -macro(_png_generate_symlink_code CODE SRC DEST) +macro(CREATE_SYMLINK SRC_FILE DEST_FILE) + FILE(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}) if(WIN32 AND NOT CYGWIN) - set(_png_gsc_message "Copying ${SRC} to ${DEST} if needed") - set(_png_gsc_operation "copy_if_different") - else() - set(_png_gsc_message "Symlinking ${SRC} to ${DEST}") - set(_png_gsc_operation "create_symlink") - endif() - - set(${CODE} " - message(STATUS \"${_png_gsc_message}\") - execute_process(COMMAND \${CMAKE_COMMAND} -E ${_png_gsc_operation} - \"${SRC}\" \"${DEST}\") - ") + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE} + DEPENDS ${PNG_LIB_NAME} ${PNG_LIB_NAME_STATIC} + ) + ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}) + else(WIN32 AND NOT CYGWIN) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif(WIN32 AND NOT CYGWIN) endmacro() # CREATE PKGCONFIG FILES @@ -245,22 +253,16 @@ set(includedir ${CMAKE_INSTALL_PREFIX}/include) set(LIBS "-lz -lm") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY) -_png_generate_symlink_code(PNG_PC_INSTALL_CODE - ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc - ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc) -install(CODE ${PNG_PC_INSTALL_CODE}) +CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY) -_png_generate_symlink_code(PNG_CONFIG_INSTALL_CODE - ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config - ${CMAKE_CURRENT_BINARY_DIR}/libpng-config) -install(CODE ${PNG_CONFIG_INSTALL_CODE}) +CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config) # SET UP LINKS if(PNG_SHARED) set_target_properties(${PNG_LIB_NAME} PROPERTIES -# VERSION 15.${PNGLIB_RELEASE}.1.5.4 +# VERSION 15.${PNGLIB_RELEASE}.1.5.5 VERSION 15.${PNGLIB_RELEASE}.0 SOVERSION 15 CLEAN_DIRECT_OUTPUT 1) @@ -296,61 +298,35 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) # Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin if(CYGWIN) - _png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE - ${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX} - libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}) - install(CODE ${PNG_SHARED_IMPLIB_INSTALL_CODE}) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() + get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE}) + get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) + CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif(CYGWIN) if(NOT WIN32) - IF(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_SHARED_INSTALL_CODE - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) - install(CODE ${PNG_SHARED_INSTALL_CODE}) - install(FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ELSE(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_SHARED_INSTALL_CODE - ${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} - libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) - install(CODE ${PNG_SHARED_INSTALL_CODE}) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF(CMAKE_LIBRARY_OUTPUT_DIRECTORY) - endif() - endif() + get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE}) + get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) + CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_SHARED_LIBRARY_SUFFIX}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif(NOT WIN32) + endif(PNG_SHARED) if(PNG_STATIC) install(TARGETS ${PNG_LIB_NAME_STATIC} ${PNG_EXPORT_RULE} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) if(NOT WIN32 OR CYGWIN) - IF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_STATIC_INSTALL_CODE -${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) - install(CODE ${PNG_STATIC_INSTALL_CODE}) - install(FILES - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ELSE(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - _png_generate_symlink_code(PNG_STATIC_INSTALL_CODE - ${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} - libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) - install(CODE ${PNG_STATIC_INSTALL_CODE}) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} - DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - endif() - endif() + get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE}) + get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME) + CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_STATIC_LIBRARY_SUFFIX}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} + DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif(NOT WIN32 OR CYGWIN) + endif() endif() if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) @@ -388,11 +364,9 @@ endif() # what's with libpng-$VER%.txt and all the extra files? - # UNINSTALL # do we need this? - # DIST # do we need this? diff --git a/Build/source/libs/libpng/libpng-1.5.4/INSTALL b/Build/source/libs/libpng/libpng-1.5.5/INSTALL index 353bfff3268..353bfff3268 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/INSTALL +++ b/Build/source/libs/libpng/libpng-1.5.5/INSTALL diff --git a/Build/source/libs/libpng/libpng-1.5.4/LICENSE b/Build/source/libs/libpng/libpng-1.5.5/LICENSE index 89f5243f164..5e932e10283 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/LICENSE +++ b/Build/source/libs/libpng/libpng-1.5.5/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are +libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -July 7, 2011 +September 22, 2011 diff --git a/Build/source/libs/libpng/libpng-1.5.4/Makefile.am b/Build/source/libs/libpng/libpng-1.5.5/Makefile.am index af2f58bacdd..c80f0ce8989 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/Makefile.am +++ b/Build/source/libs/libpng/libpng-1.5.5/Makefile.am @@ -44,11 +44,16 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ -version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 if HAVE_LD_VERSION_SCRIPT - # Versioned symbols and restricted exports +# Versioned symbols and restricted exports +if HAVE_SOLARIS_LD + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,-M Wl,libpng.vers +else libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -Wl,--version-script=libpng.vers +endif + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers else - # Only restricted exports when possible +# Only restricted exports when possible libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym endif @@ -97,7 +102,7 @@ $(PNGLIB_BASENAME)-config: libpng-config cp libpng-config $@ scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h -scripts/symbols.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt +scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt libpng.sym: scripts/sym.out rm -f $@ @@ -108,7 +113,8 @@ libpng.vers: scripts/vers.out pnglibconf.h: pnglibconf.out rm -f $@ cp $? $@ -scripts/pnglibconf.h.prebuilt: +$(srcdir)/scripts/pnglibconf.h.prebuilt: + @echo "Attempting to build $@" >&2 @echo "This is a machine generated file, but if you want to make" >&2 @echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2 @exit 1 @@ -119,8 +125,8 @@ scripts/pnglibconf.h.prebuilt: pngvalid.o pngtest.o: pnglibconf.h # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually -# be built with PNG_USE_READ_MACROS; this stops the read macros interfering -# with the symbol file format. +# be built with PNG_USE_READ_MACROS; this prevents the read macros from +# interfering with the symbol file format. SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ -DPNGLIB_VERSION='@PNGLIB_VERSION@'\ -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\ @@ -162,7 +168,7 @@ scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk test -z "$(CPPFLAGS)" echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ $(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\ - logunsupported=4 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 + logunsupported=1 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2 rm dfn1.out mv dfn2.out $@ diff --git a/Build/source/libs/libpng/libpng-1.5.4/Makefile.in b/Build/source/libs/libpng/libpng-1.5.5/Makefile.in index 20e0111c4e4..cd7b998009e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/Makefile.in +++ b/Build/source/libs/libpng/libpng-1.5.5/Makefile.in @@ -41,8 +41,12 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT) -@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=libpng.vers -@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_2 = -export-symbols libpng.sym + +# Versioned symbols and restricted exports +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_TRUE@am__append_1 = -Wl,-M Wl,libpng.vers +@HAVE_LD_VERSION_SCRIPT_TRUE@@HAVE_SOLARIS_LD_FALSE@am__append_2 = -Wl,--version-script=libpng.vers +# Only restricted exports when possible +@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_3 = -export-symbols libpng.sym subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ @@ -330,7 +334,7 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined \ -export-dynamic -version-number \ @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0 \ - $(am__append_1) $(am__append_2) + $(am__append_1) $(am__append_2) $(am__append_3) @HAVE_LD_VERSION_SCRIPT_FALSE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym @HAVE_LD_VERSION_SCRIPT_TRUE@libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.vers pkginclude_HEADERS = png.h pngconf.h @@ -357,8 +361,8 @@ config.sub configure depcomp install-sh ltmain.sh missing SUFFIXES = .chk .dfn .out # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually -# be built with PNG_USE_READ_MACROS; this stops the read macros interfering -# with the symbol file format. +# be built with PNG_USE_READ_MACROS; this prevents the read macros from +# interfering with the symbol file format. SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ -DPNGLIB_VERSION='@PNGLIB_VERSION@'\ -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\ @@ -413,7 +417,7 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -455,7 +459,7 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) +libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @@ -466,10 +470,10 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES) +pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES) @rm -f pngtest$(EXEEXT) $(LINK) $(pngtest_OBJECTS) $(pngtest_LDADD) $(LIBS) -pngvalid$(EXEEXT): $(pngvalid_OBJECTS) $(pngvalid_DEPENDENCIES) +pngvalid$(EXEEXT): $(pngvalid_OBJECTS) $(pngvalid_DEPENDENCIES) @rm -f pngvalid$(EXEEXT) $(LINK) $(pngvalid_OBJECTS) $(pngvalid_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @@ -1255,9 +1259,6 @@ uninstall-man: uninstall-man3 uninstall-man5 uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS -@HAVE_LD_VERSION_SCRIPT_TRUE@ # Versioned symbols and restricted exports -@HAVE_LD_VERSION_SCRIPT_FALSE@ # Only restricted exports when possible - $(PNGLIB_BASENAME).pc: libpng.pc cp libpng.pc $@ @@ -1265,7 +1266,7 @@ $(PNGLIB_BASENAME)-config: libpng-config cp libpng-config $@ scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h -scripts/symbols.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt +scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt libpng.sym: scripts/sym.out rm -f $@ @@ -1276,7 +1277,8 @@ libpng.vers: scripts/vers.out pnglibconf.h: pnglibconf.out rm -f $@ cp $? $@ -scripts/pnglibconf.h.prebuilt: +$(srcdir)/scripts/pnglibconf.h.prebuilt: + @echo "Attempting to build $@" >&2 @echo "This is a machine generated file, but if you want to make" >&2 @echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2 @exit 1 diff --git a/Build/source/libs/libpng/libpng-1.5.4/README b/Build/source/libs/libpng/libpng-1.5.5/README index 71396a8d9d0..a540e83cac1 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/README +++ b/Build/source/libs/libpng/libpng-1.5.5/README @@ -1,4 +1,4 @@ -README for libpng version 1.5.4 - July 7, 2011 (shared library 15.0) +README for libpng version 1.5.5 - September 22, 2011 (shared library 15.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/Build/source/libs/libpng/libpng-1.5.4/TODO b/Build/source/libs/libpng/libpng-1.5.5/TODO index 6e1f028bd75..6e1f028bd75 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/TODO +++ b/Build/source/libs/libpng/libpng-1.5.5/TODO diff --git a/Build/source/libs/libpng/libpng-1.5.4/aclocal.m4 b/Build/source/libs/libpng/libpng-1.5.5/aclocal.m4 index e788a89596e..e788a89596e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/aclocal.m4 +++ b/Build/source/libs/libpng/libpng-1.5.5/aclocal.m4 diff --git a/Build/source/libs/libpng/libpng-1.5.4/autogen.sh b/Build/source/libs/libpng/libpng-1.5.5/autogen.sh index 5be104eb1d9..5be104eb1d9 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/autogen.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/autogen.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/config.h.in b/Build/source/libs/libpng/libpng-1.5.5/config.h.in index fb2349568cd..fb2349568cd 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/config.h.in +++ b/Build/source/libs/libpng/libpng-1.5.5/config.h.in diff --git a/Build/source/libs/libpng/libpng-1.5.4/configure b/Build/source/libs/libpng/libpng-1.5.5/configure index 54c5192f251..d078444dc9a 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/configure +++ b/Build/source/libs/libpng/libpng-1.5.5/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libpng 1.5.4. +# Generated by GNU Autoconf 2.68 for libpng 1.5.5. # # Report bugs to <png-mng-implement@lists.sourceforge.net>. # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libpng' PACKAGE_TARNAME='libpng' -PACKAGE_VERSION='1.5.4' -PACKAGE_STRING='libpng 1.5.4' +PACKAGE_VERSION='1.5.5' +PACKAGE_STRING='libpng 1.5.5' PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' PACKAGE_URL='' @@ -624,6 +624,8 @@ PNGLIB_VERSION SYMBOL_PREFIX HAVE_LD_VERSION_SCRIPT_FALSE HAVE_LD_VERSION_SCRIPT_TRUE +HAVE_SOLARIS_LD_FALSE +HAVE_SOLARIS_LD_TRUE LIBPNG_DEFINES LIBOBJS POW_LIB @@ -763,8 +765,7 @@ CFLAGS LDFLAGS LIBS CPPFLAGS -CPP -CPPFLAGS' +CPP' # Initialize some variables set by options. @@ -1307,7 +1308,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libpng 1.5.4 to adapt to many kinds of systems. +\`configure' configures libpng 1.5.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1377,7 +1378,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libpng 1.5.4:";; + short | recursive ) echo "Configuration of libpng 1.5.5:";; esac cat <<\_ACEOF @@ -1485,7 +1486,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libpng configure 1.5.4 +libpng configure 1.5.5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1908,7 +1909,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libpng $as_me 1.5.4, which was +It was created by libpng $as_me 1.5.5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2723,7 +2724,7 @@ fi # Define the identity of the package. PACKAGE='libpng' - VERSION='1.5.4' + VERSION='1.5.5' cat >>confdefs.h <<_ACEOF @@ -2787,10 +2788,10 @@ fi -PNGLIB_VERSION=1.5.4 +PNGLIB_VERSION=1.5.5 PNGLIB_MAJOR=1 PNGLIB_MINOR=5 -PNGLIB_RELEASE=4 +PNGLIB_RELEASE=5 @@ -12408,6 +12409,28 @@ LIBPNG_DEFINES=$LIBPNG_DEFINES { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 $as_echo_n "checking if libraries can be versioned... " >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if using Solaris linker" >&5 +$as_echo_n "checking if using Solaris linker... " >&6; } +SLD=`$LD --version 2>&1 | grep Solaris` +if test "$SLD"; then + have_solaris_ld=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_solaris_ld=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "$have_solaris_ld" = "yes"; then + HAVE_SOLARIS_LD_TRUE= + HAVE_SOLARIS_LD_FALSE='#' +else + HAVE_SOLARIS_LD_TRUE='#' + HAVE_SOLARIS_LD_FALSE= +fi + + # Special case for PE/COFF platforms: ld reports # support for version-script, but doesn't actually # DO anything with it. @@ -12418,7 +12441,13 @@ case $host in $as_echo "no" >&6; } ;; * ) -GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` + +if test "$have_solaris_ld" = "yes"; then + GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` +else + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +fi + if test "$GLD"; then have_ld_version_script=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -12627,6 +12656,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_SOLARIS_LD_TRUE}" && test -z "${HAVE_SOLARIS_LD_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SOLARIS_LD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13040,7 +13073,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libpng $as_me 1.5.4, which was +This file was extended by libpng $as_me 1.5.5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13106,7 +13139,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libpng config.status 1.5.4 +libpng config.status 1.5.5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/Build/source/libs/libpng/libpng-1.5.4/configure.ac b/Build/source/libs/libpng/libpng-1.5.5/configure.ac index f2800f62c47..18f62c1abd6 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/configure.ac +++ b/Build/source/libs/libpng/libpng-1.5.5/configure.ac @@ -18,15 +18,15 @@ AC_PREREQ(2.59) dnl Version number stuff here: -AC_INIT([libpng], [1.5.4], [png-mng-implement@lists.sourceforge.net]) +AC_INIT([libpng], [1.5.5], [png-mng-implement@lists.sourceforge.net]) AM_INIT_AUTOMAKE dnl stop configure from automagically running automake AM_MAINTAINER_MODE -PNGLIB_VERSION=1.5.4 +PNGLIB_VERSION=1.5.5 PNGLIB_MAJOR=1 PNGLIB_MINOR=5 -PNGLIB_RELEASE=4 +PNGLIB_RELEASE=5 dnl End of version number stuff @@ -95,6 +95,18 @@ LIBPNG_DEFINES=$LIBPNG_DEFINES AC_SUBST(LIBPNG_DEFINES) AC_MSG_CHECKING([if libraries can be versioned]) + +AC_MSG_CHECKING([if using Solaris linker]) +SLD=`$LD --version 2>&1 | grep Solaris` +if test "$SLD"; then + have_solaris_ld=yes + AC_MSG_RESULT(yes) +else + have_solaris_ld=no + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes") + # Special case for PE/COFF platforms: ld reports # support for version-script, but doesn't actually # DO anything with it. @@ -104,7 +116,13 @@ case $host in AC_MSG_RESULT(no) ;; * ) -GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` + +if test "$have_solaris_ld" = "yes"; then + GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` +else + GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +fi + if test "$GLD"; then have_ld_version_script=yes AC_MSG_RESULT(yes) diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/COPYING b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING index a3e97747969..a3e97747969 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/COPYING +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/COPYING diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/LICENSE b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE index d9567178cb6..d9567178cb6 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/LICENSE +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/LICENSE diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.mingw32 b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32 index e70a59aef2b..e70a59aef2b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.mingw32 +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.mingw32 diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.sgi b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi index 91623acf068..91623acf068 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.sgi +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.sgi diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.unx b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx index b52d8b6aa65..b52d8b6aa65 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.unx +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.unx diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.w32 b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32 index 41cfb231a2c..41cfb231a2c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/Makefile.w32 +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/Makefile.w32 diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README index 7b1f6a3ea62..7b1f6a3ea62 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/makevms.com b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com index f32bcaba7f9..f32bcaba7f9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c index df42c301b3c..df42c301b3c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h index fad9fe3b4c5..fad9fe3b4c5 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c index b9746b75608..b9746b75608 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h index 6b3660d7c17..6b3660d7c17 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readpng2.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readpng2.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readppm.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c index be9a56d95fd..be9a56d95fd 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/readppm.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/readppm.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-win.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c index f53ddc8ece6..f53ddc8ece6 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-win.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-win.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-x.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c index 6d10e1b84ed..6d10e1b84ed 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng-x.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng-x.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-win.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c index fbdacb59bc4..fbdacb59bc4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-win.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-win.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-x.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c index b04c5c6b69a..b04c5c6b69a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/rpng2-x.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/rpng2-x.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/toucan.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png Binary files differindex 03960d49399..03960d49399 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/toucan.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/toucan.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/wpng.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c index a06e3529ecb..a06e3529ecb 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/wpng.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/wpng.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c index f07f4a8a02d..f07f4a8a02d 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h index 78b966b5874..78b966b5874 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/gregbook/writepng.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/gregbook/writepng.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README index 51d5a3c2305..51d5a3c2305 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README index fa979fcb727..fa979fcb727 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/makefile b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile index e10e1225d65..e10e1225d65 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/makefile +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa index 70d528bc9f9..70d528bc9f9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h index ce855375289..ce855375289 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/decoder/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/decoder/pngusr.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README index ff9aa4597a9..ff9aa4597a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/makefile b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile index d6f39e2ea06..d6f39e2ea06 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/makefile +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa index ee88443c9dd..ee88443c9dd 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h index fb35245ee5d..fb35245ee5d 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/encoder/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/encoder/pngusr.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README index faa83560a72..faa83560a72 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/makefile b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile index f4b0ccdc8a9..f4b0ccdc8a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/makefile +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/makefile diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.dfa b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa index 216c421ca66..216c421ca66 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.dfa +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.dfa diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h index b40cc46ce69..b40cc46ce69 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminim/preader/pngusr.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminim/preader/pngusr.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README index bbe7407ecce..bbe7407ecce 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.std b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std index 2fb061bbe2c..fa7b5909fcc 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.std +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.std @@ -8,9 +8,9 @@ LD=$(CC) RM=rm -f #PNGPATH = /usr/local -#PNGINC = -I$(PNGPATH)/include/libpng12 -#PNGLIB = -L$(PNGPATH)/lib -lpng12 -#PNGLIBS = $(PNGPATH)/lib/libpng12.a +#PNGINC = -I$(PNGPATH)/include/libpng15 +#PNGLIB = -L$(PNGPATH)/lib -lpng15 +#PNGLIBS = $(PNGPATH)/lib/libpng15.a PNGINC = -I../.. PNGLIB = -L../.. -lpng PNGLIBS = ../../libpng.a @@ -23,9 +23,9 @@ ZINC = -I../../../zlib ZLIB = -L../../../zlib -lz ZLIBS = ../../../zlib/libz.a -CFLAGS=-O3 $(PNGINC) $(ZINC) -LDFLAGS=$(PNGLIB) $(ZLIB) -LDFLAGSS=$(PNGLIBS) $(ZLIBS) +CFLAGS=$(PNGINC) $(ZINC) +LDLIBS=$(PNGLIB) $(ZLIB) +LDLIBSS=$(PNGLIBS) $(ZLIBS) C=.c O=.o L=.a @@ -40,19 +40,19 @@ png2pnm$(O): png2pnm$(C) $(CC) -c $(CFLAGS) png2pnm$(C) png2pnm$(E): png2pnm$(O) - $(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm + $(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm png2pnm-static$(E): png2pnm$(O) - $(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm + $(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm pnm2png$(O): pnm2png$(C) $(CC) -c $(CFLAGS) pnm2png$(C) pnm2png$(E): pnm2png$(O) - $(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm + $(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm pnm2png-static$(E): pnm2png$(O) - $(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm + $(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm clean: $(RM) png2pnm$(O) diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.tc3 b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3 index 404f18d5b15..404f18d5b15 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makefile.tc3 +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makefile.tc3 diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makevms.com b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com index 00561bcd0d7..00561bcd0d7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.bat b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat index 449cf36750b..449cf36750b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.bat +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.bat diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c index 2281429435d..2281429435d 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.sh b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh index b1c05370dff..b1c05370dff 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/png2pnm.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/png2pnm.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.bat b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat index 911bb8dff9e..911bb8dff9e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.bat +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.bat diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.sh b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh index 2a0a9d8fbba..2a0a9d8fbba 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pngminus.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pngminus.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.bat b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat index f756cb84de4..f756cb84de4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.bat +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.bat diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c index 4cdfad83132..4cdfad83132 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.sh b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh index d79df2fae08..d79df2fae08 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngminus/pnm2png.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngminus/pnm2png.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/README b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README index b2b1537db8e..b2b1537db8e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/README +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/README diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g01.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png Binary files differindex e31e1c7a635..e31e1c7a635 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g01.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g01.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g02.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png Binary files differindex 68809dd8fc0..68809dd8fc0 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g02.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g02.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g04.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png Binary files differindex 6fa089cb8a4..6fa089cb8a4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g04.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g04.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png Binary files differindex bf522eef001..bf522eef001 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png Binary files differindex 318ebcadf4f..318ebcadf4f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn0g16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn0g16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png Binary files differindex 21d2f91a868..21d2f91a868 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png Binary files differindex 1bd4a4d0e2c..1bd4a4d0e2c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p01.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png Binary files differindex a21db597746..a21db597746 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p01.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p01.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p02.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png Binary files differindex 1d0ab6197cc..1d0ab6197cc 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p02.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p02.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p04.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png Binary files differindex 6dc6eac83f3..6dc6eac83f3 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p04.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p04.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png Binary files differindex 0e07f483c0e..0e07f483c0e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png Binary files differindex 3bb0dd06b51..3bb0dd06b51 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png Binary files differindex 6dbee9fbdb9..6dbee9fbdb9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn4a16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn4a16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png Binary files differindex 61062308548..61062308548 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png Binary files differindex a9bf3cb4612..a9bf3cb4612 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/basn6a16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/basn6a16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn1g04.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png Binary files differindex 39a7050d27a..39a7050d27a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn1g04.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn1g04.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn2c16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png Binary files differindex dd3168e5c86..dd3168e5c86 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png Binary files differindex 0ede3574db0..0ede3574db0 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbbn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbbn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn2c16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png Binary files differindex 85cec395c01..85cec395c01 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn2c16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn2c16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png Binary files differindex 8cf2e6fb6aa..8cf2e6fb6aa 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbgn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbgn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbrn2c08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png Binary files differindex 5cca0d62104..5cca0d62104 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbrn2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbrn2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn1g16.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png Binary files differindex 99bdeed2b3b..99bdeed2b3b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn1g16.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn1g16.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png Binary files differindex eacab7a144c..eacab7a144c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbwn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbwn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbyn3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png Binary files differindex 656db0989ad..656db0989ad 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftbyn3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftbyn3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n1g08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png Binary files differindex 333465fcdc9..333465fcdc9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n1g08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n1g08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n2c08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png Binary files differindex fc6e42cb420..fc6e42cb420 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n2c08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n2c08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png Binary files differindex 69a69e58722..69a69e58722 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp0n3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp0n3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp1n3p08.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png Binary files differindex a6c9f35a862..a6c9f35a862 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/pngsuite/ftp1n3p08.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/pngsuite/ftp1n3p08.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c index 3998c6d2030..ef0984e4dfc 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.c @@ -1,12 +1,13 @@ -//------------------------------------- -// PNGFILE.C -- Image File Functions -//------------------------------------- - -// Copyright 2000, Willem van Schaik. -// -// This code is released under the libpng license. -// For conditions of distribution and use, see the disclaimer -// and license in png.h +/*------------------------------------- + * PNGFILE.C -- Image File Functions + *------------------------------------- + * + * Copyright 2000, Willem van Schaik. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ #include <windows.h> #include <commdlg.h> @@ -28,7 +29,7 @@ static png_structp png_ptr = NULL; static png_infop info_ptr = NULL; -// cexcept interface +/* cexcept interface */ static void png_cexcept_error(png_structp png_ptr, png_const_charp msg) @@ -43,7 +44,7 @@ png_cexcept_error(png_structp png_ptr, png_const_charp msg) } } -// Windows open-file functions +/* Windows open-file functions */ void PngFileInitialize (HWND hwnd) { @@ -57,13 +58,13 @@ void PngFileInitialize (HWND hwnd) ofn.lpstrCustomFilter = NULL; ofn.nMaxCustFilter = 0; ofn.nFilterIndex = 0; - ofn.lpstrFile = NULL; // Set in Open and Close functions + ofn.lpstrFile = NULL; /* Set in Open and Close functions */ ofn.nMaxFile = MAX_PATH; - ofn.lpstrFileTitle = NULL; // Set in Open and Close functions + ofn.lpstrFileTitle = NULL; /* Set in Open and Close functions */ ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrInitialDir = NULL; ofn.lpstrTitle = NULL; - ofn.Flags = 0; // Set in Open and Close functions + ofn.Flags = 0; /* Set in Open and Close functions */ ofn.nFileOffset = 0; ofn.nFileExtension = 0; ofn.lpstrDefExt = TEXT ("png"); @@ -92,7 +93,7 @@ BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName) return GetSaveFileName (&ofn); } -// PNG image handler functions +/* PNG image handler functions */ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor) @@ -109,7 +110,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, static png_byte **ppbRowPointers = NULL; int i; - // open the PNG input file + /* open the PNG input file */ if (!pstrFileName) { @@ -123,7 +124,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, return FALSE; } - // first check the eight byte PNG signature + /* first check the eight byte PNG signature */ fread(pbSig, 1, 8, pfFile); if (png_sig_cmp(pbSig, 0, 8)) @@ -132,7 +133,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, return FALSE; } - // create the two png(-info) structures + /* create the two png(-info) structures */ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, (png_error_ptr)png_cexcept_error, (png_error_ptr)NULL); @@ -153,7 +154,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, Try { - // initialize the png structure + /* initialize the png structure */ #ifdef PNG_STDIO_SUPPORTED png_init_io(png_ptr, pfFile); @@ -163,17 +164,17 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, png_set_sig_bytes(png_ptr, 8); - // read all PNG info up to image data + /* read all PNG info up to image data */ png_read_info(png_ptr, info_ptr); - // get width, height, bit-depth and color-type + /* get width, height, bit-depth and color-type */ png_get_IHDR(png_ptr, info_ptr, piWidth, piHeight, &iBitDepth, &iColorType, NULL, NULL, NULL); - // expand images of all color-type and bit-depth to 3x8 bit RGB images - // let the library process things like alpha, transparency, background + /* expand images of all color-type and bit-depth to 3x8-bit RGB */ + /* let the library process alpha, transparency, background, etc. */ #ifdef PNG_READ_16_TO_8_SUPPORTED if (iBitDepth == 16) @@ -193,7 +194,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, iColorType == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png_ptr); - // set the background color to draw transparent and alpha images over. + /* set the background color to draw transparent and alpha images over */ if (png_get_bKGD(png_ptr, info_ptr, &pBackground)) { png_set_background(png_ptr, pBackground, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); @@ -206,28 +207,28 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, pBkgColor = NULL; } - // if required set gamma conversion + /* if required set gamma conversion */ if (png_get_gAMA(png_ptr, info_ptr, &dGamma)) png_set_gamma(png_ptr, (double) 2.2, dGamma); - // after the transformations have been registered update info_ptr data + /* after the transformations are registered, update info_ptr data */ png_read_update_info(png_ptr, info_ptr); - // get again width, height and the new bit-depth and color-type + /* get again width, height and the new bit-depth and color-type */ png_get_IHDR(png_ptr, info_ptr, piWidth, piHeight, &iBitDepth, &iColorType, NULL, NULL, NULL); - // row_bytes is the width x number of channels + /* row_bytes is the width x number of channels */ ulRowBytes = png_get_rowbytes(png_ptr, info_ptr); ulChannels = png_get_channels(png_ptr, info_ptr); *piChannels = ulChannels; - // now we can allocate memory to store the image + /* now we can allocate memory to store the image */ if (pbImageData) { @@ -241,7 +242,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, } *ppbImageData = pbImageData; - // and allocate memory for an array of row-pointers + /* and allocate memory for an array of row-pointers */ if ((ppbRowPointers = (png_bytepp) malloc((*piHeight) * sizeof(png_bytep))) == NULL) @@ -249,25 +250,25 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData, png_error(png_ptr, "Visual PNG: out of memory"); } - // set the individual row-pointers to point at the correct offsets + /* set the individual row-pointers to point at the correct offsets */ for (i = 0; i < (*piHeight); i++) ppbRowPointers[i] = pbImageData + i * ulRowBytes; - // now we can go ahead and just read the whole image + /* now we can go ahead and just read the whole image */ png_read_image(png_ptr, ppbRowPointers); - // read the additional chunks in the PNG file (not really needed) + /* read the additional chunks in the PNG file (not really needed) */ png_read_end(png_ptr, NULL); - // and we're done + /* and we're done */ free (ppbRowPointers); ppbRowPointers = NULL; - // yepp, done + /* yepp, done */ } Catch (msg) @@ -301,7 +302,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData, static png_byte **ppbRowPointers = NULL; int i; - // open the PNG output file + /* open the PNG output file */ if (!pstrFileName) return FALSE; @@ -309,7 +310,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData, if (!(pfFile = fopen(pstrFileName, "wb"))) return FALSE; - // prepare the standard PNG structures + /* prepare the standard PNG structures */ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, (png_error_ptr)png_cexcept_error, (png_error_ptr)NULL); @@ -328,7 +329,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData, Try { - // initialize the png structure + /* initialize the png structure */ #ifdef PNG_STDIO_SUPPORTED png_init_io(png_ptr, pfFile); @@ -336,52 +337,52 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData, png_set_write_fn(png_ptr, (png_voidp)pfFile, png_write_data, png_flush); #endif - // we're going to write a very simple 3x8 bit RGB image + /* we're going to write a very simple 3x8-bit RGB image */ png_set_IHDR(png_ptr, info_ptr, iWidth, iHeight, ciBitDepth, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - // write the file header information + /* write the file header information */ png_write_info(png_ptr, info_ptr); - // swap the BGR pixels in the DiData structure to RGB + /* swap the BGR pixels in the DiData structure to RGB */ png_set_bgr(png_ptr); - // row_bytes is the width x number of channels + /* row_bytes is the width x number of channels */ ulRowBytes = iWidth * ciChannels; - // we can allocate memory for an array of row-pointers + /* we can allocate memory for an array of row-pointers */ if ((ppbRowPointers = (png_bytepp) malloc(iHeight * sizeof(png_bytep))) == NULL) Throw "Visualpng: Out of memory"; - // set the individual row-pointers to point at the correct offsets + /* set the individual row-pointers to point at the correct offsets */ for (i = 0; i < iHeight; i++) ppbRowPointers[i] = pDiData + i * (((ulRowBytes + 3) >> 2) << 2); - // write out the entire image data in one call + /* write out the entire image data in one call */ png_write_image (png_ptr, ppbRowPointers); - // write the additional chunks to the PNG file (not really needed) + /* write the additional chunks to the PNG file (not really needed) */ png_write_end(png_ptr, info_ptr); - // and we're done + /* and we're done */ free (ppbRowPointers); ppbRowPointers = NULL; - // clean up after the write, and free any memory allocated + /* clean up after the write, and free any memory allocated */ png_destroy_write_struct(&png_ptr, (png_infopp) NULL); - // yepp, done + /* yepp, done */ } Catch (msg) @@ -443,6 +444,7 @@ png_flush(png_structp png_ptr) #endif -//----------------- -// end of source -//----------------- +/*----------------- + * end of source + *----------------- + */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h index dc6bbb409f6..32181a4eacc 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/PngFile.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/PngFile.h @@ -1,12 +1,12 @@ -//------------------------------------------ -// PNGFILE.H -- Header File for pngfile.c -//------------------------------------------ +/*------------------------------------------*/ +/* PNGFILE.H -- Header File for pngfile.c*/ +/*------------------------------------------*/ -// Copyright 2000, Willem van Schaik. +/* Copyright 2000, Willem van Schaik.*/ -// This code is released under the libpng license. -// For conditions of distribution and use, see the disclaimer -// and license in png.h +/* This code is released under the libpng license.*/ +/* For conditions of distribution and use, see the disclaimer*/ +/* and license in png.h*/ #include <stdio.h> #include <stdlib.h> diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/README.txt b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt index 72c5cba1790..72c5cba1790 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/README.txt diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.c b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c index cb8ad7f3a58..009f120e356 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.c +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.c @@ -1,41 +1,42 @@ -//------------------------------------ -// VisualPng.C -- Shows a PNG image -//------------------------------------ +/*------------------------------------ + * VisualPng.C -- Shows a PNG image + *------------------------------------ + * + * Copyright 2000, Willem van Schaik. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ -// Copyright 2000, Willem van Schaik. +/* switches */ -// This code is released under the libpng license. -// For conditions of distribution and use, see the disclaimer -// and license in png.h - -// switches - -// defines +/* defines */ #define PROGNAME "VisualPng" #define LONGNAME "Win32 Viewer for PNG-files" #define VERSION "1.0 of 2000 June 07" -// constants +/* constants */ #define MARGIN 8 -// standard includes +/* standard includes */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> -// application includes +/* application includes */ #include "png.h" #include "pngfile.h" #include "resource.h" -// macros +/* macros */ -// function prototypes +/* function prototypes */ LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ; @@ -65,14 +66,14 @@ BOOL FillBitmap ( BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels, BOOL bStretched); -// a few global variables +/* a few global variables */ static char *szProgName = PROGNAME; static char *szAppName = LONGNAME; static char *szIconName = PROGNAME; static char szCmdFileName [MAX_PATH]; -// MAIN routine +/* MAIN routine */ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) @@ -90,7 +91,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon (hInstance, szIconName) ; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); - wndclass.hbrBackground = NULL; // (HBRUSH) GetStockObject (GRAY_BRUSH); + wndclass.hbrBackground = NULL; /* (HBRUSH) GetStockObject (GRAY_BRUSH); */ wndclass.lpszMenuName = szProgName; wndclass.lpszClassName = szProgName; @@ -101,7 +102,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, return 0; } - // if filename given on commandline, store it + /* if filename given on commandline, store it */ if ((szCmdLine != NULL) && (*szCmdLine != '\0')) if (szCmdLine[0] == '"') strncpy (szCmdFileName, szCmdLine + 1, strlen(szCmdLine) - 2); @@ -110,20 +111,20 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, else strcpy (szCmdFileName, ""); - // calculate size of window-borders + /* calculate size of window-borders */ ixBorders = 2 * (GetSystemMetrics (SM_CXBORDER) + GetSystemMetrics (SM_CXDLGFRAME)); iyBorders = 2 * (GetSystemMetrics (SM_CYBORDER) + GetSystemMetrics (SM_CYDLGFRAME)) + GetSystemMetrics (SM_CYCAPTION) + GetSystemMetrics (SM_CYMENUSIZE) + - 1; /* WvS: don't ask me why? */ + 1; /* WvS: don't ask me why? */ hwnd = CreateWindow (szProgName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 512 + 2 * MARGIN + ixBorders, 384 + 2 * MARGIN + iyBorders, -// CW_USEDEFAULT, CW_USEDEFAULT, +/* CW_USEDEFAULT, CW_USEDEFAULT, */ NULL, NULL, hInstance, NULL); ShowWindow (hwnd, iCmdShow); @@ -180,29 +181,29 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, strcpy (szImgPathName, ""); - // in case we process file given on command-line + /* in case we process file given on command-line */ if (szCmdFileName[0] != '\0') { strcpy (szImgPathName, szCmdFileName); - // read the other png-files in the directory for later - // next/previous commands + /* read the other png-files in the directory for later */ + /* next/previous commands */ BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount, &iPngFileIndex); - // load the image from file + /* load the image from file */ if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor)) return 0; - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -214,11 +215,11 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, cxWinSize = LOWORD (lParam); cyWinSize = HIWORD (lParam); - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -242,28 +243,28 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, { case IDM_FILE_OPEN: - // show the File Open dialog box + /* show the File Open dialog box */ if (!PngFileOpenDlg (hwnd, szImgPathName, szTitleName)) return 0; - // read the other png-files in the directory for later - // next/previous commands + /* read the other png-files in the directory for later */ + /* next/previous commands */ BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount, &iPngFileIndex); - // load the image from file + /* load the image from file */ if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor)) return 0; - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -272,12 +273,12 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, case IDM_FILE_SAVE: - // show the File Save dialog box + /* show the File Save dialog box */ if (!PngFileSaveDlg (hwnd, szImgPathName, szTitleName)) return 0; - // save the PNG to a disk file + /* save the PNG to a disk file */ SetCursor (LoadCursor (NULL, IDC_WAIT)); ShowCursor (TRUE); @@ -295,7 +296,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, case IDM_FILE_NEXT: - // read next entry in the directory + /* read next entry in the directory */ if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex, NULL, szImgPathName)) @@ -303,17 +304,17 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, if (strcmp (szImgPathName, "") == 0) return 0; - // load the image from file + /* load the image from file */ if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor)) return 0; - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -323,7 +324,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, case IDM_FILE_PREVIOUS: - // read previous entry in the directory + /* read previous entry in the directory */ if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex, szImgPathName, NULL)) @@ -332,17 +333,17 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, if (strcmp (szImgPathName, "") == 0) return 0; - // load the image from file + /* load the image from file */ if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor)) return 0; - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -352,9 +353,9 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, case IDM_FILE_EXIT: - // more cleanup needed... + /* more cleanup needed... */ - // free image buffer + /* free image buffer */ if (pDib != NULL) { @@ -362,7 +363,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, pDib = NULL; } - // free file-list + /* free file-list */ if (pPngFileList != NULL) { @@ -370,7 +371,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, pPngFileList = NULL; } - // let's go ... + /* let's go ... */ exit (0); @@ -383,11 +384,11 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, else CheckMenuItem (hMenu, IDM_OPTIONS_STRETCH, MF_UNCHECKED); - // invalidate the client area for later update + /* invalidate the client area for later update */ InvalidateRect (hwnd, NULL, TRUE); - // display the PNG into the DIBitmap + /* display the PNG into the DIBitmap */ DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize, pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched); @@ -398,7 +399,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, DialogBox (hInstance, TEXT ("AboutBox"), hwnd, AboutDlgProc) ; return 0; - } // end switch + } /* end switch */ break; @@ -450,10 +451,10 @@ BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message, return FALSE ; } -//--------------- -// CenterAbout -//--------------- - +/*--------------- + * CenterAbout + *--------------- + */ BOOL CenterAbout (HWND hwndChild, HWND hwndParent) { RECT rChild, rParent, rWorkArea; @@ -461,19 +462,19 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent) int xNew, yNew; BOOL bResult; - // Get the Height and Width of the child window + /* Get the Height and Width of the child window */ GetWindowRect (hwndChild, &rChild); wChild = rChild.right - rChild.left; hChild = rChild.bottom - rChild.top; - // Get the Height and Width of the parent window + /* Get the Height and Width of the parent window */ GetWindowRect (hwndParent, &rParent); wParent = rParent.right - rParent.left; hParent = rParent.bottom - rParent.top; - // Get the limits of the 'workarea' + /* Get the limits of the 'workarea' */ bResult = SystemParametersInfo( - SPI_GETWORKAREA, // system parameter to query or set + SPI_GETWORKAREA, /* system parameter to query or set */ sizeof(RECT), &rWorkArea, 0); @@ -483,7 +484,7 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent) rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN); } - // Calculate new X position, then adjust for workarea + /* Calculate new X position, then adjust for workarea */ xNew = rParent.left + ((wParent - wChild) /2); if (xNew < rWorkArea.left) { xNew = rWorkArea.left; @@ -491,7 +492,7 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent) xNew = rWorkArea.right - wChild; } - // Calculate new Y position, then adjust for workarea + /* Calculate new Y position, then adjust for workarea */ yNew = rParent.top + ((hParent - hChild) /2); if (yNew < rWorkArea.top) { yNew = rWorkArea.top; @@ -499,15 +500,15 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent) yNew = rWorkArea.bottom - hChild; } - // Set it, and return + /* Set it, and return */ return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER); } -//---------------- -// BuildPngList -//---------------- - +/*---------------- + * BuildPngList + *---------------- + */ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, int *pFileIndex) { @@ -523,7 +524,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, int i, ii; int j, jj; - // free previous file-list + /* free previous file-list */ if (*ppFileList != NULL) { @@ -531,7 +532,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, *ppFileList = NULL; } - // extract foldername, filename and search-name + /* extract foldername, filename and search-name */ strcpy (szImgPathName, pstrPathName); strcpy (szImgFileName, strrchr (pstrPathName, '\\') + 1); @@ -540,7 +541,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, *(strrchr (szImgFindName, '\\') + 1) = '\0'; strcat (szImgFindName, "*.png"); - // first cycle: count number of files in directory for memory allocation + /* first cycle: count number of files in directory for memory allocation */ *pFileCount = 0; @@ -554,11 +555,11 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, } FindClose(hFind); - // allocation memory for file-list + /* allocation memory for file-list */ *ppFileList = (TCHAR *) malloc (*pFileCount * MAX_PATH); - // second cycle: read directory and store filenames in file-list + /* second cycle: read directory and store filenames in file-list */ hFind = FindFirstFile(szImgFindName, &finddata); bOk = (hFind != (HANDLE) -1); @@ -580,7 +581,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, } FindClose(hFind); - // finally we must sort the file-list + /* finally we must sort the file-list */ for (i = 0; i < *pFileCount - 1; i++) { @@ -594,7 +595,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, strcpy (*ppFileList + jj, *ppFileList + ii); strcpy (*ppFileList + ii, szTmp); - // check if this was the current image that we moved + /* check if this was the current image that we moved */ if (*pFileIndex == i) *pFileIndex = j; @@ -608,9 +609,10 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount, return TRUE; } -//---------------- -// SearchPngList -//---------------- +/*---------------- + * SearchPngList + *---------------- + */ BOOL SearchPngList ( TCHAR *pFileList, int FileCount, int *pFileIndex, @@ -618,7 +620,7 @@ BOOL SearchPngList ( { if (FileCount > 0) { - // get previous entry + /* get previous entry */ if (pstrPrevName != NULL) { @@ -630,7 +632,7 @@ BOOL SearchPngList ( strcpy (pstrPrevName, pFileList + (*pFileIndex * MAX_PATH)); } - // get next entry + /* get next entry */ if (pstrNextName != NULL) { @@ -650,9 +652,10 @@ BOOL SearchPngList ( } } -//----------------- -// LoadImageFile -//----------------- +/*----------------- + * LoadImageFile + *----------------- + */ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName, png_byte **ppbImage, int *pxImgSize, int *pyImgSize, @@ -660,7 +663,7 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName, { static TCHAR szTmp [MAX_PATH]; - // if there's an existing PNG, free the memory + /* if there's an existing PNG, free the memory */ if (*ppbImage) { @@ -668,7 +671,7 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName, *ppbImage = NULL; } - // Load the entire PNG into memory + /* Load the entire PNG into memory */ SetCursor (LoadCursor (NULL, IDC_WAIT)); ShowCursor (TRUE); @@ -694,10 +697,10 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName, return TRUE; } -//---------------- -// DisplayImage -//---------------- - +/*---------------- + * DisplayImage + *---------------- + */ BOOL DisplayImage (HWND hwnd, BYTE **ppDib, BYTE **ppDiData, int cxWinSize, int cyWinSize, BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels, @@ -705,14 +708,14 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib, { BYTE *pDib = *ppDib; BYTE *pDiData = *ppDiData; - // BITMAPFILEHEADER *pbmfh; + /* BITMAPFILEHEADER *pbmfh; */ BITMAPINFOHEADER *pbmih; WORD wDIRowBytes; png_color bkgBlack = {0, 0, 0}; png_color bkgGray = {127, 127, 127}; png_color bkgWhite = {255, 255, 255}; - // allocate memory for the Device Independant bitmap + /* allocate memory for the Device Independant bitmap */ wDIRowBytes = (WORD) ((3 * cxWinSize + 3L) >> 2) << 2; @@ -733,7 +736,7 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib, *ppDib = pDib; memset (pDib, 0, sizeof(BITMAPINFOHEADER)); - // initialize the dib-structure + /* initialize the dib-structure */ pbmih = (BITMAPINFOHEADER *) pDib; pbmih->biSize = sizeof(BITMAPINFOHEADER); @@ -745,11 +748,11 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib, pDiData = pDib + sizeof(BITMAPINFOHEADER); *ppDiData = pDiData; - // first fill bitmap with gray and image border + /* first fill bitmap with gray and image border */ InitBitmap (pDiData, cxWinSize, cyWinSize); - // then fill bitmap with image + /* then fill bitmap with image */ if (pbImage) { @@ -762,16 +765,16 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib, return TRUE; } -//-------------- -// InitBitmap -//-------------- - +/*-------------- + * InitBitmap + *-------------- + */ BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize) { BYTE *dst; int x, y, col; - // initialize the background with gray + /* initialize the background with gray */ dst = pDiData; for (y = 0; y < cyWinSize; y++) @@ -779,13 +782,13 @@ BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize) col = 0; for (x = 0; x < cxWinSize; x++) { - // fill with GRAY + /* fill with GRAY */ *dst++ = 127; *dst++ = 127; *dst++ = 127; col += 3; } - // rows start on 4 byte boundaries + /* rows start on 4 byte boundaries */ while ((col % 4) != 0) { dst++; @@ -796,10 +799,10 @@ BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize) return TRUE; } -//-------------- -// FillBitmap -//-------------- - +/*-------------- + * FillBitmap + *-------------- + */ BOOL FillBitmap ( BYTE *pDiData, int cxWinSize, int cyWinSize, BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels, @@ -824,11 +827,12 @@ BOOL FillBitmap ( cxNewSize = cxWinSize - 2 * MARGIN; cyNewSize = cyWinSize - 2 * MARGIN; - // stretch the image to it's window determined size + /* stretch the image to it's window determined size */ - // the following two are the same, but the first has side-effects - // because of rounding -// if ((cyNewSize / cxNewSize) > (cyImgSize / cxImgSize)) + /* the following two are mathematically the same, but the first + * has side-effects because of rounding + */ +/* if ((cyNewSize / cxNewSize) > (cyImgSize / cxImgSize)) */ if ((cyNewSize * cxImgSize) > (cyImgSize * cxNewSize)) { cyNewSize = cxNewSize * cyImgSize / cxImgSize; @@ -867,12 +871,12 @@ BOOL FillBitmap ( } } - // calculate row-bytes + /* calculate row-bytes */ wImgRowBytes = cImgChannels * cxNewSize; wDIRowBytes = (WORD) ((cDIChannels * cxWinSize + 3L) >> 2) << 2; - // copy image to screen + /* copy image to screen */ for (yImg = 0, yWin = cyImgPos; yImg < cyNewSize; yImg++, yWin++) { @@ -888,7 +892,7 @@ BOOL FillBitmap ( r = *src++; g = *src++; b = *src++; - *dst++ = b; /* note the reverse order */ + *dst++ = b; /* note the reverse order */ *dst++ = g; *dst++ = r; if (cImgChannels == 4) @@ -898,7 +902,7 @@ BOOL FillBitmap ( } } - // free memory + /* free memory */ if (pStretchedImage != NULL) { @@ -908,28 +912,28 @@ BOOL FillBitmap ( } - // process the image not-stretched + /* process the image not-stretched */ else { - // calculate the central position + /* calculate the central position */ cxImgPos = (cxWinSize - cxImgSize) / 2; cyImgPos = (cyWinSize - cyImgSize) / 2; - // check for image larger than window + /* check for image larger than window */ if (cxImgPos < MARGIN) cxImgPos = MARGIN; if (cyImgPos < MARGIN) cyImgPos = MARGIN; - // calculate both row-bytes + /* calculate both row-bytes */ wImgRowBytes = cImgChannels * cxImgSize; wDIRowBytes = (WORD) ((cDIChannels * cxWinSize + 3L) >> 2) << 2; - // copy image to screen + /* copy image to screen */ for (yImg = 0, yWin = cyImgPos; yImg < cyImgSize; yImg++, yWin++) { @@ -945,7 +949,7 @@ BOOL FillBitmap ( r = *src++; g = *src++; b = *src++; - *dst++ = b; /* note the reverse order */ + *dst++ = b; /* note the reverse order */ *dst++ = g; *dst++ = r; if (cImgChannels == 4) @@ -959,6 +963,7 @@ BOOL FillBitmap ( return TRUE; } -//----------------- -// end of source -//----------------- +/*----------------- + * end of source + *----------------- + */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsp b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp index 741ef6ce76f..741ef6ce76f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsp +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsp diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsw b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw index a30e1cc1cdb..a30e1cc1cdb 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.dsw +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.dsw diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.ico b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico Binary files differindex 68aa3719fb5..68aa3719fb5 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.ico +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.ico diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.png b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png Binary files differindex c6aa80a9bfa..c6aa80a9bfa 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.png +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.rc b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc index 6e0623a73cf..6e0623a73cf 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/VisualPng.rc +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/VisualPng.rc diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/cexcept.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h index 5f45d769758..5f45d769758 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/cexcept.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/cexcept.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/resource.h b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h index b62176d1dca..b62176d1dca 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/contrib/visupng/resource.h +++ b/Build/source/libs/libpng/libpng-1.5.5/contrib/visupng/resource.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/example.c b/Build/source/libs/libpng/libpng-1.5.5/example.c index c0d27f48735..c0d27f48735 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/example.c +++ b/Build/source/libs/libpng/libpng-1.5.5/example.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/libpng-config.in b/Build/source/libs/libpng/libpng-1.5.5/libpng-config.in index 69bf8e33f0b..69bf8e33f0b 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/libpng-config.in +++ b/Build/source/libs/libpng/libpng-1.5.5/libpng-config.in diff --git a/Build/source/libs/libpng/libpng-1.5.4/libpng-manual.txt b/Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt index c91b99cf60d..eb6bacb86ad 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/libpng-manual.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.4 - July 7, 2011 + libpng version 1.5.5 - September 22, 2011 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.4 - July 7, 2011 + libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -107,7 +107,8 @@ PNG file. At one time, the fields of png_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result a set of interface functions for png_info (the png_get_*() and png_set_*() -functions) was developed. +functions) was developed, and direct access to the png_info fields was +deprecated.. The png_struct structure is the object used by the library to decode a single image. As of 1.5.0 this structure is also not exposed. @@ -116,14 +117,23 @@ Almost all libpng APIs require a pointer to a png_struct as the first argument. Many (in particular the png_set and png_get APIs) also require a pointer to png_info as the second argument. Some application visible macros defined in png.h designed for basic data access (reading and writing -integers in the PNG format) break this rule, but it's almost always safe -to assume that a (png_struct*) has to be passed to call an API function. +integers in the PNG format) don't take a png_info pointer, but it's almost +always safe to assume that a (png_struct*) has to be passed to call an API +function. + +You can have more than one png_info structure associated with an image, +as illustrated in pngtest.c, one for information valid prior to the +IDAT chunks and another (called "end_info" below) for things after them. The png.h header file is an invaluable reference for programming with libpng. And while I'm on the topic, make sure you include the libpng header file: #include <png.h> +and also (as of libpng-1.5.0) the zlib header file, if you need it: + +#include <zlib.h> + Types The png.h header file defines a number of integral types used by the @@ -137,9 +147,9 @@ the value by multiplying by 100,000. As of libpng 1.5.0 a convenience macro PNG_FP_1 is defined in png.h along with a type (png_fixed_point) which is simply (png_int_32). -All APIs that take (double) arguments also have an matching API that +All APIs that take (double) arguments also have a matching API that takes the corresponding fixed point integer arguments. The fixed point -API has the same name as the floating point one with _fixed appended. +API has the same name as the floating point one with "_fixed" appended. The actual range of values permitted in the APIs is frequently less than the full range of (png_fixed_point) (-21474 to +21474). When APIs require a non-negative argument the type is recorded as png_uint_32 above. Consult @@ -157,6 +167,10 @@ preprocessing directives of the form: #ifdef PNG_feature_SUPPORTED declare-function #endif + ... + #ifdef PNG_feature_SUPPORTED + use-function + #endif The library can be built without support for these APIs, although a standard build will have all implemented APIs. Application programs @@ -165,7 +179,7 @@ portability. From libpng 1.5.0 the feature macros set during the build of libpng are recorded in the header file "pnglibconf.h" and this file is always included by png.h. -If you don't need to change the library configuration from the default skip to +If you don't need to change the library configuration from the default, skip to the next section ("Reading"). Notice that some of the makefiles in the 'scripts' directory and (in 1.5.0) all @@ -197,24 +211,25 @@ A variety of methods exist to build libpng. Not all of these support reconfiguration of pnglibconf.h. To reconfigure pnglibconf.h it must either be rebuilt from scripts/pnglibconf.dfa using awk or it must be edited by hand. -Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt and changing -the lines defining the supported features, paying very close attention to -the 'option' information in scripts/pnglibconf.dfa that describes those -features and their requirements. This is easy to get wrong. +Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt to +pnglibconf.h and changing the lines defining the supported features, paying +very close attention to the 'option' information in scripts/pnglibconf.dfa +that describes those features and their requirements. This is easy to get +wrong. B. Configuration using DFA_XTRA Rebuilding from pnglibconf.dfa is easy if a functioning 'awk', or a later variant such as 'nawk' or 'gawk', is available. The configure build will automatically find an appropriate awk and build pnglibconf.h. -scripts/pnglibconf.mak contains a set of make rules for doing the same thing if -configure is not used, and many of the makefiles in the scripts directory use -this approach. +The scripts/pnglibconf.mak file contains a set of make rules for doing the +same thing if configure is not used, and many of the makefiles in the scripts +directory use this approach. -When rebuilding simply write new file containing changed options and set +When rebuilding simply write a new file containing changed options and set DFA_XTRA to the name of this file. This causes the build to append the new file -to the end of scripts/pnglibconf.dfa. pngusr.dfa should contain lines of the -following forms: +to the end of scripts/pnglibconf.dfa. The pngusr.dfa file should contain lines +of the following forms: everything = off @@ -238,12 +253,16 @@ source code. Most of these values have performance implications for the library but most of them have no visible effect on the API. Some can also be overridden from the API. +This method of building a customized pnglibconf.h is illustrated in +contrib/pngminim/*. See the "$(PNGCONF):" target in the makefile and +pngusr.dfa in these directories. + C. Configuration using PNG_USR_CONFIG If -DPNG_USR_CONFIG is added to the CFLAGS when pnglibconf.h is built the file pngusr.h will automatically be included before the options in -scripts/pnglibconf.dfa are processed. pngusr.h should contain only macro -definitions turning features on or off or setting settings. +scripts/pnglibconf.dfa are processed. Your pngusr.h file should contain only +macro definitions turning features on or off or setting settings. Apart from the global setting "everything = off" all the options listed above can be set using macros in pngusr.h: @@ -274,6 +293,9 @@ examine the intermediate file pnglibconf.dfn to find the full set of dependency information for each setting and option. Simply locate the feature in the file and read the C comments that precede it. +This method is also illustrated in the contrib/pngminim/* makefiles and +pngusr.h. + III. Reading We'll now walk you through the possible functions to call when reading @@ -557,6 +579,8 @@ according to the "keep" directive. If a chunk is named in successive instances of png_set_keep_unknown_chunks(), the final instance will take precedence. The IHDR and IEND chunks should not be named in chunk_list; if they are, libpng will process them normally anyway. +If you know that your application will never make use of some particular +chunks, use PNG_HANDLE_CHUNK_NEVER (or 1) as demonstrated below. Here is an example of the usage of png_set_keep_unknown_chunks(), where the private "vpAg" chunk will later be processed by a user chunk @@ -653,7 +677,8 @@ called before the PNG file header had been read and png_set_alpha_mode() did not exist. If you need to support versions prior to libpng-1.5.4 test the version number -and follow the procedures described in the appropriate manual page. +as illustrated below using "PNG_LIBPNG_VER >= 10504" and follow the procedures +described in the appropriate manual page. You give libpng the encoding expected by your system expressed as a 'gamma' value. You can also specify a default encoding for the PNG file in @@ -666,7 +691,7 @@ or you can use the fixed point equivalent: png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma, PNG_FP_1/screen_gamma); -If you don't know the gamma for you system it is probably 2.2 - a good +If you don't know the gamma for your system it is probably 2.2 - a good approximation to the IEC standard for display systems (sRGB). If images are too contrasty or washed out you got the value wrong - check your system documentation! @@ -695,14 +720,18 @@ channel. To display these files correctly you need to compose the data onto a suitable background, as described in the PNG specification. Libpng only supports composing onto a single color (using png_set_background; -see below.) Otherwise you must do the composition yourself and, in this case, +see below). Otherwise you must do the composition yourself and, in this case, you may need to call png_set_alpha_mode: +#if PNG_LIBPNG_VER >= 10504 png_set_alpha_mode(png_ptr, mode, screen_gamma); +#else + png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma); +#endif -The screen_gamma value is the same as the argument to png_set_gamma, however how -it affects the output depends on the mode. png_set_alpha_mode() sets the file -gamma default to 1/screen_gamma, so normally you don't need to call +The screen_gamma value is the same as the argument to png_set_gamma; however, +how it affects the output depends on the mode. png_set_alpha_mode() sets the +file gamma default to 1/screen_gamma, so normally you don't need to call png_set_gamma. If you need different defaults call png_set_gamma() before png_set_alpha_mode() - if you call it after it will override the settings made by png_set_alpha_mode(). @@ -729,10 +758,11 @@ scaled, linear encoded, pre-multiplied component values must be used! The remaining modes assume you don't need to do any further color correction or -that if you do your color correction software knows all about alpha (it +that if you do, your color correction software knows all about alpha (it probably doesn't!) - PNG_ALPHA_STANDARD: The data libpng produces is encoded in the standard way + PNG_ALPHA_STANDARD: The data libpng produces +is encoded in the standard way assumed by most correctly written graphics software. The gamma encoding will be removed by libpng and the linear component values will be pre-multiplied by the @@ -762,7 +792,8 @@ dynamic range. To avoid problems, and if your software supports it, use png_set_expand_16() to force all components to 16 bits. - PNG_ALPHA_OPTIMIZED: This mode is the same as PNG_ALPHA_STANDARD except that + PNG_ALPHA_OPTIMIZED: This mode is the same +as PNG_ALPHA_STANDARD except that completely opaque pixels are gamma encoded according to the screen_gamma value. Pixels with alpha less than 1.0 will still have linear components. @@ -782,10 +813,11 @@ representation of non-opaque pixels are irrelevant. You can also try this format if your software is broken; it might look better. - PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD however all component values, + PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD; +however, all component values, including the alpha channel are gamma encoded. This is an appropriate format to try if your software, or more -likely hardware, is totally broken: if it performs +likely hardware, is totally broken, i.e., if it performs linear arithmetic directly on gamma encoded values. In most cases of broken software or hardware the bug in the final display @@ -801,14 +833,14 @@ them, there are three recommended ways of using png_set_alpha_mode(): screen_gamma); You can do color correction on the result (libpng does not currently -support color correction internally.) When you handle the alpha channel +support color correction internally). When you handle the alpha channel you need to undo the gamma encoding and multiply out the alpha. png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, screen_gamma); png_set_expand_16(png_ptr); -If you are using the high level interface don't call png_set_expand_16(); +If you are using the high level interface, don't call png_set_expand_16(); instead pass PNG_TRANSFORM_EXPAND_16 to the interface. With this mode you can't do color correction, but you can do arithmetic, @@ -820,7 +852,7 @@ including composition and scaling, on the data without further processing. You can avoid the expansion to 16-bit components with this mode, but you lose the ability to scale the image or perform other linear arithmetic. All you can do is compose the result onto a matching output. Since this -mode is libpng specific you also need to write your own composition +mode is libpng-specific you also need to write your own composition software. If you don't need, or can't handle, the alpha channel you can call @@ -833,12 +865,12 @@ transparent parts of this image. The background_color is an RGB or grayscale value according to the data format libpng will produce for you. Because you don't yet know the format of the PNG -file if you call png_set_background at this point you must arrange for the +file, if you call png_set_background at this point you must arrange for the format produced by libpng to always have 8-bit or 16-bit components and then store the color as an 8-bit or 16-bit color as appropriate. The color contains separate gray and RGB component values, so you can let libpng produce gray or RGB output according to the input format, but low bit depth grayscale images -must always be converted to at least 8-bit format. (Even low low bit depth +must always be converted to at least 8-bit format. (Even though low bit depth grayscale images can't have an alpha channel they can have a transparent color!) @@ -977,7 +1009,7 @@ provided by an earlier call to png_set_gamma or png_set_alpha_mode. 2) Prior to libpng-1.5.4 the background color from a bKGd chunk. This damages the information provided by an earlier call to png_set_background -resulting in expected behavior. Libpng-1.5.4 no longer does this. +resulting in unexpected behavior. Libpng-1.5.4 no longer does this. 3) The number of significant bits in each component value. Libpng uses this to optimize gamma handling by reducing the internal lookup table sizes. @@ -1115,6 +1147,28 @@ pointer into the info_ptr is returned for any complex types. int_file_gamma - 100,000 times the gamma at which the file is written + png_get_cHRM(png_ptr, info_ptr, &white_x, &white_y, &red_x, &red_y, + &green_x, &green_y, &blue_x, &blue_y) + png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z, &green_X, + &green_Y, &green_Z, &blue_X, &blue_Y, &blue_Z) + png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x, &int_white_y, + &int_red_x, &int_red_y, &int_green_x, &int_green_y, + &int_blue_x, &int_blue_y) + png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, &int_red_X, &int_red_Y, + &int_red_Z, &int_green_X, &int_green_Y, &int_green_Z, + &int_blue_X, &int_blue_Y, &int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the chromaticities + of the end points and the white point. (PNG_INFO_cHRM) + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the encoding end + points - the CIE tristimulus specification of the intended + color of the red, green and blue channels in the PNG RGB + data. The white point is simply the sum of the three end + points. (PNG_INFO_cHRM) + png_get_sRGB(png_ptr, info_ptr, &srgb_intent); file_srgb_intent - the rendering intent (PNG_INFO_sRGB) @@ -1173,7 +1227,8 @@ pointer into the info_ptr is returned for any complex types. png_get_bKGD(png_ptr, info_ptr, &background); - background - background color (PNG_VALID_bKGD) + background - background color (of type + png_color_16p) (PNG_VALID_bKGD) valid 16-bit red, green and blue values, regardless of color_type @@ -1212,6 +1267,8 @@ pointer into the info_ptr is returned for any complex types. Note that the itxt_length, lang, and lang_key members of the text_ptr structure only exist when the library is built with iTXt chunk support. + Prior to libpng-1.4.0, the default build was + without iTXt chunk support. num_text - number of comments (same as num_comments; you can put NULL here @@ -1236,10 +1293,10 @@ pointer into the info_ptr is returned for any complex types. &unit_type); offset_x - positive offset from the left edge - of the screen + of the screen (can be negative) offset_y - positive offset from the top edge - of the screen + of the screen (can be negative) unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER @@ -1271,6 +1328,7 @@ pointer into the info_ptr is returned for any complex types. unit - physical scale units (an integer) width - width of a pixel in physical scale units + (expressed as a string) height - height of a pixel in physical scale units (width and height are strings like "2.54") @@ -1293,6 +1351,12 @@ pointer into the info_ptr is returned for any complex types. chunks were read from the PNG file or inserted with the png_set_unknown_chunks() function. + The value of "location" is a bitwise "or" of + + PNG_HAVE_IHDR (0x01) + PNG_HAVE_PLTE (0x02) + PNG_AFTER_IDAT (0x08) + The data from the pHYs chunk can be retrieved in several convenient forms: @@ -1437,7 +1501,7 @@ As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was added. It expands the sample depth without changing tRNS to alpha. As of libpng version 1.5.2, png_set_expand_16() was added. It behaves as -png_set_expand(), however, the resultant channels have 16 bits rather than 8. +png_set_expand(); however, the resultant channels have 16 bits rather than 8. Use this when the output color or gray channels are made linear to avoid fairly severe accuracy loss. @@ -1448,7 +1512,14 @@ PNG can have files with 16 bits per channel. If you only can handle 8 bits per channel, this will strip the pixels down to 8-bit. if (bit_depth == 16) +#if PNG_LIBPNG_VER >= 10504 png_set_scale_16(png_ptr); +#else + png_set_strip_16(png_ptr); +#endif + +(The more accurate "png_set_scale_16()" API became available in libpng version +1.5.4). If you need to process the alpha channel on the image separately from the image data (for example if you convert it to a bitmap mask) it is possible to have @@ -1626,19 +1697,28 @@ It will return a png_byte that is zero if the image was gray or will be silently converted to grayscale, using the green channel data for sBIT, regardless of the error_action setting. -The default values come from the PNG file cHRM chunk if present, otherwise the +The default values come from the PNG file cHRM chunk if present; otherwise, the defaults correspond to the ITU-R recommendation 709, and also the sRGB color space, as recommended in the Charles Poynton's Colour FAQ, <http://www.poynton.com/>, in section 9: <http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC9> + Y = 0.2126 * R + 0.7152 * G + 0.0722 * B + +Previous versions of this document, 1998 through 2002, recommended a slightly +different formula: + Y = 0.212671 * R + 0.715160 * G + 0.072169 * B +Libpng uses an integer approximation: + + Y = (6968 * R + 23434 * G + 2366 * B)/32768 + The calculation is done in a linear colorspace, if the image gamma can be determined. -The png_set_background() function has been described already, it tells libpng to +The png_set_background() function has been described already; it tells libpng to composite images with alpha or simple transparency against the supplied background color. For compatibility with versions of libpng earlier than libpng-1.5.4 it is recommended that you call the function after reading the file @@ -1648,9 +1728,10 @@ If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), you may use this color, or supply another color more suitable for the current display (e.g., the background color from a web page). You need to tell libpng how the color is represented, both the format of the -component values in the color (the number of bits) and the gamme encoding of the +component values in the color (the number of bits) and the gamma encoding of the color. The function takes two arguments, background_gamma_mode and need_expand -to convey this information, however only two combinations are like to be useful: +to convey this information, however only two combinations are likely to be +useful: png_color_16 my_background; png_color_16p image_background; @@ -1662,7 +1743,6 @@ to convey this information, however only two combinations are like to be useful: png_set_background(png_ptr, &my_background, PNG_BACKGROUND_GAMMA_SCREEN, 0/*do not expand*/, 1); - The second call was described above - my_background is in the format of the final, display, output produced by libpng. Because you now know the format of the PNG it is possible to avoid the need to choose either 8-bit or 16-bit @@ -1701,9 +1781,9 @@ file has more entries then will fit on your screen, png_set_quantize() will do that. Note that this is a simple match quantization that merely finds the closest color available. This should work fairly well with optimized palettes, but fairly badly with linear color cubes. If you -pass a palette that is larger then maximum_colors, the file will +pass a palette that is larger than maximum_colors, the file will reduce the number of colors in the palette so it will fit into -maximum_colors. If there is a histogram, it will use it to make +maximum_colors. If there is a histogram, libpng will use it to make more intelligent choices when reducing the palette. If there is no histogram, it may not do as good a job. @@ -1775,7 +1855,7 @@ after all of the other transformations have been processed. Take care with interlaced images if you do the interlace yourself - the width of the row is the width in 'row_info', not the overall image width. -If supported libpng provides two information routines that you can use to find +If supported, libpng provides two information routines that you can use to find where you are in processing the image: png_get_current_pass_number(png_structp png_ptr); @@ -2026,7 +2106,7 @@ to load the whole file into memory when it is interlaced. libpng includes a test program, pngvalid, that illustrates reading and writing of interlaced images. If you can't get interlacing to work in your -code and don't want to leave it to libpng (the recommended approach) see +code and don't want to leave it to libpng (the recommended approach), see how pngvalid.c does it. Finishing a sequential read @@ -2639,6 +2719,28 @@ width, height, bit_depth, and color_type must be the same in each call. int_file_gamma - 100,000 times the gamma at which the image was created + png_set_cHRM(png_ptr, info_ptr, white_x, white_y, red_x, red_y, + green_x, green_y, blue_x, blue_y) + png_set_cHRM_XYZ(png_ptr, info_ptr, red_X, red_Y, red_Z, green_X, + green_Y, green_Z, blue_X, blue_Y, blue_Z) + png_set_cHRM_fixed(png_ptr, info_ptr, int_white_x, int_white_y, + int_red_x, int_red_y, int_green_x, int_green_y, + int_blue_x, int_blue_y) + png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, int_red_X, int_red_Y, + int_red_Z, int_green_X, int_green_Y, int_green_Z, + int_blue_X, int_blue_Y, int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the chromaticities + of the end points and the white point. + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the encoding end + points - the CIE tristimulus specification of the intended + color of the red, green and blue channels in the PNG RGB + data. The white point is simply the sum of the three end + points. + png_set_sRGB(png_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent @@ -2699,14 +2801,14 @@ width, height, bit_depth, and color_type must be the same in each call. trans_alpha - array of alpha (transparency) entries for palette (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + trans_color - graylevel or color sample values (in order red, green, blue) of the single transparent color for non-paletted images (PNG_INFO_tRNS) - num_trans - number of transparent entries - (PNG_INFO_tRNS) - png_set_hIST(png_ptr, info_ptr, hist); hist - histogram of palette (array of @@ -2719,7 +2821,8 @@ width, height, bit_depth, and color_type must be the same in each call. png_set_bKGD(png_ptr, info_ptr, background); - background - background color (PNG_VALID_bKGD) + background - background color (of type + png_color_16p) (PNG_VALID_bKGD) png_set_text(png_ptr, info_ptr, text_ptr, num_text); @@ -2746,6 +2849,8 @@ width, height, bit_depth, and color_type must be the same in each call. Note that the itxt_length, lang, and lang_key members of the text_ptr structure only exist when the library is built with iTXt chunk support. + Prior to libpng-1.4.0 the library was built by default + without iTXt support. num_text - number of comments @@ -2795,6 +2900,7 @@ width, height, bit_depth, and color_type must be the same in each call. unit - physical scale units (an integer) width - width of a pixel in physical scale units + expressed as a string height - height of a pixel in physical scale units (width and height are strings like "2.54") @@ -2836,7 +2942,7 @@ Because tEXt and zTXt chunks don't have a language field, if you specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt any language code or translated keyword will not be written out. -Until text gets around 1000 bytes, it is not worth compressing it. +Until text gets around a few hundred bytes, it is not worth compressing it. After the text has been written out to the file, the compression type is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, so that it isn't written out again at the end (in case you are calling @@ -3446,7 +3552,8 @@ However, there are some uncertainties about the status of local variables after a longjmp, so the user may want to be careful about doing anything after setjmp returns non-zero besides returning itself. Consult your compiler documentation for more details. For an alternative approach, you -may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net). +may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net), +which is illustrated in pngvalid.c and in contrib/visupng. Custom chunks @@ -3464,8 +3571,11 @@ and look at how other chunks were designed, so you can do things similarly. Second, check out the sections of libpng that read and write chunks. Try to find a chunk that is similar to yours and use it as a template. More details can be found in the comments inside -the code. It is best to handle unknown chunks in a generic method, -via callback functions, instead of by modifying libpng functions. +the code. It is best to handle private or unknown chunks in a generic method, +via callback functions, instead of by modifying libpng functions. This +is illustrated in pngtest.c, which uses a callback function to handle a +private "vpAg" chunk and the new "sTER" chunk, which are both unknown to +libpng. If you wish to write your own transformation for the data, look through the part of the code that does the transformations, and check out some of @@ -3493,8 +3603,8 @@ defined, and FAR gets defined to far in pngconf.h, and you should be all set. Everything in the library (except for zlib's structure) is expecting far data. You must use the typedefs with the p or pp on the end for pointers (or at least look at them and be careful). Make -note that the rows of data are defined as png_bytepp, which is an -unsigned char far * far *. +note that the rows of data are defined as png_bytepp, which is +an "unsigned char far * far *". Configuring for gui/windowing platforms: @@ -3512,7 +3622,10 @@ or delete an include, this is the place to do it. The includes that are not needed outside libpng are placed in pngpriv.h, which is only used by the routines inside libpng itself. The files in libpng proper only include pngpriv.h and png.h, which -in turn includes pngconf.h. +in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h. +As of libpng-1.5.0, pngpriv.h also includes three other private header +files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material +that previously appeared in the public headers. Configuring zlib: @@ -3554,8 +3667,28 @@ zlib.h for more information on what these mean. window_bits); png_set_compression_method(png_ptr, method); + png_set_compression_buffer_size(png_ptr, size); +As of libpng version 1.5.4, additional APIs became +available to set these separately for non-IDAT +compressed chunks such as zTXt, iTXt, and iCCP: + + #include zlib.h + #if PNG_LIBPNG_VER <= 10504 + png_set_text_compression_level(png_ptr, level); + + png_set_text_compression_mem_level(png_ptr, level); + + png_set_text_compression_strategy(png_ptr, + strategy); + + png_set_text_compression_window_bits(png_ptr, + window_bits); + + png_set_text_compression_method(png_ptr, method); + #endif + Controlling row filtering If you want to control whether libpng uses filtering or not, which @@ -3661,8 +3794,8 @@ capability, which you'll still have). All the reading and writing specific code are in separate files, so the linker should only grab the files it needs. However, if you want to make sure, or if you are building a stand alone library, all the -reading files start with pngr and all the writing files start with -pngw. The files that don't match either (like png.c, pngtrans.c, etc.) +reading files start with "pngr" and all the writing files start with "pngw". +The files that don't match either (like png.c, pngtrans.c, etc.) are used for both reading and writing, and always need to be included. The progressive reader is in pngpread.c @@ -3781,6 +3914,9 @@ The number libpng_vn is constructed from the major version, minor version with leading zero, and release number with leading zero, (e.g., libpng_vn for version 1.0.7 is 10007). +Note that this function does not take a png_ptr, so you can call it +before you've created one. + You can also check which version of png.h you used when compiling your application: @@ -4017,10 +4153,9 @@ In png_get_iCCP, the type of "profile" was changed from png_charpp to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep. There are changes of form in png.h, including new and changed macros to -declare -parts of the API. Some API functions with arguments that are pointers to -data not modified within the function have been corrected to declare -these arguments with PNG_CONST. +declare parts of the API. Some API functions with arguments that are +pointers to data not modified within the function have been corrected to +declare these arguments with PNG_CONST. Much of the internal use of C macros to control the library build has also changed and some of this is visible in the exported header files, in @@ -4040,7 +4175,6 @@ absolutely necessary) interlace an image. libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls the application-provided png_longjmp_ptr on the internal, but application -initialized, jmpbuf. It is provided as a convenience to avoid the need initialized, longjmp buffer. It is provided as a convenience to avoid the need to use the png_jmpbuf macro, which had the unnecessary side effect of resetting the internal png_longjmp_ptr value. @@ -4095,7 +4229,7 @@ Applications can now choose whether to use these macros or to call the corresponding function by defining PNG_USE_READ_MACROS or PNG_NO_USE_READ_MACROS before including png.h. Notice that this is only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0 - will lead to a link failure. +will lead to a link failure. Prior to libpng-1.5.4, the zlib compressor used the same set of parameters when compressing the IDAT data and textual data such as zTXt and iCCP. @@ -4119,9 +4253,9 @@ increase the limits. B. Changes to the build and configuration of libpng Details of internal changes to the library code can be found in the CHANGES -file. These will be of no concern to the vast majority of library users or -builders, however the few who configure libpng to a non-default feature -set may need to change how this is done. +file and in the GIT repository logs. These will be of no concern to the vast +majority of library users or builders, however the few who configure libpng +to a non-default feature set may need to change how this is done. There should be no need for library builders to alter build scripts if these use the distributed build support - configure or the makefiles - @@ -4130,14 +4264,14 @@ to build pnglibconf.h where the corresponding makefile does not do so. Building libpng with a non-default configuration has changed completely. The old method using pngusr.h should still work correctly even though the -way pngusr.h is used in the build has been changed, however library +way pngusr.h is used in the build has been changed; however, library builders will probably want to examine the changes to take advantage of new capabilities and to simplify their build system. B.1 Specific changes to library configuration capabilities The library now supports a complete fixed point implementation and can -thus be used on systems which have no floating point support or very +thus be used on systems that have no floating point support or very limited or slow support. Previously gamma correction, an essential part of complete PNG support, required reasonably fast floating point. @@ -4153,14 +4287,14 @@ pnglibconf.h As part of this the mechanism used to choose procedure call standards on those systems that allow a choice has been changed. At present this only affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems -running on Intel processors. As before PNGAPI is defined where required +running on Intel processors. As before, PNGAPI is defined where required to control the exported API functions; however, two new macros, PNGCBAPI and PNGCAPI, are used instead for callback functions (PNGCBAPI) and (PNGCAPI) for functions that must match a C library prototype (currently only png_longjmp_ptr, which must match the C longjmp function.) The new approach is documented in pngconf.h -Despite these changes libpng 1.5.0 only supports the native C function +Despite these changes, libpng 1.5.0 only supports the native C function calling standard on those platforms tested so far (__cdecl on Microsoft Windows). This is because the support requirements for alternative calling conventions seem to no longer exist. Developers who find it @@ -4193,8 +4327,10 @@ if the feature is supported or: /*#undef PNG_feature_SUPPORTED*/ if it is not. Library code consistently checks for the 'SUPPORTED' macro. -It does not, and should not, check for the 'NO' macro which will not -normally be defined even if the feature is not supported. +It does not, and libpng applications should not, check for the 'NO' macro +which will not normally be defined even if the feature is not supported. +The 'NO' macros are only used internally for setting or not setting the +corresponding 'SUPPORTED' macros. Compatibility with the old names is provided as follows: @@ -4251,10 +4387,10 @@ application built without PNG_USER_CONFIG defined would see the unmodified, default, libpng API and thus would probably fail to link. These mechanisms still work in the configure build and in any makefile -build that builds pnglibconf.h although the feature selection macros +build that builds pnglibconf.h, although the feature selection macros have changed somewhat as described above. In 1.5.0, however, pngusr.h is processed only once, when the exported header file pnglibconf.h is built. -pngconf.h no longer includes pngusr.h, therefore it is ignored after the +pngconf.h no longer includes pngusr.h, therefore pngusr.h is ignored after the build of pnglibconf.h and it is never included in an application build. The rarely used alternative of adding a list of feature macros to the @@ -4268,7 +4404,7 @@ scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan and all known later implementations (often called by subtly different names - nawk and gawk for example) are adequate to build pnglibconf.h. The Sun Microsystems (now Oracle) program 'awk' is an earlier version -and does not work, this may also apply to other systems that have a +and does not work; this may also apply to other systems that have a functioning awk called 'nawk'. Configuration options are now documented in scripts/pnglibconf.dfa. This @@ -4310,8 +4446,8 @@ the libpng bug tracker at We also accept patches built from the tar or zip distributions, and simple verbal discriptions of bug fixes, reported either to the -SourceForge bug tracker or to the png-mng-implement at lists.sf.net -mailing list. +SourceForge bug tracker, to the png-mng-implement at lists.sf.net +mailing list, or directly to glennrp. XIII. Coding style @@ -4424,13 +4560,13 @@ Other rules can be inferred by inspecting the libpng source. XIV. Y2K Compliance in libpng -July 7, 2011 +September 22, 2011 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.5.4 are Y2K compliant. It is my belief that earlier +upward through 1.5.5 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that diff --git a/Build/source/libs/libpng/libpng-1.5.4/libpng.3 b/Build/source/libs/libpng/libpng-1.5.5/libpng.3 index 04518cae22e..571be914826 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/libpng.3 +++ b/Build/source/libs/libpng/libpng-1.5.5/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "July 7, 2011" +.TH LIBPNG 3 "September 22, 2011" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.5.4 +libpng \- Portable Network Graphics (PNG) Reference Library 1.5.5 .SH SYNOPSIS \fI\fB @@ -128,10 +128,22 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.4 \fI\fB -\fBpng_uint_32 png_get_chunk_cache_max (png_const_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_cHRM_XYZ (png_structp \fIpng_ptr, + +\fBpng_const_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*red_X\fP\fB, double \fP\fI*red_Y\fP\fB, double \fI*red_Z, + +\fBdouble \fP\fI*green_X\fP\fB, double \fP\fI*green_Y\fP\fB, double \fP\fI*green_Z\fP\fB, double \fI*blue_X, + +\fBdouble \fP\fI*blue_Y\fP\fB, double \fI*blue_Z\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_cHRM_XYZ_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_fixed_point \fP\fI*int_red_X\fP\fB, png_fixed_point \fP\fI*int_red_Y\fP\fB, png_fixed_point \fP\fI*int_red_Z\fP\fB, png_fixed_point \fP\fI*int_green_X\fP\fB, png_fixed_point \fP\fI*int_green_Y\fP\fB, png_fixed_point \fP\fI*int_green_Z\fP\fB, png_fixed_point \fP\fI*int_blue_X\fP\fB, png_fixed_point \fP\fI*int_blue_Y\fP\fB, png_fixed_point \fI*int_blue_Z\fP\fB);\fP \fI\fB +\fBpng_uint_32 png_get_chunk_cache_max (png_const_structp \fIpng_ptr\fP\fB);\fP + \fI\fB \fBpng_alloc_size_t png_get_chunk_malloc_max (png_const_structp \fIpng_ptr\fP\fB);\fP @@ -548,6 +560,16 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.4 \fI\fB +\fBvoid png_set_cHRM_XYZ (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIred_X\fP\fB, double \fP\fIred_Y\fP\fB, double \fP\fIred_Z\fP\fB, double \fP\fIgreen_X\fP\fB, double \fIgreen_Y, + +\fBdouble \fP\fIgreen_Z\fP\fB, double \fP\fIblue_X\fP\fB, double \fP\fIblue_Y\fP\fB, double \fIblue_Z\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_cHRM_XYZ_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_fixed_point \fP\fIint_red_X\fP\fB, png_fixed_point \fP\fIint_red_Y\fP\fB, png_fixed_point \fP\fIint_red_Z\fP\fB, png_fixed_point \fP\fIint_green_X\fP\fB, png_fixed_point \fP\fIint_green_Y\fP\fB, png_fixed_point \fP\fIint_green_Z\fP\fB, png_fixed_point \fP\fIint_blue_X\fP\fB, png_fixed_point \fP\fIint_blue_Y\fP\fB, png_fixed_point \fIint_blue_Z\fP\fB);\fP + +\fI\fB + \fBvoid png_set_chunk_cache_max (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIuser_chunk_cache_max\fP\fB);\fP \fI\fB @@ -955,7 +977,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.5.4 - July 7, 2011 + libpng version 1.5.5 - September 22, 2011 Updated and distributed by Glenn Randers-Pehrson <glennrp at users.sourceforge.net> Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -966,7 +988,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.5.4 - July 7, 2011 + libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2011 Glenn Randers-Pehrson @@ -1062,7 +1084,8 @@ PNG file. At one time, the fields of png_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result a set of interface functions for png_info (the png_get_*() and png_set_*() -functions) was developed. +functions) was developed, and direct access to the png_info fields was +deprecated.. The png_struct structure is the object used by the library to decode a single image. As of 1.5.0 this structure is also not exposed. @@ -1071,14 +1094,23 @@ Almost all libpng APIs require a pointer to a png_struct as the first argument. Many (in particular the png_set and png_get APIs) also require a pointer to png_info as the second argument. Some application visible macros defined in png.h designed for basic data access (reading and writing -integers in the PNG format) break this rule, but it's almost always safe -to assume that a (png_struct*) has to be passed to call an API function. +integers in the PNG format) don't take a png_info pointer, but it's almost +always safe to assume that a (png_struct*) has to be passed to call an API +function. + +You can have more than one png_info structure associated with an image, +as illustrated in pngtest.c, one for information valid prior to the +IDAT chunks and another (called "end_info" below) for things after them. The png.h header file is an invaluable reference for programming with libpng. And while I'm on the topic, make sure you include the libpng header file: #include <png.h> +and also (as of libpng-1.5.0) the zlib header file, if you need it: + +#include <zlib.h> + .SS Types The png.h header file defines a number of integral types used by the @@ -1092,9 +1124,9 @@ the value by multiplying by 100,000. As of libpng 1.5.0 a convenience macro PNG_FP_1 is defined in png.h along with a type (png_fixed_point) which is simply (png_int_32). -All APIs that take (double) arguments also have an matching API that +All APIs that take (double) arguments also have a matching API that takes the corresponding fixed point integer arguments. The fixed point -API has the same name as the floating point one with _fixed appended. +API has the same name as the floating point one with "_fixed" appended. The actual range of values permitted in the APIs is frequently less than the full range of (png_fixed_point) (-21474 to +21474). When APIs require a non-negative argument the type is recorded as png_uint_32 above. Consult @@ -1112,6 +1144,10 @@ preprocessing directives of the form: #ifdef PNG_feature_SUPPORTED declare-function #endif + ... + #ifdef PNG_feature_SUPPORTED + use-function + #endif The library can be built without support for these APIs, although a standard build will have all implemented APIs. Application programs @@ -1120,7 +1156,7 @@ portability. From libpng 1.5.0 the feature macros set during the build of libpng are recorded in the header file "pnglibconf.h" and this file is always included by png.h. -If you don't need to change the library configuration from the default skip to +If you don't need to change the library configuration from the default, skip to the next section ("Reading"). Notice that some of the makefiles in the 'scripts' directory and (in 1.5.0) all @@ -1152,24 +1188,25 @@ A variety of methods exist to build libpng. Not all of these support reconfiguration of pnglibconf.h. To reconfigure pnglibconf.h it must either be rebuilt from scripts/pnglibconf.dfa using awk or it must be edited by hand. -Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt and changing -the lines defining the supported features, paying very close attention to -the 'option' information in scripts/pnglibconf.dfa that describes those -features and their requirements. This is easy to get wrong. +Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt to +pnglibconf.h and changing the lines defining the supported features, paying +very close attention to the 'option' information in scripts/pnglibconf.dfa +that describes those features and their requirements. This is easy to get +wrong. B. Configuration using DFA_XTRA Rebuilding from pnglibconf.dfa is easy if a functioning 'awk', or a later variant such as 'nawk' or 'gawk', is available. The configure build will automatically find an appropriate awk and build pnglibconf.h. -scripts/pnglibconf.mak contains a set of make rules for doing the same thing if -configure is not used, and many of the makefiles in the scripts directory use -this approach. +The scripts/pnglibconf.mak file contains a set of make rules for doing the +same thing if configure is not used, and many of the makefiles in the scripts +directory use this approach. -When rebuilding simply write new file containing changed options and set +When rebuilding simply write a new file containing changed options and set DFA_XTRA to the name of this file. This causes the build to append the new file -to the end of scripts/pnglibconf.dfa. pngusr.dfa should contain lines of the -following forms: +to the end of scripts/pnglibconf.dfa. The pngusr.dfa file should contain lines +of the following forms: everything = off @@ -1193,12 +1230,16 @@ source code. Most of these values have performance implications for the library but most of them have no visible effect on the API. Some can also be overridden from the API. +This method of building a customized pnglibconf.h is illustrated in +contrib/pngminim/*. See the "$(PNGCONF):" target in the makefile and +pngusr.dfa in these directories. + C. Configuration using PNG_USR_CONFIG If -DPNG_USR_CONFIG is added to the CFLAGS when pnglibconf.h is built the file pngusr.h will automatically be included before the options in -scripts/pnglibconf.dfa are processed. pngusr.h should contain only macro -definitions turning features on or off or setting settings. +scripts/pnglibconf.dfa are processed. Your pngusr.h file should contain only +macro definitions turning features on or off or setting settings. Apart from the global setting "everything = off" all the options listed above can be set using macros in pngusr.h: @@ -1229,6 +1270,9 @@ examine the intermediate file pnglibconf.dfn to find the full set of dependency information for each setting and option. Simply locate the feature in the file and read the C comments that precede it. +This method is also illustrated in the contrib/pngminim/* makefiles and +pngusr.h. + .SH III. Reading We'll now walk you through the possible functions to call when reading @@ -1512,6 +1556,8 @@ according to the "keep" directive. If a chunk is named in successive instances of png_set_keep_unknown_chunks(), the final instance will take precedence. The IHDR and IEND chunks should not be named in chunk_list; if they are, libpng will process them normally anyway. +If you know that your application will never make use of some particular +chunks, use PNG_HANDLE_CHUNK_NEVER (or 1) as demonstrated below. Here is an example of the usage of png_set_keep_unknown_chunks(), where the private "vpAg" chunk will later be processed by a user chunk @@ -1608,7 +1654,8 @@ called before the PNG file header had been read and png_set_alpha_mode() did not exist. If you need to support versions prior to libpng-1.5.4 test the version number -and follow the procedures described in the appropriate manual page. +as illustrated below using "PNG_LIBPNG_VER >= 10504" and follow the procedures +described in the appropriate manual page. You give libpng the encoding expected by your system expressed as a 'gamma' value. You can also specify a default encoding for the PNG file in @@ -1621,7 +1668,7 @@ or you can use the fixed point equivalent: png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma, PNG_FP_1/screen_gamma); -If you don't know the gamma for you system it is probably 2.2 - a good +If you don't know the gamma for your system it is probably 2.2 - a good approximation to the IEC standard for display systems (sRGB). If images are too contrasty or washed out you got the value wrong - check your system documentation! @@ -1650,14 +1697,18 @@ channel. To display these files correctly you need to compose the data onto a suitable background, as described in the PNG specification. Libpng only supports composing onto a single color (using png_set_background; -see below.) Otherwise you must do the composition yourself and, in this case, +see below). Otherwise you must do the composition yourself and, in this case, you may need to call png_set_alpha_mode: +#if PNG_LIBPNG_VER >= 10504 png_set_alpha_mode(png_ptr, mode, screen_gamma); +#else + png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma); +#endif -The screen_gamma value is the same as the argument to png_set_gamma, however how -it affects the output depends on the mode. png_set_alpha_mode() sets the file -gamma default to 1/screen_gamma, so normally you don't need to call +The screen_gamma value is the same as the argument to png_set_gamma; however, +how it affects the output depends on the mode. png_set_alpha_mode() sets the +file gamma default to 1/screen_gamma, so normally you don't need to call png_set_gamma. If you need different defaults call png_set_gamma() before png_set_alpha_mode() - if you call it after it will override the settings made by png_set_alpha_mode(). @@ -1684,10 +1735,11 @@ scaled, linear encoded, pre-multiplied component values must be used! The remaining modes assume you don't need to do any further color correction or -that if you do your color correction software knows all about alpha (it +that if you do, your color correction software knows all about alpha (it probably doesn't!) - PNG_ALPHA_STANDARD: The data libpng produces is encoded in the standard way + PNG_ALPHA_STANDARD: The data libpng produces +is encoded in the standard way assumed by most correctly written graphics software. The gamma encoding will be removed by libpng and the linear component values will be pre-multiplied by the @@ -1717,7 +1769,8 @@ dynamic range. To avoid problems, and if your software supports it, use png_set_expand_16() to force all components to 16 bits. - PNG_ALPHA_OPTIMIZED: This mode is the same as PNG_ALPHA_STANDARD except that + PNG_ALPHA_OPTIMIZED: This mode is the same +as PNG_ALPHA_STANDARD except that completely opaque pixels are gamma encoded according to the screen_gamma value. Pixels with alpha less than 1.0 will still have linear components. @@ -1737,10 +1790,11 @@ representation of non-opaque pixels are irrelevant. You can also try this format if your software is broken; it might look better. - PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD however all component values, + PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD; +however, all component values, including the alpha channel are gamma encoded. This is an appropriate format to try if your software, or more -likely hardware, is totally broken: if it performs +likely hardware, is totally broken, i.e., if it performs linear arithmetic directly on gamma encoded values. In most cases of broken software or hardware the bug in the final display @@ -1756,14 +1810,14 @@ them, there are three recommended ways of using png_set_alpha_mode(): screen_gamma); You can do color correction on the result (libpng does not currently -support color correction internally.) When you handle the alpha channel +support color correction internally). When you handle the alpha channel you need to undo the gamma encoding and multiply out the alpha. png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, screen_gamma); png_set_expand_16(png_ptr); -If you are using the high level interface don't call png_set_expand_16(); +If you are using the high level interface, don't call png_set_expand_16(); instead pass PNG_TRANSFORM_EXPAND_16 to the interface. With this mode you can't do color correction, but you can do arithmetic, @@ -1775,7 +1829,7 @@ including composition and scaling, on the data without further processing. You can avoid the expansion to 16-bit components with this mode, but you lose the ability to scale the image or perform other linear arithmetic. All you can do is compose the result onto a matching output. Since this -mode is libpng specific you also need to write your own composition +mode is libpng-specific you also need to write your own composition software. If you don't need, or can't handle, the alpha channel you can call @@ -1788,12 +1842,12 @@ transparent parts of this image. The background_color is an RGB or grayscale value according to the data format libpng will produce for you. Because you don't yet know the format of the PNG -file if you call png_set_background at this point you must arrange for the +file, if you call png_set_background at this point you must arrange for the format produced by libpng to always have 8-bit or 16-bit components and then store the color as an 8-bit or 16-bit color as appropriate. The color contains separate gray and RGB component values, so you can let libpng produce gray or RGB output according to the input format, but low bit depth grayscale images -must always be converted to at least 8-bit format. (Even low low bit depth +must always be converted to at least 8-bit format. (Even though low bit depth grayscale images can't have an alpha channel they can have a transparent color!) @@ -1932,7 +1986,7 @@ provided by an earlier call to png_set_gamma or png_set_alpha_mode. 2) Prior to libpng-1.5.4 the background color from a bKGd chunk. This damages the information provided by an earlier call to png_set_background -resulting in expected behavior. Libpng-1.5.4 no longer does this. +resulting in unexpected behavior. Libpng-1.5.4 no longer does this. 3) The number of significant bits in each component value. Libpng uses this to optimize gamma handling by reducing the internal lookup table sizes. @@ -2070,6 +2124,28 @@ pointer into the info_ptr is returned for any complex types. int_file_gamma - 100,000 times the gamma at which the file is written + png_get_cHRM(png_ptr, info_ptr, &white_x, &white_y, &red_x, &red_y, + &green_x, &green_y, &blue_x, &blue_y) + png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z, &green_X, + &green_Y, &green_Z, &blue_X, &blue_Y, &blue_Z) + png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x, &int_white_y, + &int_red_x, &int_red_y, &int_green_x, &int_green_y, + &int_blue_x, &int_blue_y) + png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, &int_red_X, &int_red_Y, + &int_red_Z, &int_green_X, &int_green_Y, &int_green_Z, + &int_blue_X, &int_blue_Y, &int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the chromaticities + of the end points and the white point. (PNG_INFO_cHRM) + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the encoding end + points - the CIE tristimulus specification of the intended + color of the red, green and blue channels in the PNG RGB + data. The white point is simply the sum of the three end + points. (PNG_INFO_cHRM) + png_get_sRGB(png_ptr, info_ptr, &srgb_intent); file_srgb_intent - the rendering intent (PNG_INFO_sRGB) @@ -2128,7 +2204,8 @@ pointer into the info_ptr is returned for any complex types. png_get_bKGD(png_ptr, info_ptr, &background); - background - background color (PNG_VALID_bKGD) + background - background color (of type + png_color_16p) (PNG_VALID_bKGD) valid 16-bit red, green and blue values, regardless of color_type @@ -2167,6 +2244,8 @@ pointer into the info_ptr is returned for any complex types. Note that the itxt_length, lang, and lang_key members of the text_ptr structure only exist when the library is built with iTXt chunk support. + Prior to libpng-1.4.0, the default build was + without iTXt chunk support. num_text - number of comments (same as num_comments; you can put NULL here @@ -2191,10 +2270,10 @@ pointer into the info_ptr is returned for any complex types. &unit_type); offset_x - positive offset from the left edge - of the screen + of the screen (can be negative) offset_y - positive offset from the top edge - of the screen + of the screen (can be negative) unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER @@ -2226,6 +2305,7 @@ pointer into the info_ptr is returned for any complex types. unit - physical scale units (an integer) width - width of a pixel in physical scale units + (expressed as a string) height - height of a pixel in physical scale units (width and height are strings like "2.54") @@ -2248,6 +2328,12 @@ pointer into the info_ptr is returned for any complex types. chunks were read from the PNG file or inserted with the png_set_unknown_chunks() function. + The value of "location" is a bitwise "or" of + + PNG_HAVE_IHDR (0x01) + PNG_HAVE_PLTE (0x02) + PNG_AFTER_IDAT (0x08) + The data from the pHYs chunk can be retrieved in several convenient forms: @@ -2392,7 +2478,7 @@ As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was added. It expands the sample depth without changing tRNS to alpha. As of libpng version 1.5.2, png_set_expand_16() was added. It behaves as -png_set_expand(), however, the resultant channels have 16 bits rather than 8. +png_set_expand(); however, the resultant channels have 16 bits rather than 8. Use this when the output color or gray channels are made linear to avoid fairly severe accuracy loss. @@ -2403,7 +2489,14 @@ PNG can have files with 16 bits per channel. If you only can handle 8 bits per channel, this will strip the pixels down to 8-bit. if (bit_depth == 16) +#if PNG_LIBPNG_VER >= 10504 png_set_scale_16(png_ptr); +#else + png_set_strip_16(png_ptr); +#endif + +(The more accurate "png_set_scale_16()" API became available in libpng version +1.5.4). If you need to process the alpha channel on the image separately from the image data (for example if you convert it to a bitmap mask) it is possible to have @@ -2581,19 +2674,28 @@ It will return a png_byte that is zero if the image was gray or will be silently converted to grayscale, using the green channel data for sBIT, regardless of the error_action setting. -The default values come from the PNG file cHRM chunk if present, otherwise the +The default values come from the PNG file cHRM chunk if present; otherwise, the defaults correspond to the ITU-R recommendation 709, and also the sRGB color space, as recommended in the Charles Poynton's Colour FAQ, <http://www.poynton.com/>, in section 9: <http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC9> + Y = 0.2126 * R + 0.7152 * G + 0.0722 * B + +Previous versions of this document, 1998 through 2002, recommended a slightly +different formula: + Y = 0.212671 * R + 0.715160 * G + 0.072169 * B +Libpng uses an integer approximation: + + Y = (6968 * R + 23434 * G + 2366 * B)/32768 + The calculation is done in a linear colorspace, if the image gamma can be determined. -The png_set_background() function has been described already, it tells libpng to +The png_set_background() function has been described already; it tells libpng to composite images with alpha or simple transparency against the supplied background color. For compatibility with versions of libpng earlier than libpng-1.5.4 it is recommended that you call the function after reading the file @@ -2603,9 +2705,10 @@ If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), you may use this color, or supply another color more suitable for the current display (e.g., the background color from a web page). You need to tell libpng how the color is represented, both the format of the -component values in the color (the number of bits) and the gamme encoding of the +component values in the color (the number of bits) and the gamma encoding of the color. The function takes two arguments, background_gamma_mode and need_expand -to convey this information, however only two combinations are like to be useful: +to convey this information, however only two combinations are likely to be +useful: png_color_16 my_background; png_color_16p image_background; @@ -2617,7 +2720,6 @@ to convey this information, however only two combinations are like to be useful: png_set_background(png_ptr, &my_background, PNG_BACKGROUND_GAMMA_SCREEN, 0/*do not expand*/, 1); - The second call was described above - my_background is in the format of the final, display, output produced by libpng. Because you now know the format of the PNG it is possible to avoid the need to choose either 8-bit or 16-bit @@ -2656,9 +2758,9 @@ file has more entries then will fit on your screen, png_set_quantize() will do that. Note that this is a simple match quantization that merely finds the closest color available. This should work fairly well with optimized palettes, but fairly badly with linear color cubes. If you -pass a palette that is larger then maximum_colors, the file will +pass a palette that is larger than maximum_colors, the file will reduce the number of colors in the palette so it will fit into -maximum_colors. If there is a histogram, it will use it to make +maximum_colors. If there is a histogram, libpng will use it to make more intelligent choices when reducing the palette. If there is no histogram, it may not do as good a job. @@ -2730,7 +2832,7 @@ after all of the other transformations have been processed. Take care with interlaced images if you do the interlace yourself - the width of the row is the width in 'row_info', not the overall image width. -If supported libpng provides two information routines that you can use to find +If supported, libpng provides two information routines that you can use to find where you are in processing the image: png_get_current_pass_number(png_structp png_ptr); @@ -2981,7 +3083,7 @@ to load the whole file into memory when it is interlaced. libpng includes a test program, pngvalid, that illustrates reading and writing of interlaced images. If you can't get interlacing to work in your -code and don't want to leave it to libpng (the recommended approach) see +code and don't want to leave it to libpng (the recommended approach), see how pngvalid.c does it. .SS Finishing a sequential read @@ -3594,6 +3696,28 @@ width, height, bit_depth, and color_type must be the same in each call. int_file_gamma - 100,000 times the gamma at which the image was created + png_set_cHRM(png_ptr, info_ptr, white_x, white_y, red_x, red_y, + green_x, green_y, blue_x, blue_y) + png_set_cHRM_XYZ(png_ptr, info_ptr, red_X, red_Y, red_Z, green_X, + green_Y, green_Z, blue_X, blue_Y, blue_Z) + png_set_cHRM_fixed(png_ptr, info_ptr, int_white_x, int_white_y, + int_red_x, int_red_y, int_green_x, int_green_y, + int_blue_x, int_blue_y) + png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, int_red_X, int_red_Y, + int_red_Z, int_green_X, int_green_Y, int_green_Z, + int_blue_X, int_blue_Y, int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the chromaticities + of the end points and the white point. + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the encoding end + points - the CIE tristimulus specification of the intended + color of the red, green and blue channels in the PNG RGB + data. The white point is simply the sum of the three end + points. + png_set_sRGB(png_ptr, info_ptr, srgb_intent); srgb_intent - the rendering intent @@ -3654,14 +3778,14 @@ width, height, bit_depth, and color_type must be the same in each call. trans_alpha - array of alpha (transparency) entries for palette (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + trans_color - graylevel or color sample values (in order red, green, blue) of the single transparent color for non-paletted images (PNG_INFO_tRNS) - num_trans - number of transparent entries - (PNG_INFO_tRNS) - png_set_hIST(png_ptr, info_ptr, hist); hist - histogram of palette (array of @@ -3674,7 +3798,8 @@ width, height, bit_depth, and color_type must be the same in each call. png_set_bKGD(png_ptr, info_ptr, background); - background - background color (PNG_VALID_bKGD) + background - background color (of type + png_color_16p) (PNG_VALID_bKGD) png_set_text(png_ptr, info_ptr, text_ptr, num_text); @@ -3701,6 +3826,8 @@ width, height, bit_depth, and color_type must be the same in each call. Note that the itxt_length, lang, and lang_key members of the text_ptr structure only exist when the library is built with iTXt chunk support. + Prior to libpng-1.4.0 the library was built by default + without iTXt support. num_text - number of comments @@ -3750,6 +3877,7 @@ width, height, bit_depth, and color_type must be the same in each call. unit - physical scale units (an integer) width - width of a pixel in physical scale units + expressed as a string height - height of a pixel in physical scale units (width and height are strings like "2.54") @@ -3791,7 +3919,7 @@ Because tEXt and zTXt chunks don't have a language field, if you specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt any language code or translated keyword will not be written out. -Until text gets around 1000 bytes, it is not worth compressing it. +Until text gets around a few hundred bytes, it is not worth compressing it. After the text has been written out to the file, the compression type is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, so that it isn't written out again at the end (in case you are calling @@ -4401,7 +4529,8 @@ However, there are some uncertainties about the status of local variables after a longjmp, so the user may want to be careful about doing anything after setjmp returns non-zero besides returning itself. Consult your compiler documentation for more details. For an alternative approach, you -may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net). +may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net), +which is illustrated in pngvalid.c and in contrib/visupng. .SS Custom chunks @@ -4419,8 +4548,11 @@ and look at how other chunks were designed, so you can do things similarly. Second, check out the sections of libpng that read and write chunks. Try to find a chunk that is similar to yours and use it as a template. More details can be found in the comments inside -the code. It is best to handle unknown chunks in a generic method, -via callback functions, instead of by modifying libpng functions. +the code. It is best to handle private or unknown chunks in a generic method, +via callback functions, instead of by modifying libpng functions. This +is illustrated in pngtest.c, which uses a callback function to handle a +private "vpAg" chunk and the new "sTER" chunk, which are both unknown to +libpng. If you wish to write your own transformation for the data, look through the part of the code that does the transformations, and check out some of @@ -4448,8 +4580,8 @@ defined, and FAR gets defined to far in pngconf.h, and you should be all set. Everything in the library (except for zlib's structure) is expecting far data. You must use the typedefs with the p or pp on the end for pointers (or at least look at them and be careful). Make -note that the rows of data are defined as png_bytepp, which is an -unsigned char far * far *. +note that the rows of data are defined as png_bytepp, which is +an "unsigned char far * far *". .SS Configuring for gui/windowing platforms: @@ -4467,7 +4599,11 @@ or delete an include, this is the place to do it. The includes that are not needed outside libpng are placed in pngpriv.h, which is only used by the routines inside libpng itself. The files in libpng proper only include pngpriv.h and png.h, which -in turn includes pngconf.h. +%14%in turn includes pngconf.h. +in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h. +As of libpng-1.5.0, pngpriv.h also includes three other private header +files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material +that previously appeared in the public headers. .SS Configuring zlib: @@ -4509,8 +4645,28 @@ zlib.h for more information on what these mean. window_bits); png_set_compression_method(png_ptr, method); + png_set_compression_buffer_size(png_ptr, size); +As of libpng version 1.5.4, additional APIs became +available to set these separately for non-IDAT +compressed chunks such as zTXt, iTXt, and iCCP: + + #include zlib.h + #if PNG_LIBPNG_VER <= 10504 + png_set_text_compression_level(png_ptr, level); + + png_set_text_compression_mem_level(png_ptr, level); + + png_set_text_compression_strategy(png_ptr, + strategy); + + png_set_text_compression_window_bits(png_ptr, + window_bits); + + png_set_text_compression_method(png_ptr, method); + #endif + .SS Controlling row filtering If you want to control whether libpng uses filtering or not, which @@ -4616,8 +4772,8 @@ capability, which you'll still have). All the reading and writing specific code are in separate files, so the linker should only grab the files it needs. However, if you want to make sure, or if you are building a stand alone library, all the -reading files start with pngr and all the writing files start with -pngw. The files that don't match either (like png.c, pngtrans.c, etc.) +reading files start with "pngr" and all the writing files start with "pngw". +The files that don't match either (like png.c, pngtrans.c, etc.) are used for both reading and writing, and always need to be included. The progressive reader is in pngpread.c @@ -4736,6 +4892,9 @@ The number libpng_vn is constructed from the major version, minor version with leading zero, and release number with leading zero, (e.g., libpng_vn for version 1.0.7 is 10007). +Note that this function does not take a png_ptr, so you can call it +before you've created one. + You can also check which version of png.h you used when compiling your application: @@ -4972,10 +5131,9 @@ In png_get_iCCP, the type of "profile" was changed from png_charpp to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep. There are changes of form in png.h, including new and changed macros to -declare -parts of the API. Some API functions with arguments that are pointers to -data not modified within the function have been corrected to declare -these arguments with PNG_CONST. +declare parts of the API. Some API functions with arguments that are +pointers to data not modified within the function have been corrected to +declare these arguments with PNG_CONST. Much of the internal use of C macros to control the library build has also changed and some of this is visible in the exported header files, in @@ -4995,7 +5153,6 @@ absolutely necessary) interlace an image. libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls the application-provided png_longjmp_ptr on the internal, but application -initialized, jmpbuf. It is provided as a convenience to avoid the need initialized, longjmp buffer. It is provided as a convenience to avoid the need to use the png_jmpbuf macro, which had the unnecessary side effect of resetting the internal png_longjmp_ptr value. @@ -5050,7 +5207,7 @@ Applications can now choose whether to use these macros or to call the corresponding function by defining PNG_USE_READ_MACROS or PNG_NO_USE_READ_MACROS before including png.h. Notice that this is only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0 - will lead to a link failure. +will lead to a link failure. Prior to libpng-1.5.4, the zlib compressor used the same set of parameters when compressing the IDAT data and textual data such as zTXt and iCCP. @@ -5074,9 +5231,9 @@ increase the limits. B. Changes to the build and configuration of libpng Details of internal changes to the library code can be found in the CHANGES -file. These will be of no concern to the vast majority of library users or -builders, however the few who configure libpng to a non-default feature -set may need to change how this is done. +file and in the GIT repository logs. These will be of no concern to the vast +majority of library users or builders, however the few who configure libpng +to a non-default feature set may need to change how this is done. There should be no need for library builders to alter build scripts if these use the distributed build support - configure or the makefiles - @@ -5085,14 +5242,14 @@ to build pnglibconf.h where the corresponding makefile does not do so. Building libpng with a non-default configuration has changed completely. The old method using pngusr.h should still work correctly even though the -way pngusr.h is used in the build has been changed, however library +way pngusr.h is used in the build has been changed; however, library builders will probably want to examine the changes to take advantage of new capabilities and to simplify their build system. B.1 Specific changes to library configuration capabilities The library now supports a complete fixed point implementation and can -thus be used on systems which have no floating point support or very +thus be used on systems that have no floating point support or very limited or slow support. Previously gamma correction, an essential part of complete PNG support, required reasonably fast floating point. @@ -5108,14 +5265,14 @@ pnglibconf.h As part of this the mechanism used to choose procedure call standards on those systems that allow a choice has been changed. At present this only affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems -running on Intel processors. As before PNGAPI is defined where required +running on Intel processors. As before, PNGAPI is defined where required to control the exported API functions; however, two new macros, PNGCBAPI and PNGCAPI, are used instead for callback functions (PNGCBAPI) and (PNGCAPI) for functions that must match a C library prototype (currently only png_longjmp_ptr, which must match the C longjmp function.) The new approach is documented in pngconf.h -Despite these changes libpng 1.5.0 only supports the native C function +Despite these changes, libpng 1.5.0 only supports the native C function calling standard on those platforms tested so far (__cdecl on Microsoft Windows). This is because the support requirements for alternative calling conventions seem to no longer exist. Developers who find it @@ -5148,8 +5305,10 @@ if the feature is supported or: /*#undef PNG_feature_SUPPORTED*/ if it is not. Library code consistently checks for the 'SUPPORTED' macro. -It does not, and should not, check for the 'NO' macro which will not -normally be defined even if the feature is not supported. +It does not, and libpng applications should not, check for the 'NO' macro +which will not normally be defined even if the feature is not supported. +The 'NO' macros are only used internally for setting or not setting the +corresponding 'SUPPORTED' macros. Compatibility with the old names is provided as follows: @@ -5206,10 +5365,10 @@ application built without PNG_USER_CONFIG defined would see the unmodified, default, libpng API and thus would probably fail to link. These mechanisms still work in the configure build and in any makefile -build that builds pnglibconf.h although the feature selection macros +build that builds pnglibconf.h, although the feature selection macros have changed somewhat as described above. In 1.5.0, however, pngusr.h is processed only once, when the exported header file pnglibconf.h is built. -pngconf.h no longer includes pngusr.h, therefore it is ignored after the +pngconf.h no longer includes pngusr.h, therefore pngusr.h is ignored after the build of pnglibconf.h and it is never included in an application build. The rarely used alternative of adding a list of feature macros to the @@ -5223,7 +5382,7 @@ scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan and all known later implementations (often called by subtly different names - nawk and gawk for example) are adequate to build pnglibconf.h. The Sun Microsystems (now Oracle) program 'awk' is an earlier version -and does not work, this may also apply to other systems that have a +and does not work; this may also apply to other systems that have a functioning awk called 'nawk'. Configuration options are now documented in scripts/pnglibconf.dfa. This @@ -5265,8 +5424,8 @@ the libpng bug tracker at We also accept patches built from the tar or zip distributions, and simple verbal discriptions of bug fixes, reported either to the -SourceForge bug tracker or to the png-mng-implement at lists.sf.net -mailing list. +SourceForge bug tracker, to the png-mng-implement at lists.sf.net +mailing list, or directly to glennrp. .SH XIII. Coding style @@ -5379,13 +5538,13 @@ Other rules can be inferred by inspecting the libpng source. .SH XIV. Y2K Compliance in libpng -July 7, 2011 +September 22, 2011 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.5.4 are Y2K compliant. It is my belief that earlier +upward through 1.5.5 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that @@ -5581,6 +5740,9 @@ the first widely used release: 1.5.4beta01-08 15 10504 15.so.15.4[.0] 1.5.4rc01 15 10504 15.so.15.4[.0] 1.5.4 15 10504 15.so.15.4[.0] + 1.5.5beta01-08 15 10505 15.so.15.5[.0] + 1.5.5rc01 15 10505 15.so.15.5[.0] + 1.5.5 15 10505 15.so.15.5[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -5637,7 +5799,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.5.4 - July 7, 2011: +Libpng version 1.5.5 - September 22, 2011: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -5660,7 +5822,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are +libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -5759,7 +5921,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -July 7, 2011 +September 22, 2011 .\" end of man page diff --git a/Build/source/libs/libpng/libpng-1.5.4/libpng.pc.in b/Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in index 3e7e2c58a7e..3e7e2c58a7e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/libpng.pc.in +++ b/Build/source/libs/libpng/libpng-1.5.5/libpng.pc.in diff --git a/Build/source/libs/libpng/libpng-1.5.4/libpngpf.3 b/Build/source/libs/libpng/libpng-1.5.5/libpngpf.3 index 33c9ad3929c..b1bce64912c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/libpngpf.3 +++ b/Build/source/libs/libpng/libpng-1.5.5/libpngpf.3 @@ -1,6 +1,6 @@ -.TH LIBPNGPF 3 "July 7, 2011" +.TH LIBPNGPF 3 "September 22, 2011" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.5.4 +libpng \- Portable Network Graphics (PNG) Reference Library 1.5.5 (private functions) .SH SYNOPSIS \fB#include \fI"pngpriv.h" diff --git a/Build/source/libs/libpng/libpng-1.5.4/png.5 b/Build/source/libs/libpng/libpng-1.5.5/png.5 index 0fca76eca2f..6f5089793bc 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/png.5 +++ b/Build/source/libs/libpng/libpng-1.5.5/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "July 7, 2011" +.TH PNG 5 "September 22, 2011" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/Build/source/libs/libpng/libpng-1.5.4/png.c b/Build/source/libs/libpng/libpng-1.5.5/png.c index eed31361955..c521ad261be 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/png.c +++ b/Build/source/libs/libpng/libpng-1.5.5/png.c @@ -1,7 +1,7 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_5_4 Your_png_h_is_not_version_1_5_4; +typedef png_libpng_version_1_5_5 Your_png_h_is_not_version_1_5_5; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -43,7 +43,7 @@ png_set_sig_bytes(png_structp png_ptr, int num_bytes) * can simply check the remaining bytes for extra assurance. Returns * an integer less than, equal to, or greater than zero if sig is found, * respectively, to be less than, to match, or be greater than the correct - * PNG signature (this is the same behaviour as strcmp, memcmp, etc). + * PNG signature (this is the same behavior as strcmp, memcmp, etc). */ int PNGAPI png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check) @@ -107,7 +107,8 @@ png_zfree(voidpf png_ptr, voidpf ptr) void /* PRIVATE */ png_reset_crc(png_structp png_ptr) { - png_ptr->crc = crc32(0, Z_NULL, 0); + /* The cast is safe because the crc is a 32 bit value. */ + png_ptr->crc = (png_uint_32)crc32(0, Z_NULL, 0); } /* Calculate the CRC over a section of data. We can only pass as @@ -133,8 +134,35 @@ png_calculate_crc(png_structp png_ptr, png_const_bytep ptr, png_size_t length) need_crc = 0; } - if (need_crc) - png_ptr->crc = crc32(png_ptr->crc, ptr, (uInt)length); + /* 'uLong' is defined as unsigned long, this means that on some systems it is + * a 64 bit value. crc32, however, returns 32 bits so the following cast is + * safe. 'uInt' may be no more than 16 bits, so it is necessary to perform a + * loop here. + */ + if (need_crc && length > 0) + { + uLong crc = png_ptr->crc; /* Should never issue a warning */ + + do + { + uInt safeLength = (uInt)length; + if (safeLength == 0) + safeLength = (uInt)-1; /* evil, but safe */ + + crc = crc32(crc, ptr, safeLength); + + /* The following should never issue compiler warnings, if they do the + * target system has characteristics that will probably violate other + * assumptions within the libpng code. + */ + ptr += safeLength; + length -= safeLength; + } + while (length > 0); + + /* And the following is always safe because the crc is only 32 bits. */ + png_ptr->crc = (png_uint_32)crc; + } } /* Check a user supplied version number, called from both read and write @@ -542,8 +570,8 @@ png_get_io_ptr(png_structp png_ptr) /* Initialize the default input/output functions for the PNG file. If you * use your own read or write routines, you can call either png_set_read_fn() * or png_set_write_fn() instead of png_init_io(). If you have defined - * PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't - * necessarily available. + * PNG_NO_STDIO or otherwise disabled PNG_STDIO_SUPPORTED, you must use a + * function of your own because "FILE *" isn't necessarily available. */ void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp) @@ -617,13 +645,13 @@ png_get_copyright(png_const_structp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.5.4 - July 7, 2011" PNG_STRING_NEWLINE \ + "libpng version 1.5.5 - September 22, 2011" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.5.4 - July 7, 2011\ + return "libpng version 1.5.5 - September 22, 2011\ Copyright (c) 1998-2011 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -713,18 +741,9 @@ png_access_version_number(void) #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) -# ifdef PNG_SIZE_T -/* Added at libpng version 1.2.6 */ - PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)); -png_size_t PNGAPI -png_convert_size(size_t size) -{ - if (size > (png_size_t)-1) - PNG_ABORT(); /* We haven't got access to png_ptr, so no png_error() */ - - return ((png_size_t)size); -} -# endif /* PNG_SIZE_T */ +/* png_convert_size: a PNGAPI but no longer in png.h, so deleted + * at libpng 1.5.5! + */ /* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */ # ifdef PNG_CHECK_cHRM_SUPPORTED @@ -798,6 +817,326 @@ png_check_cHRM_fixed(png_structp png_ptr, } # endif /* PNG_CHECK_cHRM_SUPPORTED */ +#ifdef PNG_cHRM_SUPPORTED +/* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for + * cHRM, as opposed to using chromaticities. These internal APIs return + * non-zero on a parameter error. The X, Y and Z values are required to be + * positive and less than 1.0. + */ +int png_xy_from_XYZ(png_xy *xy, png_XYZ XYZ) +{ + png_int_32 d, dwhite, whiteX, whiteY; + + d = XYZ.redX + XYZ.redY + XYZ.redZ; + if (!png_muldiv(&xy->redx, XYZ.redX, PNG_FP_1, d)) return 1; + if (!png_muldiv(&xy->redy, XYZ.redY, PNG_FP_1, d)) return 1; + dwhite = d; + whiteX = XYZ.redX; + whiteY = XYZ.redY; + + d = XYZ.greenX + XYZ.greenY + XYZ.greenZ; + if (!png_muldiv(&xy->greenx, XYZ.greenX, PNG_FP_1, d)) return 1; + if (!png_muldiv(&xy->greeny, XYZ.greenY, PNG_FP_1, d)) return 1; + dwhite += d; + whiteX += XYZ.greenX; + whiteY += XYZ.greenY; + + d = XYZ.blueX + XYZ.blueY + XYZ.blueZ; + if (!png_muldiv(&xy->bluex, XYZ.blueX, PNG_FP_1, d)) return 1; + if (!png_muldiv(&xy->bluey, XYZ.blueY, PNG_FP_1, d)) return 1; + dwhite += d; + whiteX += XYZ.blueX; + whiteY += XYZ.blueY; + + /* The reference white is simply the same of the end-point (X,Y,Z) vectors, + * thus: + */ + if (!png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite)) return 1; + if (!png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite)) return 1; + + return 0; +} + +int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy) +{ + png_fixed_point red_inverse, green_inverse, blue_scale; + png_fixed_point left, right, denominator; + + /* Check xy and, implicitly, z. Note that wide gamut color spaces typically + * have end points with 0 tristimulus values (these are impossible end + * points, but they are used to cover the possible colors.) + */ + if (xy.redx < 0 || xy.redx > PNG_FP_1) return 1; + if (xy.redy < 0 || xy.redy > PNG_FP_1-xy.redx) return 1; + if (xy.greenx < 0 || xy.greenx > PNG_FP_1) return 1; + if (xy.greeny < 0 || xy.greeny > PNG_FP_1-xy.greenx) return 1; + if (xy.bluex < 0 || xy.bluex > PNG_FP_1) return 1; + if (xy.bluey < 0 || xy.bluey > PNG_FP_1-xy.bluex) return 1; + if (xy.whitex < 0 || xy.whitex > PNG_FP_1) return 1; + if (xy.whitey < 0 || xy.whitey > PNG_FP_1-xy.whitex) return 1; + + /* The reverse calculation is more difficult because the original tristimulus + * value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8 + * derived values were recorded in the cHRM chunk; + * (red,green,blue,white)x(x,y). This loses one degree of freedom and + * therefore an arbitrary ninth value has to be introduced to undo the + * original transformations. + * + * Think of the original end-points as points in (X,Y,Z) space. The + * chromaticity values (c) have the property: + * + * C + * c = --------- + * X + Y + Z + * + * For each c (x,y,z) from the corresponding original C (X,Y,Z). Thus the + * three chromaticity values (x,y,z) for each end-point obey the + * relationship: + * + * x + y + z = 1 + * + * This describes the plane in (X,Y,Z) space that intersects each axis at the + * value 1.0; call this the chromaticity plane. Thus the chromaticity + * calculation has scaled each end-point so that it is on the x+y+z=1 plane + * and chromaticity is the intersection of the vector from the origin to the + * (X,Y,Z) value with the chromaticity plane. + * + * To fully invert the chromaticity calculation we would need the three + * end-point scale factors, (red-scale, green-scale, blue-scale), but these + * were not recorded. Instead we calculated the reference white (X,Y,Z) and + * recorded the chromaticity of this. The reference white (X,Y,Z) would have + * given all three of the scale factors since: + * + * color-C = color-c * color-scale + * white-C = red-C + green-C + blue-C + * = red-c*red-scale + green-c*green-scale + blue-c*blue-scale + * + * But cHRM records only white-x and white-y, so we have lost the white scale + * factor: + * + * white-C = white-c*white-scale + * + * To handle this the inverse transformation makes an arbitrary assumption + * about white-scale: + * + * Assume: white-Y = 1.0 + * Hence: white-scale = 1/white-y + * Or: red-Y + green-Y + blue-Y = 1.0 + * + * Notice the last statement of the assumption gives an equation in three of + * the nine values we want to calculate. 8 more equations come from the + * above routine as summarised at the top above (the chromaticity + * calculation): + * + * Given: color-x = color-X / (color-X + color-Y + color-Z) + * Hence: (color-x - 1)*color-X + color.x*color-Y + color.x*color-Z = 0 + * + * This is 9 simultaneous equations in the 9 variables "color-C" and can be + * solved by Cramer's rule. Cramer's rule requires calculating 10 9x9 matrix + * determinants, however this is not as bad as it seems because only 28 of + * the total of 90 terms in the various matrices are non-zero. Nevertheless + * Cramer's rule is notoriously numerically unstable because the determinant + * calculation involves the difference of large, but similar, numbers. It is + * difficult to be sure that the calculation is stable for real world values + * and it is certain that it becomes unstable where the end points are close + * together. + * + * So this code uses the perhaps slighly less optimal but more understandable + * and totally obvious approach of calculating color-scale. + * + * This algorithm depends on the precision in white-scale and that is + * (1/white-y), so we can immediately see that as white-y approaches 0 the + * accuracy inherent in the cHRM chunk drops off substantially. + * + * libpng arithmetic: a simple invertion of the above equations + * ------------------------------------------------------------ + * + * white_scale = 1/white-y + * white-X = white-x * white-scale + * white-Y = 1.0 + * white-Z = (1 - white-x - white-y) * white_scale + * + * white-C = red-C + green-C + blue-C + * = red-c*red-scale + green-c*green-scale + blue-c*blue-scale + * + * This gives us three equations in (red-scale,green-scale,blue-scale) where + * all the coefficients are now known: + * + * red-x*red-scale + green-x*green-scale + blue-x*blue-scale + * = white-x/white-y + * red-y*red-scale + green-y*green-scale + blue-y*blue-scale = 1 + * red-z*red-scale + green-z*green-scale + blue-z*blue-scale + * = (1 - white-x - white-y)/white-y + * + * In the last equation color-z is (1 - color-x - color-y) so we can add all + * three equations together to get an alternative third: + * + * red-scale + green-scale + blue-scale = 1/white-y = white-scale + * + * So now we have a Cramer's rule solution where the determinants are just + * 3x3 - far more tractible. Unfortunately 3x3 determinants still involve + * multiplication of three coefficients so we can't guarantee to avoid + * overflow in the libpng fixed point representation. Using Cramer's rule in + * floating point is probably a good choice here, but it's not an option for + * fixed point. Instead proceed to simplify the first two equations by + * eliminating what is likely to be the largest value, blue-scale: + * + * blue-scale = white-scale - red-scale - green-scale + * + * Hence: + * + * (red-x - blue-x)*red-scale + (green-x - blue-x)*green-scale = + * (white-x - blue-x)*white-scale + * + * (red-y - blue-y)*red-scale + (green-y - blue-y)*green-scale = + * 1 - blue-y*white-scale + * + * And now we can trivially solve for (red-scale,green-scale): + * + * green-scale = + * (white-x - blue-x)*white-scale - (red-x - blue-x)*red-scale + * ----------------------------------------------------------- + * green-x - blue-x + * + * red-scale = + * 1 - blue-y*white-scale - (green-y - blue-y) * green-scale + * --------------------------------------------------------- + * red-y - blue-y + * + * Hence: + * + * red-scale = + * ( (green-x - blue-x) * (white-y - blue-y) - + * (green-y - blue-y) * (white-x - blue-x) ) / white-y + * ------------------------------------------------------------------------- + * (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x) + * + * green-scale = + * ( (red-y - blue-y) * (white-x - blue-x) - + * (red-x - blue-x) * (white-y - blue-y) ) / white-y + * ------------------------------------------------------------------------- + * (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x) + * + * Accuracy: + * The input values have 5 decimal digits of accuracy. The values are all in + * the range 0 < value < 1, so simple products are in the same range but may + * need up to 10 decimal digits to preserve the original precision and avoid + * underflow. Because we are using a 32-bit signed representation we cannot + * match this; the best is a little over 9 decimal digits, less than 10. + * + * The approach used here is to preserve the maximum precision within the + * signed representation. Because the red-scale calculation above uses the + * difference between two products of values that must be in the range -1..+1 + * it is sufficient to divide the product by 7; ceil(100,000/32767*2). The + * factor is irrelevant in the calculation because it is applied to both + * numerator and denominator. + * + * Note that the values of the differences of the products of the + * chromaticities in the above equations tend to be small, for example for + * the sRGB chromaticities they are: + * + * red numerator: -0.04751 + * green numerator: -0.08788 + * denominator: -0.2241 (without white-y multiplication) + * + * The resultant Y coefficients from the chromaticities of some widely used + * color space definitions are (to 15 decimal places): + * + * sRGB + * 0.212639005871510 0.715168678767756 0.072192315360734 + * Kodak ProPhoto + * 0.288071128229293 0.711843217810102 0.000085653960605 + * Adobe RGB + * 0.297344975250536 0.627363566255466 0.075291458493998 + * Adobe Wide Gamut RGB + * 0.258728243040113 0.724682314948566 0.016589442011321 + */ + /* By the argument, above overflow should be impossible here. The return + * value of 2 indicates an internal error to the caller. + */ + if (!png_muldiv(&left, xy.greenx-xy.bluex, xy.redy - xy.bluey, 7)) return 2; + if (!png_muldiv(&right, xy.greeny-xy.bluey, xy.redx - xy.bluex, 7)) return 2; + denominator = left - right; + + /* Now find the red numerator. */ + if (!png_muldiv(&left, xy.greenx-xy.bluex, xy.whitey-xy.bluey, 7)) return 2; + if (!png_muldiv(&right, xy.greeny-xy.bluey, xy.whitex-xy.bluex, 7)) return 2; + + /* Overflow is possible here and it indicates an extreme set of PNG cHRM + * chunk values. This calculation actually returns the reciprocal of the + * scale value because this allows us to delay the multiplication of white-y + * into the denominator, which tends to produce a small number. + */ + if (!png_muldiv(&red_inverse, xy.whitey, denominator, left-right) || + red_inverse <= xy.whitey /* r+g+b scales = white scale */) + return 1; + + /* Similarly for green_inverse: */ + if (!png_muldiv(&left, xy.redy-xy.bluey, xy.whitex-xy.bluex, 7)) return 2; + if (!png_muldiv(&right, xy.redx-xy.bluex, xy.whitey-xy.bluey, 7)) return 2; + if (!png_muldiv(&green_inverse, xy.whitey, denominator, left-right) || + green_inverse <= xy.whitey) + return 1; + + /* And the blue scale, the checks above guarantee this can't overflow but it + * can still produce 0 for extreme cHRM values. + */ + blue_scale = png_reciprocal(xy.whitey) - png_reciprocal(red_inverse) - + png_reciprocal(green_inverse); + if (blue_scale <= 0) return 1; + + + /* And fill in the png_XYZ: */ + if (!png_muldiv(&XYZ->redX, xy.redx, PNG_FP_1, red_inverse)) return 1; + if (!png_muldiv(&XYZ->redY, xy.redy, PNG_FP_1, red_inverse)) return 1; + if (!png_muldiv(&XYZ->redZ, PNG_FP_1 - xy.redx - xy.redy, PNG_FP_1, + red_inverse)) + return 1; + + if (!png_muldiv(&XYZ->greenX, xy.greenx, PNG_FP_1, green_inverse)) return 1; + if (!png_muldiv(&XYZ->greenY, xy.greeny, PNG_FP_1, green_inverse)) return 1; + if (!png_muldiv(&XYZ->greenZ, PNG_FP_1 - xy.greenx - xy.greeny, PNG_FP_1, + green_inverse)) + return 1; + + if (!png_muldiv(&XYZ->blueX, xy.bluex, blue_scale, PNG_FP_1)) return 1; + if (!png_muldiv(&XYZ->blueY, xy.bluey, blue_scale, PNG_FP_1)) return 1; + if (!png_muldiv(&XYZ->blueZ, PNG_FP_1 - xy.bluex - xy.bluey, blue_scale, + PNG_FP_1)) + return 1; + + return 0; /*success*/ +} + +int png_XYZ_from_xy_checked(png_structp png_ptr, png_XYZ *XYZ, png_xy xy) +{ + switch (png_XYZ_from_xy(XYZ, xy)) + { + case 0: /* success */ + return 1; + + case 1: + /* The chunk may be technically valid, but we got png_fixed_point + * overflow while trying to get XYZ values out of it. This is + * entirely benign - the cHRM chunk is pretty extreme. + */ + png_warning(png_ptr, + "extreme cHRM chunk cannot be converted to tristimulus values"); + break; + + default: + /* libpng is broken; this should be a warning but if it happens we + * want error reports so for the moment it is an error. + */ + png_error(png_ptr, "internal error in png_XYZ_from_xy"); + break; + } + + /* ERROR RETURN */ + return 0; +} +#endif + void /* PRIVATE */ png_check_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, @@ -1383,18 +1722,30 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, size -= cdigits; *ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */ - if (exp_b10 < 0) + + /* The following use of an unsigned temporary avoids ambiguities in + * the signed arithmetic on exp_b10 and permits GCC at least to do + * better optimization. + */ { - *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */ - exp_b10 = -exp_b10; - } + unsigned int uexp_b10; + + if (exp_b10 < 0) + { + *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */ + uexp_b10 = -exp_b10; + } - cdigits = 0; + else + uexp_b10 = exp_b10; - while (exp_b10 > 0) - { - exponent[cdigits++] = (char)(48 + exp_b10 % 10); - exp_b10 /= 10; + cdigits = 0; + + while (uexp_b10 > 0) + { + exponent[cdigits++] = (char)(48 + uexp_b10 % 10); + uexp_b10 /= 10; + } } /* Need another size check here for the exponent digits, so @@ -1452,7 +1803,7 @@ png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size, else num = fp; - if (num <= 0x80000000U) /* else overflowed */ + if (num <= 0x80000000) /* else overflowed */ { unsigned int ndigits = 0, first = 16 /* flag value */; char digits[10]; diff --git a/Build/source/libs/libpng/libpng-1.5.4/png.h b/Build/source/libs/libpng/libpng-1.5.5/png.h index c655a51af26..7c8a9c2431c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/png.h +++ b/Build/source/libs/libpng/libpng-1.5.5/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.4 - July 7, 2011 + * libpng version 1.5.5 - September 22, 2011 * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.5.4 - July 7, 2011: Glenn + * libpng versions 0.97, January 1998, through 1.5.5 - September 22, 2011: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -157,6 +157,9 @@ * 1.5.4beta01-08 15 10504 15.so.15.4[.0] * 1.5.4rc01 15 10504 15.so.15.4[.0] * 1.5.4 15 10504 15.so.15.4[.0] + * 1.5.5beta01-08 15 10505 15.so.15.5[.0] + * 1.5.5rc01 15 10505 15.so.15.5[.0] + * 1.5.5 15 10505 15.so.15.5[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -188,7 +191,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are + * libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are * Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: @@ -300,13 +303,13 @@ * Y2K compliance in libpng: * ========================= * - * July 7, 2011 + * September 22, 2011 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.5.4 are Y2K compliant. It is my belief that + * upward through 1.5.5 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -361,9 +364,9 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.5.4" +#define PNG_LIBPNG_VER_STRING "1.5.5" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.4 - July 7, 2011\n" + " libpng version 1.5.5 - September 22, 2011\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 @@ -371,7 +374,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 5 -#define PNG_LIBPNG_VER_RELEASE 4 +#define PNG_LIBPNG_VER_RELEASE 5 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ @@ -401,7 +404,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10504 /* 1.5.4 */ +#define PNG_LIBPNG_VER 10505 /* 1.5.5 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -523,7 +526,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_5_4; +typedef char* png_libpng_version_1_5_5; /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to @@ -793,7 +796,7 @@ typedef png_info FAR * FAR * png_infopp; #define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ -#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using @@ -2047,6 +2050,10 @@ PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structp png_ptr, png_const_infop info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)); +PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_structp png_ptr, + png_const_infop info_ptr, double *red_X, double *red_Y, double *red_Z, + double *green_X, double *green_Y, double *green_Z, double *blue_X, + double *blue_Y, double *blue_Z)); #ifdef PNG_FIXED_POINT_SUPPORTED /* Otherwise not implemented */ PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structp png_ptr, @@ -2056,6 +2063,13 @@ PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)); #endif +PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, + (png_structp png_ptr, png_const_infop info_ptr, + png_fixed_point *int_red_X, png_fixed_point *int_red_Y, + png_fixed_point *int_red_Z, png_fixed_point *int_green_X, + png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, + png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, + png_fixed_point *int_blue_Z)); #endif #ifdef PNG_cHRM_SUPPORTED @@ -2063,12 +2077,22 @@ PNG_FP_EXPORT(135, void, png_set_cHRM, (png_structp png_ptr, png_infop info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)); +PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_structp png_ptr, + png_infop info_ptr, double red_X, double red_Y, double red_Z, + double green_X, double green_Y, double green_Z, double blue_X, + double blue_Y, double blue_Z)); PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_structp png_ptr, png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)); +PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, + png_fixed_point int_red_Z, png_fixed_point int_green_X, + png_fixed_point int_green_Y, png_fixed_point int_green_Z, + png_fixed_point int_blue_X, png_fixed_point int_blue_Y, + png_fixed_point int_blue_Z)); #endif #ifdef PNG_gAMA_SUPPORTED @@ -2282,7 +2306,7 @@ PNG_EXPORT(171, void, png_set_sCAL_s, handling or default unknown chunk handling is not desired. Any chunks not listed will be handled in the default manner. The IHDR and IEND chunks must not be listed. - keep = 0: follow default behaviour + keep = 0: follow default behavior = 1: do not keep = 2: keep only if safe-to-copy = 3: keep even if unsafe-to-copy @@ -2492,14 +2516,14 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - - (png_uint_16)(alpha)) + (png_uint_16)128); \ + - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ - + (png_uint_32)(bg)*(png_uint_32)(65535L \ - - (png_uint_32)(alpha)) + (png_uint_32)32768L); \ + + (png_uint_32)(bg)*(65535 \ + - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } #else /* Standard method using integer division */ @@ -2507,12 +2531,12 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, # define png_composite(composite, fg, alpha, bg) \ (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ - (png_uint_16)127) / 255) + 127) / 255) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ - (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ - (png_uint_32)32767) / (png_uint_32)65535L) + (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ + 32767) / 65535) #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED @@ -2576,7 +2600,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL - PNG_EXPORT_LAST_ORDINAL(229); + PNG_EXPORT_LAST_ORDINAL(233); #endif #ifdef __cplusplus diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngbar.jpg b/Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg Binary files differindex 70ba8d817ce..70ba8d817ce 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngbar.jpg +++ b/Build/source/libs/libpng/libpng-1.5.5/pngbar.jpg diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngbar.png b/Build/source/libs/libpng/libpng-1.5.5/pngbar.png Binary files differindex 49798c8ed95..49798c8ed95 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngbar.png +++ b/Build/source/libs/libpng/libpng-1.5.5/pngbar.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngconf.h b/Build/source/libs/libpng/libpng-1.5.5/pngconf.h index 222816e3721..05dd2928f52 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngconf.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.5.4 - July 7, 2011 + * libpng version 1.5.5 - September 22, 2011 * * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -164,7 +164,9 @@ * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to - * make a symbol exported from the DLL. + * make a symbol exported from the DLL. Not used in the + * public header files; see pngpriv.h for how it is used + * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when @@ -258,25 +260,14 @@ # define PNGAPI PNGCAPI #endif -/* The default for PNG_IMPEXP depends on whether the library is - * being built or used. +/* PNG_IMPEXP may be set on the compilation system command line or (if not set) + * then in an internal header file when building the library, otherwise (when + * using the library) it is set here. */ #ifndef PNG_IMPEXP -# ifdef PNGLIB_BUILD - /* Building the library */ -# if (defined(DLL_EXPORT)/*from libtool*/ ||\ - defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\ - defined(_USRDLL) ||\ - defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT) - /* Building a DLL. */ -# define PNG_IMPEXP PNG_DLL_EXPORT -# endif /* DLL */ -# else - /* Using the library */ -# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) - /* This forces use of a DLL, disallowing static linking */ -# define PNG_IMPEXP PNG_DLL_IMPORT -# endif +# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) + /* This forces use of a DLL, disallowing static linking */ +# define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP @@ -356,25 +347,18 @@ # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNGLIB_BUILD -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +# if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) +# else +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) # endif -# endif /* PNGLIB_BUILD */ +# endif # endif /* __GNUC__ */ # if defined(_MSC_VER) && (_MSC_VER >= 1300) @@ -385,23 +369,16 @@ # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED -# if (_MSC_VER >= 1400) +# if defined(_MSC_VER) && (_MSC_VER >= 1300) # define PNG_ALLOCATED __declspec(restrict) # endif # endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNGLIB_BUILD -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __declspec(deprecated) -# endif -# ifndef PNG_PRIVATE -# define PNG_PRIVATE __declspec(deprecated) -# endif -# endif /* PNGLIB_BUILD */ +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __declspec(deprecated) +# endif +# ifndef PNG_PRIVATE +# define PNG_PRIVATE __declspec(deprecated) +# endif # endif /* _MSC_VER */ #endif /* PNG_PEDANTIC_WARNINGS */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngdebug.h b/Build/source/libs/libpng/libpng-1.5.5/pngdebug.h index 16f81fdd141..16f81fdd141 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngdebug.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pngdebug.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngerror.c b/Build/source/libs/libpng/libpng-1.5.5/pngerror.c index 4d4cebafa94..4d4cebafa94 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngerror.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngerror.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngget.c b/Build/source/libs/libpng/libpng-1.5.5/pngget.c index b5e5798c020..3c1b4091aaf 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngget.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngget.c @@ -1,7 +1,7 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.5.1 [February 3, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -459,6 +459,65 @@ png_get_bKGD(png_const_structp png_ptr, png_infop info_ptr, #endif #ifdef PNG_cHRM_SUPPORTED +/* The XYZ APIs were added in 1.5.5 to take advantage of the code added at the + * same time to correct the rgb grayscale coefficient defaults obtained from the + * cHRM chunk in 1.5.4 + */ +png_uint_32 PNGFAPI +png_get_cHRM_XYZ_fixed(png_structp png_ptr, png_const_infop info_ptr, + png_fixed_point *int_red_X, png_fixed_point *int_red_Y, + png_fixed_point *int_red_Z, png_fixed_point *int_green_X, + png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, + png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, + png_fixed_point *int_blue_Z) +{ + if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) + { + png_xy xy; + png_XYZ XYZ; + + png_debug1(1, "in %s retrieval function", "cHRM_XYZ"); + + xy.whitex = info_ptr->x_white; + xy.whitey = info_ptr->y_white; + xy.redx = info_ptr->x_red; + xy.redy = info_ptr->y_red; + xy.greenx = info_ptr->x_green; + xy.greeny = info_ptr->y_green; + xy.bluex = info_ptr->x_blue; + xy.bluey = info_ptr->y_blue; + + /* The *_checked function handles error reporting, so just return 0 if + * there is a failure here. + */ + if (png_XYZ_from_xy_checked(png_ptr, &XYZ, xy)) + { + if (int_red_X != NULL) + *int_red_X = XYZ.redX; + if (int_red_Y != NULL) + *int_red_Y = XYZ.redY; + if (int_red_Z != NULL) + *int_red_Z = XYZ.redZ; + if (int_green_X != NULL) + *int_green_X = XYZ.greenX; + if (int_green_Y != NULL) + *int_green_Y = XYZ.greenY; + if (int_green_Z != NULL) + *int_green_Z = XYZ.greenZ; + if (int_blue_X != NULL) + *int_blue_X = XYZ.blueX; + if (int_blue_Y != NULL) + *int_blue_Y = XYZ.blueY; + if (int_blue_Z != NULL) + *int_blue_Z = XYZ.blueZ; + + return (PNG_INFO_cHRM); + } + } + + return (0); +} + # ifdef PNG_FLOATING_POINT_SUPPORTED png_uint_32 PNGAPI png_get_cHRM(png_const_structp png_ptr, png_const_infop info_ptr, @@ -490,6 +549,42 @@ png_get_cHRM(png_const_structp png_ptr, png_const_infop info_ptr, return (0); } + +png_uint_32 PNGAPI +png_get_cHRM_XYZ(png_structp png_ptr, png_const_infop info_ptr, + double *red_X, double *red_Y, double *red_Z, double *green_X, + double *green_Y, double *green_Z, double *blue_X, double *blue_Y, + double *blue_Z) +{ + png_XYZ XYZ; + + if (png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, + &XYZ.redX, &XYZ.redY, &XYZ.redZ, &XYZ.greenX, &XYZ.greenY, &XYZ.greenZ, + &XYZ.blueX, &XYZ.blueY, &XYZ.blueZ) & PNG_INFO_cHRM) + { + if (red_X != NULL) + *red_X = png_float(png_ptr, XYZ.redX, "cHRM red X"); + if (red_Y != NULL) + *red_Y = png_float(png_ptr, XYZ.redY, "cHRM red Y"); + if (red_Z != NULL) + *red_Z = png_float(png_ptr, XYZ.redZ, "cHRM red Z"); + if (green_X != NULL) + *green_X = png_float(png_ptr, XYZ.greenX, "cHRM green X"); + if (green_Y != NULL) + *green_Y = png_float(png_ptr, XYZ.greenY, "cHRM green Y"); + if (green_Z != NULL) + *green_Z = png_float(png_ptr, XYZ.greenZ, "cHRM green Z"); + if (blue_X != NULL) + *blue_X = png_float(png_ptr, XYZ.blueX, "cHRM blue X"); + if (blue_Y != NULL) + *blue_Y = png_float(png_ptr, XYZ.blueY, "cHRM blue Y"); + if (blue_Z != NULL) + *blue_Z = png_float(png_ptr, XYZ.blueZ, "cHRM blue Z"); + return (PNG_INFO_cHRM); + } + + return (0); +} # endif # ifdef PNG_FIXED_POINT_SUPPORTED @@ -971,7 +1066,7 @@ png_get_user_chunk_ptr(png_const_structp png_ptr) png_size_t PNGAPI png_get_compression_buffer_size(png_const_structp png_ptr) { - return (png_ptr ? png_ptr->zbuf_size : 0L); + return (png_ptr ? png_ptr->zbuf_size : 0); } diff --git a/Build/source/libs/libpng/libpng-1.5.4/pnginfo.h b/Build/source/libs/libpng/libpng-1.5.5/pnginfo.h index a33bfab06de..a33bfab06de 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pnginfo.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pnginfo.h diff --git a/Build/source/libs/libpng/libpng-1.5.4/pnglibconf.h b/Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h index 827d17e544c..8022a5a8814 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pnglibconf.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pnglibconf.h @@ -33,8 +33,8 @@ #define PNG_sCAL_PRECISION 5 #define PNG_USER_CHUNK_CACHE_MAX 0 #define PNG_USER_CHUNK_MALLOC_MAX 0 -#define PNG_USER_HEIGHT_MAX 1000000L -#define PNG_USER_WIDTH_MAX 1000000L +#define PNG_USER_HEIGHT_MAX 1000000 +#define PNG_USER_WIDTH_MAX 1000000 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 /* end of settings */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngmem.c b/Build/source/libs/libpng/libpng-1.5.5/pngmem.c index ea606d6a624..ea606d6a624 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngmem.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngmem.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngnow.png b/Build/source/libs/libpng/libpng-1.5.5/pngnow.png Binary files differindex 82793ebddb7..82793ebddb7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngnow.png +++ b/Build/source/libs/libpng/libpng-1.5.5/pngnow.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngpread.c b/Build/source/libs/libpng/libpng-1.5.5/pngpread.c index a50292a76ad..a50292a76ad 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngpread.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngpread.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngpriv.h b/Build/source/libs/libpng/libpng-1.5.5/pngpriv.h index 5b4d2127cc9..dad2837aa71 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngpriv.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pngpriv.h @@ -6,7 +6,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -44,7 +44,8 @@ */ #include <stdlib.h> -#define PNGLIB_BUILD +#define PNGLIB_BUILD /*libpng is being built, not used*/ + #ifdef PNG_USER_CONFIG # include "pngusr.h" /* These should have been defined in pngusr.h */ @@ -55,10 +56,80 @@ # define PNG_USER_DLLFNAME_POSTFIX "Cb" # endif #endif + +/* Is this a build of a DLL where compilation of the object modules requires + * different preprocessor settings to those required for a simple library? If + * so PNG_BUILD_DLL must be set. + * + * If libpng is used inside a DLL but that DLL does not export the libpng APIs + * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a + * static library of libpng then link the DLL against that. + */ +#ifndef PNG_BUILD_DLL +# ifdef DLL_EXPORT + /* This is set by libtool when files are compiled for a DLL; libtool + * always compiles twice, even on systems where it isn't necessary. Set + * PNG_BUILD_DLL in case it is necessary: + */ +# define PNG_BUILD_DLL +# else +# ifdef _WINDLL + /* This is set by the Microsoft Visual Studio IDE in projects that + * build a DLL. It can't easily be removed from those projects (it + * isn't visible in the Visual Studio UI) so it is a fairly reliable + * indication that PNG_IMPEXP needs to be set to the DLL export + * attributes. + */ +# define PNG_BUILD_DLL +# else +# ifdef __DLL__ + /* This is set by the Borland C system when compiling for a DLL + * (as above.) + */ +# define PNG_BUILD_DLL +# else + /* Add additional compiler cases here. */ +# endif +# endif +# endif +#endif /* Setting PNG_BUILD_DLL if required */ + +/* See pngconf.h for more details: the builder of the library may set this on + * the command line to the right thing for the specific compilation system or it + * may be automagically set above (at present we know of no system where it does + * need to be set on the command line.) + * + * PNG_IMPEXP must be set here when building the library to prevent pngconf.h + * setting it to the "import" setting for a DLL build. + */ +#ifndef PNG_IMPEXP +# ifdef PNG_BUILD_DLL +# define PNG_IMPEXP PNG_DLL_EXPORT +# else + /* Not building a DLL, or the DLL doesn't require specific export + * definitions. + */ +# define PNG_IMPEXP +# endif +#endif + +/* No warnings for private or deprecated functions in the build: */ +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED +#endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE +#endif + #include "png.h" #include "pnginfo.h" #include "pngstruct.h" +/* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ +#ifndef PNG_DLL_EXPORT +# define PNG_DLL_EXPORT +#endif + /* This is used for 16 bit gamma tables - only the top level pointers are const, * this could be changed: */ @@ -293,24 +364,23 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; #define PNG_EXPAND 0x1000 #define PNG_GAMMA 0x2000 #define PNG_GRAY_TO_RGB 0x4000 -#define PNG_FILLER 0x8000L -#define PNG_PACKSWAP 0x10000L -#define PNG_SWAP_ALPHA 0x20000L -#define PNG_STRIP_ALPHA 0x40000L -#define PNG_INVERT_ALPHA 0x80000L -#define PNG_USER_TRANSFORM 0x100000L -#define PNG_RGB_TO_GRAY_ERR 0x200000L -#define PNG_RGB_TO_GRAY_WARN 0x400000L -#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ -#define PNG_ENCODE_ALPHA 0x800000L /* Added to libpng-1.5.4 */ -#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ -#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ -#define PNG_SCALE_16_TO_8 0x4000000L /* Added to libpng-1.5.4 */ - /* 0x8000000L unused */ - /* 0x10000000L unused */ - /* 0x20000000L unused */ - /* 0x40000000L unused */ - +#define PNG_FILLER 0x8000 +#define PNG_PACKSWAP 0x10000 +#define PNG_SWAP_ALPHA 0x20000 +#define PNG_STRIP_ALPHA 0x40000 +#define PNG_INVERT_ALPHA 0x80000 +#define PNG_USER_TRANSFORM 0x100000 +#define PNG_RGB_TO_GRAY_ERR 0x200000 +#define PNG_RGB_TO_GRAY_WARN 0x400000 +#define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ +#define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ +#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ +#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ +#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ + /* 0x8000000 unused */ + /* 0x10000000 unused */ + /* 0x20000000 unused */ + /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 @@ -335,22 +405,22 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; #define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ -#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L -#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L -#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L -#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L -#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L -#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L - /* 0x200000L unused */ - /* 0x400000L unused */ -#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000L /* Added to libpng-1.4.0 */ -#define PNG_FLAG_ZTXT_CUSTOM_STRATEGY 0x1000000L /* 5 lines added */ -#define PNG_FLAG_ZTXT_CUSTOM_LEVEL 0x2000000L /* to libpng-1.5.4 */ -#define PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL 0x4000000L -#define PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS 0x8000000L -#define PNG_FLAG_ZTXT_CUSTOM_METHOD 0x10000000L - /* 0x20000000L unused */ - /* 0x40000000L unused */ +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 +#define PNG_FLAG_LIBRARY_MISMATCH 0x20000 +#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 +#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 +#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000 + /* 0x200000 unused */ + /* 0x400000 unused */ +#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000 /* Added to libpng-1.4.0 */ +#define PNG_FLAG_ZTXT_CUSTOM_STRATEGY 0x1000000 /* 5 lines added */ +#define PNG_FLAG_ZTXT_CUSTOM_LEVEL 0x2000000 /* to libpng-1.5.4 */ +#define PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL 0x4000000 +#define PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS 0x8000000 +#define PNG_FLAG_ZTXT_CUSTOM_METHOD 0x10000000 + /* 0x20000000 unused */ + /* 0x40000000 unused */ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ PNG_FLAG_CRC_ANCILLARY_NOWARN) @@ -1078,6 +1148,35 @@ PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2, unsigned long *hi_product, unsigned long *lo_product)); #endif +#ifdef PNG_cHRM_SUPPORTED +/* Added at libpng version 1.5.5 */ +typedef struct png_xy +{ + png_fixed_point redx, redy; + png_fixed_point greenx, greeny; + png_fixed_point bluex, bluey; + png_fixed_point whitex, whitey; +} png_xy; + +typedef struct png_XYZ +{ + png_fixed_point redX, redY, redZ; + png_fixed_point greenX, greenY, greenZ; + png_fixed_point blueX, blueY, blueZ; +} png_XYZ; + +/* The conversion APIs return 0 on success, non-zero on a parameter error. They + * allow conversion between the above representations of a color encoding. When + * converting from XYZ end points to chromaticities the absolute magnitude of + * the end points is lost, when converting back the sum of the Y values of the + * three end points will be 1.0 + */ +PNG_EXTERN int png_xy_from_XYZ PNGARG((png_xy *xy, png_XYZ XYZ)); +PNG_EXTERN int png_XYZ_from_xy PNGARG((png_XYZ *XYZ, png_xy xy)); +PNG_EXTERN int png_XYZ_from_xy_checked PNGARG((png_structp png_ptr, + png_XYZ *XYZ, png_xy xy)); +#endif + /* Added at libpng version 1.4.0 */ PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngread.c b/Build/source/libs/libpng/libpng-1.5.5/pngread.c index be3df47693d..be3df47693d 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngread.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngread.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngrio.c b/Build/source/libs/libpng/libpng-1.5.5/pngrio.c index e9c381c5ba4..e9c381c5ba4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngrio.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngrio.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngrtran.c b/Build/source/libs/libpng/libpng-1.5.5/pngrtran.c index 4e0401aa9f0..f8847902340 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngrtran.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngrtran.c @@ -1,7 +1,7 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -968,13 +968,17 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, { png_uint_16 red_int, green_int; - red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L); - green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L); + /* NOTE: this calculation does not round, but this behavior is retained + * for consistency, the inaccuracy is very small. The code here always + * overwrites the coefficients, regardless of whether they have been + * defaulted or set already. + */ + red_int = (png_uint_16)(((png_uint_32)red*32768)/100000); + green_int = (png_uint_16)(((png_uint_32)green*32768)/100000); png_ptr->rgb_to_gray_red_coeff = red_int; png_ptr->rgb_to_gray_green_coeff = green_int; - png_ptr->rgb_to_gray_blue_coeff = - (png_uint_16)(32768 - red_int - green_int); + png_ptr->rgb_to_gray_coefficients_set = 1; } else @@ -983,17 +987,18 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients"); - /* Use the defaults, from the cHRM chunk if set, else the built in Rec - * 709 values (which correspond to sRGB, so we don't have to worry - * about the sRGB chunk!) + /* Use the defaults, from the cHRM chunk if set, else the historical + * values which are close to the sRGB/HDTV/ITU-Rec 709 values. See + * png_do_rgb_to_gray for more discussion of the values. In this case + * the coefficients are not marked as 'set' and are not overwritten if + * something has already provided a default. */ if (png_ptr->rgb_to_gray_red_coeff == 0 && - png_ptr->rgb_to_gray_green_coeff == 0 && - png_ptr->rgb_to_gray_blue_coeff == 0) + png_ptr->rgb_to_gray_green_coeff == 0) { - png_ptr->rgb_to_gray_red_coeff = 6968; /* .212671 * 32768 + .5 */ - png_ptr->rgb_to_gray_green_coeff = 23434; /* .715160 * 32768 + .5 */ - png_ptr->rgb_to_gray_blue_coeff = 2366; + png_ptr->rgb_to_gray_red_coeff = 6968; + png_ptr->rgb_to_gray_green_coeff = 23434; + /* png_ptr->rgb_to_gray_blue_coeff = 2366; */ } } } @@ -1401,7 +1406,7 @@ png_init_read_transformations(png_structp png_ptr) if (png_ptr->transformations & PNG_BACKGROUND_EXPAND) { /* PNG_BACKGROUND_EXPAND: the background is in the file color space, so if - * the file was greyscale the background value is gray. + * the file was grayscale the background value is gray. */ if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; @@ -1635,7 +1640,7 @@ png_init_read_transformations(png_structp png_ptr) /* Prevent the transformations being done again. * - * NOTE: this is highly dubious; it zaps the transformations in + * NOTE: this is highly dubious; it removes the transformations in * place. This seems inconsistent with the general treatment of the * transformations elsewhere. */ @@ -3066,33 +3071,61 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB files to grayscale, with or without alpha - * using the equation given in Poynton's ColorFAQ at - * <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008) - * New link: - * <http://www.poynton.com/notes/colour_and_gamma/> + * using the equation given in Poynton's ColorFAQ of 1998-01-04 at + * <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but + * versions dated 1998 through November 2002 have been archived at + * http://web.archive.org/web/20000816232553/http://www.inforamp.net/ + * ~poynton/notes/colour_and_gamma/ColorFAQ.txt ) * Charles Poynton poynton at poynton.com * * Y = 0.212671 * R + 0.715160 * G + 0.072169 * B * - * We approximate this with + * which can be expressed with integers as + * + * Y = (6969 * R + 23434 * G + 2365 * B)/32768 + * + * Poynton's current link (as of January 2003 through July 2011): + * <http://www.poynton.com/notes/colour_and_gamma/> + * has changed the numbers slightly: * - * Y = 0.21268 * R + 0.7151 * G + 0.07217 * B + * Y = 0.2126*R + 0.7152*G + 0.0722*B * * which can be expressed with integers as * - * Y = (6969 * R + 23434 * G + 2365 * B)/32768 + * Y = (6966 * R + 23436 * G + 2366 * B)/32768 * - * The calculation is to be done in a linear colorspace. + * Historically, however, libpng uses numbers derived from the ITU-R Rec 709 + * end point chromaticities and the D65 white point. Depending on the + * precision used for the D65 white point this produces a variety of different + * numbers, however if the four decimal place value used in ITU-R Rec 709 is + * used (0.3127,0.3290) the Y calculation would be: * - * Other integer coefficents can be used via png_set_rgb_to_gray(). + * Y = (6968 * R + 23435 * G + 2366 * B)/32768 + * + * While this is correct the rounding results in an overflow for white, because + * the sum of the rounded coefficients is 32769, not 32768. Consequently + * libpng uses, instead, the closest non-overflowing approximation: + * + * Y = (6968 * R + 23434 * G + 2366 * B)/32768 + * + * Starting with libpng-1.5.5, if the image being converted has a cHRM chunk + * (including an sRGB chunk) then the chromaticities are used to calculate the + * coefficients. See the chunk handling in pngrutil.c for more information. + * + * In all cases the calculation is to be done in a linear colorspace. If no + * gamma information is available to correct the encoding of the original RGB + * values this results in an implicit assumption that the original PNG RGB + * values were linear. + * + * Other integer coefficents can be used via png_set_rgb_to_gray(). Because + * the API takes just red and green coefficients the blue coefficient is + * calculated to make the sum 32768. This will result in different rounding + * to that used above. */ int /* PRIVATE */ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) { - png_uint_32 i; - - png_uint_32 row_width = row_info->width; int rgb_error = 0; png_debug(1, "in png_do_rgb_to_gray"); @@ -3100,234 +3133,179 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) if (!(row_info->color_type & PNG_COLOR_MASK_PALETTE) && (row_info->color_type & PNG_COLOR_MASK_COLOR)) { - png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - png_uint_32 bc = png_ptr->rgb_to_gray_blue_coeff; + PNG_CONST png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; + PNG_CONST png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; + PNG_CONST png_uint_32 bc = 32768 - rc - gc; + PNG_CONST png_uint_32 row_width = row_info->width; + PNG_CONST int have_alpha = + (row_info->color_type & PNG_COLOR_MASK_ALPHA) != 0; - if (row_info->color_type == PNG_COLOR_TYPE_RGB) + if (row_info->bit_depth == 8) { - if (row_info->bit_depth == 8) - { #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) + /* Notice that gamma to/from 1 are not necessarily inverses (if + * there is an overall gamma correction). Prior to 1.5.5 this code + * checked the linearized values for equality; this doesn't match + * the documentation, the original values must be checked. + */ + if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) + { + png_bytep sp = row; + png_bytep dp = row; + png_uint_32 i; + + for (i = 0; i < row_width; i++) { - png_bytep sp = row; - png_bytep dp = row; + png_byte red = *(sp++); + png_byte green = *(sp++); + png_byte blue = *(sp++); - for (i = 0; i < row_width; i++) + if (red != green || red != blue) { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; - - if (red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1[ - (rc*red + gc*green + bc*blue)>>15]; - } + red = png_ptr->gamma_to_1[red]; + green = png_ptr->gamma_to_1[green]; + blue = png_ptr->gamma_to_1[blue]; - else - *(dp++) = *(sp - 1); + rgb_error |= 1; + *(dp++) = png_ptr->gamma_from_1[ + (rc*red + gc*green + bc*blue + 16384)>>15]; } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if (red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - } + else + { + /* If there is no overall correction the table will not be + * set. + */ + if (png_ptr->gamma_table != NULL) + red = png_ptr->gamma_table[red]; - else - *(dp++) = *(sp - 1); + *(dp++) = red; } + + if (have_alpha) + *(dp++) = *(sp++); } } - - else /* RGB bit_depth == 16 */ + else +#endif { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - - if (red == green && red == blue) - w = red; - - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) - >> png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = - png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) - >> png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 - + bc*blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } + png_bytep sp = row; + png_bytep dp = row; + png_uint_32 i; - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - } - } - else -#endif + for (i = 0; i < row_width; i++) { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; + png_byte red = *(sp++); + png_byte green = *(sp++); + png_byte blue = *(sp++); - red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; + if (red != green || red != blue) + { + rgb_error |= 1; + /*NOTE: this is the historical approach which simply + * truncates the results. + */ + *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); + } - if (red != green || red != blue) - rgb_error |= 1; + else + *(dp++) = red; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - } + if (have_alpha) + *(dp++) = *(sp++); } } } - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) + + else /* RGB bit_depth == 16 */ { - if (row_info->bit_depth == 8) - { #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) + if (png_ptr->gamma_16_to_1 != NULL && png_ptr->gamma_16_from_1 != NULL) + { + png_bytep sp = row; + png_bytep dp = row; + png_uint_32 i; + + for (i = 0; i < row_width; i++) { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; + png_uint_16 red, green, blue, w; - if (red != green || red != blue) - rgb_error |= 1; + red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; + green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; + blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - *(dp++) = png_ptr->gamma_from_1 - [(rc*red + gc*green + bc*blue)>>15]; + if (red == green && red == blue) + { + if (png_ptr->gamma_16_table != NULL) + w = png_ptr->gamma_16_table[(red&0xff) + >> png_ptr->gamma_shift][red>>8]; - *(dp++) = *(sp++); /* alpha */ + else + w = red; } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) + + else { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if (red != green || red != blue) - rgb_error |= 1; - - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = *(sp++); /* alpha */ + png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) + >> png_ptr->gamma_shift][red>>8]; + png_uint_16 green_1 = + png_ptr->gamma_16_to_1[(green&0xff) >> + png_ptr->gamma_shift][green>>8]; + png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) + >> png_ptr->gamma_shift][blue>>8]; + png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 + + bc*blue_1 + 16384)>>15); + w = png_ptr->gamma_16_from_1[(gray16&0xff) >> + png_ptr->gamma_shift][gray16 >> 8]; + rgb_error |= 1; + } + + *(dp++) = (png_byte)((w>>8) & 0xff); + *(dp++) = (png_byte)(w & 0xff); + + if (have_alpha) + { + *(dp++) = *(sp++); + *(dp++) = *(sp++); } } } - else /* RGBA bit_depth == 16 */ + else +#endif { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - - if (red == green && red == blue) - w = red; - - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - - png_uint_16 green_1 = - png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; + png_bytep sp = row; + png_bytep dp = row; + png_uint_32 i; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; + for (i = 0; i < row_width; i++) + { + png_uint_16 red, green, blue, gray16; - png_uint_16 gray16 = (png_uint_16)((rc * red_1 - + gc * green_1 + bc * blue_1)>>15); + red = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; + green = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; + blue = (png_uint_16)(((*(sp))<<8) | *(sp + 1)); sp += 2; - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; + if (red != green || red != blue) + rgb_error |= 1; - rgb_error |= 1; - } + /* From 1.5.5 in the 16 bit case do the accurate convertion even + * in the 'fast' case - this is because this is where the code + * ends up when handling linear 16 bit data. + */ + gray16 = (png_uint_16)((rc*red + gc*green + bc*blue + 16384) >> + 15); + *(dp++) = (png_byte)((gray16>>8) & 0xff); + *(dp++) = (png_byte)(gray16 & 0xff); - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - *(dp++) = *(sp++); /* alpha */ - *(dp++) = *(sp++); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) + if (have_alpha) { - png_uint_16 red, green, blue, gray16; - red = (png_uint_16)((*(sp)<<8) | *(sp + 1)); sp += 2; - green = (png_uint_16)((*(sp)<<8) | *(sp + 1)); sp += 2; - blue = (png_uint_16)((*(sp)<<8) | *(sp + 1)); sp += 2; - - if (red != green || red != blue) - rgb_error |= 1; - - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - *(dp++) = *(sp++); /* alpha */ + *(dp++) = *(sp++); *(dp++) = *(sp++); } } } } + row_info->channels -= 2; row_info->color_type = (png_byte)(row_info->color_type & ~PNG_COLOR_MASK_COLOR); @@ -4762,7 +4740,7 @@ png_do_expand(png_row_infop row_info, png_bytep row, #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED -/* If the bit depth is 8 and the colour type is not a palette type expand the +/* If the bit depth is 8 and the color type is not a palette type expand the * whole row to 16 bits. Has no effect otherwise. */ void /* PRIVATE */ @@ -4939,8 +4917,8 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row) png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1); png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3); png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5); - png_uint_32 red = (png_uint_32)((s0 + s1 + 65536L) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2 + s1 + 65536L) & 0xffffL); + png_uint_32 red = (s0 + s1 + 65536) & 0xffff; + png_uint_32 blue = (s2 + s1 + 65536) & 0xffff; *(rp ) = (png_byte)((red >> 8) & 0xff); *(rp + 1) = (png_byte)(red & 0xff); *(rp + 4) = (png_byte)((blue >> 8) & 0xff); diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngrutil.c b/Build/source/libs/libpng/libpng-1.5.5/pngrutil.c index 07e46e2feda..bfff7d6b868 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngrutil.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -87,10 +87,10 @@ png_int_32 (PNGAPI png_get_int_32)(png_const_bytep buf) { png_uint_32 uval = png_get_uint_32(buf); - if ((uval & 0x80000000L) == 0) /* non-negative */ + if ((uval & 0x80000000) == 0) /* non-negative */ return uval; - uval = (uval ^ 0xffffffffL) + 1; /* 2's complement: -x = ~x+1 */ + uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */ return -(png_int_32)uval; } @@ -458,7 +458,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, { /* Success (maybe) - really uncompress the chunk. */ png_size_t new_size = 0; - png_charp text = png_malloc_warn(png_ptr, + png_charp text = (png_charp)png_malloc_warn(png_ptr, prefix_size + expanded_size + 1); if (text != NULL) @@ -501,7 +501,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, * amount of compressed data. */ { - png_charp text = png_malloc_warn(png_ptr, prefix_size + 1); + png_charp text = (png_charp)png_malloc_warn(png_ptr, prefix_size + 1); if (text != NULL) { @@ -827,7 +827,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) # ifdef PNG_READ_sRGB_SUPPORTED if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) { - if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) + if (PNG_OUT_OF_RANGE(igamma, 45500, 500)) { PNG_WARNING_PARAMETERS(p) png_warning_parameter_signed(p, 1, PNG_NUMBER_FORMAT_fixed, igamma); @@ -994,10 +994,10 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { if (PNG_OUT_OF_RANGE(x_white, 31270, 1000) || PNG_OUT_OF_RANGE(y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(x_red, 64000L, 1000) || + PNG_OUT_OF_RANGE(x_red, 64000, 1000) || PNG_OUT_OF_RANGE(y_red, 33000, 1000) || PNG_OUT_OF_RANGE(x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(y_green, 60000L, 1000) || + PNG_OUT_OF_RANGE(y_green, 60000, 1000) || PNG_OUT_OF_RANGE(x_blue, 15000, 1000) || PNG_OUT_OF_RANGE(y_blue, 6000, 1000)) { @@ -1022,27 +1022,80 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Store the _white values as default coefficients for the rgb to gray - * operation if it is supported. + * operation if it is supported. Check if the transform is already set to + * avoid destroying the transform values. */ - if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == 0) + if (!png_ptr->rgb_to_gray_coefficients_set) { - /* png_set_background has not been called, the coefficients must be in - * range for the following to work without overflow. + /* png_set_background has not been called and we haven't seen an sRGB + * chunk yet. Find the XYZ of the three end points. */ - if (y_red <= (1<<17) && y_green <= (1<<17) && y_blue <= (1<<17)) + png_XYZ XYZ; + png_xy xy; + + xy.redx = x_red; + xy.redy = y_red; + xy.greenx = x_green; + xy.greeny = y_green; + xy.bluex = x_blue; + xy.bluey = y_blue; + xy.whitex = x_white; + xy.whitey = y_white; + + if (png_XYZ_from_xy_checked(png_ptr, &XYZ, xy)) { - /* The y values are chromaticities: Y/X+Y+Z, the weights for the gray - * transformation are simply the normalized Y values for red, green and - * blue scaled by 32768. + /* The success case, because XYZ_from_xy normalises to a reference + * white Y of 1.0 we just need to scale the numbers. This should + * always work just fine. It is an internal error if this overflows. */ - png_uint_32 w = y_red + y_green + y_blue; - - png_ptr->rgb_to_gray_red_coeff = (png_uint_16)(((png_uint_32)y_red * - 32768)/w); - png_ptr->rgb_to_gray_green_coeff = (png_uint_16)(((png_uint_32)y_green - * 32768)/w); - png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(((png_uint_32)y_blue * - 32768)/w); + { + png_fixed_point r, g, b; + if (png_muldiv(&r, XYZ.redY, 32768, PNG_FP_1) && + r >= 0 && r <= 32768 && + png_muldiv(&g, XYZ.greenY, 32768, PNG_FP_1) && + g >= 0 && g <= 32768 && + png_muldiv(&b, XYZ.blueY, 32768, PNG_FP_1) && + b >= 0 && b <= 32768 && + r+g+b <= 32769) + { + /* We allow 0 coefficients here. r+g+b may be 32769 if two or + * all of the coefficients were rounded up. Handle this by + * reducing the *largest* coefficient by 1; this matches the + * approach used for the default coefficients in pngrtran.c + */ + int add = 0; + + if (r+g+b > 32768) + add = -1; + else if (r+g+b < 32768) + add = 1; + + if (add != 0) + { + if (g >= r && g >= b) + g += add; + else if (r >= g && r >= b) + r += add; + else + b += add; + } + + /* Check for an internal error. */ + if (r+g+b != 32768) + png_error(png_ptr, + "internal error handling cHRM coefficients"); + + png_ptr->rgb_to_gray_red_coeff = (png_uint_16)r; + png_ptr->rgb_to_gray_green_coeff = (png_uint_16)g; + } + + /* This is a png_error at present even though it could be ignored - + * it should never happen, but it is important that if it does, the + * bug is fixed. + */ + else + png_error(png_ptr, "internal error handling cHRM->XYZ"); + } } } #endif @@ -1106,7 +1159,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) #if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)) { - if (PNG_OUT_OF_RANGE(info_ptr->gamma, 45500L, 500)) + if (PNG_OUT_OF_RANGE(info_ptr->gamma, 45500, 500)) { PNG_WARNING_PARAMETERS(p) @@ -1123,10 +1176,10 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) if (PNG_OUT_OF_RANGE(info_ptr->x_white, 31270, 1000) || PNG_OUT_OF_RANGE(info_ptr->y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(info_ptr->x_red, 64000L, 1000) || + PNG_OUT_OF_RANGE(info_ptr->x_red, 64000, 1000) || PNG_OUT_OF_RANGE(info_ptr->y_red, 33000, 1000) || PNG_OUT_OF_RANGE(info_ptr->x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->y_green, 60000L, 1000) || + PNG_OUT_OF_RANGE(info_ptr->y_green, 60000, 1000) || PNG_OUT_OF_RANGE(info_ptr->x_blue, 15000, 1000) || PNG_OUT_OF_RANGE(info_ptr->y_blue, 6000, 1000)) { @@ -1135,6 +1188,47 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) } #endif /* PNG_READ_cHRM_SUPPORTED */ + /* This is recorded for use when handling the cHRM chunk above. An sRGB + * chunk unconditionally overwrites the coefficients for grayscale conversion + * too. + */ + png_ptr->is_sRGB = 1; + +# ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED + /* Don't overwrite user supplied values: */ + if (!png_ptr->rgb_to_gray_coefficients_set) + { + /* These numbers come from the sRGB specification (or, since one has to + * pay much money to get a copy, the wikipedia sRGB page) the + * chromaticity values quoted have been inverted to get the reverse + * transformation from RGB to XYZ and the 'Y' coefficients scaled by + * 32768 (then rounded). + * + * sRGB and ITU Rec-709 both truncate the values for the D65 white + * point to four digits and, even though it actually stores five + * digits, the PNG spec gives the truncated value. + * + * This means that when the chromaticities are converted back to XYZ + * end points we end up with (6968,23435,2366), which, as described in + * pngrtran.c, would overflow. If the five digit precision and up is + * used we get, instead: + * + * 6968*R + 23435*G + 2365*B + * + * (Notice that this rounds the blue coefficient down, rather than the + * choice used in pngrtran.c which is to round the green one down.) + */ + png_ptr->rgb_to_gray_red_coeff = 6968; /* 0.212639005871510 */ + png_ptr->rgb_to_gray_green_coeff = 23434; /* 0.715168678767756 */ + /* png_ptr->rgb_to_gray_blue_coeff = 2366; 0.072192315360734 */ + + /* The following keeps the cHRM chunk from destroying the + * coefficients again in the event that it follows the sRGB chunk. + */ + png_ptr->rgb_to_gray_coefficients_set = 1; + } +# endif + png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent); } #endif /* PNG_READ_sRGB_SUPPORTED */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngset.c b/Build/source/libs/libpng/libpng-1.5.5/pngset.c index 7eaad7dd45d..7bae97c59e7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngset.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -64,6 +64,39 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, } } +void PNGFAPI +png_set_cHRM_XYZ_fixed(png_structp png_ptr, png_infop info_ptr, + png_fixed_point int_red_X, png_fixed_point int_red_Y, + png_fixed_point int_red_Z, png_fixed_point int_green_X, + png_fixed_point int_green_Y, png_fixed_point int_green_Z, + png_fixed_point int_blue_X, png_fixed_point int_blue_Y, + png_fixed_point int_blue_Z) +{ + png_XYZ XYZ; + png_xy xy; + + png_debug1(1, "in %s storage function", "cHRM XYZ fixed"); + + if (png_ptr == NULL || info_ptr == NULL) + return; + + XYZ.redX = int_red_X; + XYZ.redY = int_red_Y; + XYZ.redZ = int_red_Z; + XYZ.greenX = int_green_X; + XYZ.greenY = int_green_Y; + XYZ.greenZ = int_green_Z; + XYZ.blueX = int_blue_X; + XYZ.blueY = int_blue_Y; + XYZ.blueZ = int_blue_Z; + + if (png_xy_from_XYZ(&xy, XYZ)) + png_error(png_ptr, "XYZ values out of representable range"); + + png_set_cHRM_fixed(png_ptr, info_ptr, xy.whitex, xy.whitey, xy.redx, xy.redy, + xy.greenx, xy.greeny, xy.bluex, xy.bluey); +} + # ifdef PNG_FLOATING_POINT_SUPPORTED void PNGAPI png_set_cHRM(png_structp png_ptr, png_infop info_ptr, @@ -80,6 +113,23 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr, png_fixed(png_ptr, blue_x, "cHRM Blue X"), png_fixed(png_ptr, blue_y, "cHRM Blue Y")); } + +void PNGAPI +png_set_cHRM_XYZ(png_structp png_ptr, png_infop info_ptr, double red_X, + double red_Y, double red_Z, double green_X, double green_Y, double green_Z, + double blue_X, double blue_Y, double blue_Z) +{ + png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, + png_fixed(png_ptr, red_X, "cHRM Red X"), + png_fixed(png_ptr, red_Y, "cHRM Red Y"), + png_fixed(png_ptr, red_Z, "cHRM Red Z"), + png_fixed(png_ptr, green_X, "cHRM Red X"), + png_fixed(png_ptr, green_Y, "cHRM Red Y"), + png_fixed(png_ptr, green_Z, "cHRM Red Z"), + png_fixed(png_ptr, blue_X, "cHRM Red X"), + png_fixed(png_ptr, blue_Y, "cHRM Red Y"), + png_fixed(png_ptr, blue_Z, "cHRM Red Z")); +} # endif /* PNG_FLOATING_POINT_SUPPORTED */ #endif /* PNG_cHRM_SUPPORTED */ @@ -99,7 +149,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point * possible for 1/gamma to overflow the limit of 21474 and this means the * gamma value must be at least 5/100000 and hence at most 20000.0. For * safety the limits here are a little narrower. The values are 0.00016 to - * 6250.0, which are truely ridiculous gammma values (and will produce + * 6250.0, which are truly ridiculous gammma values (and will produce * displays that are all black or all white.) */ if (file_gamma < 16 || file_gamma > 625000000) @@ -552,10 +602,10 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, # ifdef PNG_cHRM_SUPPORTED png_set_cHRM_fixed(png_ptr, info_ptr, /* color x y */ - /* white */ 31270L, 32900L, - /* red */ 64000L, 33000L, - /* green */ 30000L, 60000L, - /* blue */ 15000L, 6000L + /* white */ 31270, 32900, + /* red */ 64000, 33000, + /* green */ 30000, 60000, + /* blue */ 15000, 6000 ); # endif /* cHRM */ } @@ -570,7 +620,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr, { png_charp new_iccp_name; png_bytep new_iccp_profile; - png_uint_32 length; + png_size_t length; png_debug1(1, "in %s storage function", "iCCP"); @@ -916,10 +966,10 @@ png_set_sPLT(png_structp png_ptr, { png_sPLT_tp to = np + info_ptr->splt_palettes_num + i; png_const_sPLT_tp from = entries + i; - png_uint_32 length; + png_size_t length; length = png_strlen(from->name) + 1; - to->name = (png_charp)png_malloc_warn(png_ptr, (png_size_t)length); + to->name = (png_charp)png_malloc_warn(png_ptr, length); if (to->name == NULL) { @@ -930,7 +980,7 @@ png_set_sPLT(png_structp png_ptr, png_memcpy(to->name, from->name, length); to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr, - (png_size_t)(from->nentries * png_sizeof(png_sPLT_entry))); + from->nentries * png_sizeof(png_sPLT_entry)); if (to->entries == NULL) { diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngstruct.h b/Build/source/libs/libpng/libpng-1.5.5/pngstruct.h index 93b2b3eb0f6..a9155b4277a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngstruct.h +++ b/Build/source/libs/libpng/libpng-1.5.5/pngstruct.h @@ -5,7 +5,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -255,13 +255,20 @@ struct png_struct_def png_bytep chunk_list; #endif +#ifdef PNG_READ_sRGB_SUPPORTED + /* Added in 1.5.5 to record an sRGB chunk in the png. */ + png_byte is_sRGB; +#endif + /* New members added in libpng-1.0.3 */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte rgb_to_gray_status; + /* Added in libpng 1.5.5 to record setting of coefficients: */ + png_byte rgb_to_gray_coefficients_set; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; - png_uint_16 rgb_to_gray_blue_coeff; + /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngtest.c b/Build/source/libs/libpng/libpng-1.5.5/pngtest.c index 9084ada624c..4bb24f3829b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngtest.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngtest.c @@ -1794,4 +1794,4 @@ main(int argc, char *argv[]) } /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_5_4 Your_png_h_is_not_version_1_5_4; +typedef png_libpng_version_1_5_5 Your_png_h_is_not_version_1_5_5; diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngtest.png b/Build/source/libs/libpng/libpng-1.5.5/pngtest.png Binary files differindex 81f5f8438a9..81f5f8438a9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngtest.png +++ b/Build/source/libs/libpng/libpng-1.5.5/pngtest.png diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngtrans.c b/Build/source/libs/libpng/libpng-1.5.5/pngtrans.c index 6a6908dcd26..6a6908dcd26 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngtrans.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngtrans.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngvalid.c b/Build/source/libs/libpng/libpng-1.5.5/pngvalid.c index 6d1736c1540..a3626b279b1 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngvalid.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngvalid.c @@ -1,7 +1,7 @@ /* pngvalid.c - validate libpng by constructing then reading png files. * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 2011 Glenn Randers-Pehrson * Written by John Cunningham Bowler * @@ -53,8 +53,9 @@ typedef png_byte *png_const_bytep; #define PNG_READ_16BIT_SUPPORTED /* This comes from pnglibconf.h afer 1.5: */ +#define PNG_FP_1 100000 #define PNG_GAMMA_THRESHOLD_FIXED\ - ((png_fixed_point)(PNG_GAMMA_THRESHOLD * 100000)) + ((png_fixed_point)(PNG_GAMMA_THRESHOLD * PNG_FP_1)) #endif #include "zlib.h" /* For crc32 */ @@ -77,6 +78,15 @@ typedef png_byte *png_const_bytep; /***************************** EXCEPTION HANDLING *****************************/ #include "contrib/visupng/cexcept.h" + +#ifdef __cplusplus +# define this not_the_cpp_this +# define new not_the_cpp_new +# define voidcast(type, value) static_cast<type>(value) +#else +# define voidcast(type, value) (value) +#endif /* __cplusplus */ + struct png_store; define_exception_type(struct png_store*); @@ -129,10 +139,18 @@ static PNG_CONST char sep[] = ": "; static PNG_CONST char *colour_types[8] = { - "greyscale", invalid, "truecolour", "indexed-colour", - "greyscale with alpha", invalid, "truecolour with alpha", invalid + "grayscale", invalid, "truecolour", "indexed-colour", + "grayscale with alpha", invalid, "truecolour with alpha", invalid }; +/* Convert a double precision value to fixed point. */ +static png_fixed_point +fix(double d) +{ + d = floor(d * PNG_FP_1 + .5); + return (png_fixed_point)d; +} + /* Generate random bytes. This uses a boring repeatable algorithm and it * is implemented here so that it gives the same set of numbers on every * architecture. It's a linear congruential generator (Knuth or Sedgewick @@ -143,7 +161,7 @@ static void make_random_bytes(png_uint_32* seed, void* pv, size_t size) { png_uint_32 u0 = seed[0], u1 = seed[1]; - png_bytep bytes = /*no cast required*/pv; + png_bytep bytes = voidcast(png_bytep, pv); /* There are thirty three bits, the next bit in the sequence is bit-33 XOR * bit-20. The top 1 bit is in u1, the bottom 32 are in u0. @@ -179,6 +197,26 @@ randomize(void *pv, size_t size) #define RANDOMIZE(this) randomize(&(this), sizeof (this)) +static unsigned int +random_mod(unsigned int max) +{ + unsigned int x; + + RANDOMIZE(x); + + return x % max; /* 0 .. max-1 */ +} + +static int +random_choice(void) +{ + unsigned char x; + + RANDOMIZE(x); + + return x & 1; +} + /* A numeric ID based on PNG file characteristics. The 'do_interlace' field * simply records whether pngvalid did the interlace itself or whether it * was done by libpng. Width and height must be less than 256. 'palette' is an @@ -631,7 +669,7 @@ store_storenew(png_store *ps) if (ps->writepos != STORE_BUFFER_SIZE) png_error(ps->pwrite, "invalid store call"); - pb = malloc(sizeof *pb); + pb = voidcast(png_store_buffer*, malloc(sizeof *pb)); if (pb == NULL) png_error(ps->pwrite, "store new: OOM"); @@ -667,7 +705,7 @@ store_freefile(png_store_file **ppf) static void store_storefile(png_store *ps, png_uint_32 id) { - png_store_file *pf = malloc(sizeof *pf); + png_store_file *pf = voidcast(png_store_file*, malloc(sizeof *pf)); if (pf == NULL) png_error(ps->pwrite, "storefile: OOM"); safecat(pf->name, sizeof pf->name, 0, ps->wname); @@ -761,7 +799,7 @@ store_log(png_store* ps, png_structp pp, png_const_charp message, int is_error) static void store_error(png_structp pp, png_const_charp message) /* PNG_NORETURN */ { - png_store *ps = png_get_error_ptr(pp); + png_store *ps = voidcast(png_store*, png_get_error_ptr(pp)); if (!ps->expect_error) store_log(ps, pp, message, 1 /* error */); @@ -776,7 +814,7 @@ store_error(png_structp pp, png_const_charp message) /* PNG_NORETURN */ static void store_warning(png_structp pp, png_const_charp message) { - png_store *ps = png_get_error_ptr(pp); + png_store *ps = voidcast(png_store*, png_get_error_ptr(pp)); if (!ps->expect_warning) store_log(ps, pp, message, 0 /* warning */); @@ -838,7 +876,7 @@ store_ensure_image(png_store *ps, png_structp pp, int nImages, png_size_t cbRow, store_image_free(ps, pp); /* The buffer is deliberately mis-aligned. */ - image = malloc(cb+2); + image = voidcast(png_bytep, malloc(cb+2)); if (image == NULL) { /* Called from the startup - ignore the error for the moment. */ @@ -922,7 +960,7 @@ store_image_check(PNG_CONST png_store* ps, png_structp pp, int iImage) static void store_write(png_structp pp, png_bytep pb, png_size_t st) { - png_store *ps = png_get_io_ptr(pp); + png_store *ps = voidcast(png_store*, png_get_io_ptr(pp)); if (ps->pwrite != pp) png_error(pp, "store state damaged"); @@ -1042,7 +1080,7 @@ store_read_imp(png_store *ps, png_bytep pb, png_size_t st) static void store_read(png_structp pp, png_bytep pb, png_size_t st) { - png_store *ps = png_get_io_ptr(pp); + png_store *ps = voidcast(png_store*, png_get_io_ptr(pp)); if (ps == NULL || ps->pread != pp) png_error(pp, "bad store read call"); @@ -1082,7 +1120,8 @@ store_write_palette(png_store *ps, int npalette) /* This function can only return NULL if called with '0'! */ if (npalette > 0) { - ps->palette = malloc(npalette * sizeof *ps->palette); + ps->palette = voidcast(store_palette_entry*, malloc(npalette * + sizeof *ps->palette)); if (ps->palette == NULL) png_error(ps->pwrite, "store new palette: OOM"); @@ -1229,8 +1268,9 @@ store_pool_delete(png_store *ps, store_pool *pool) static png_voidp store_malloc(png_structp pp, png_alloc_size_t cb) { - store_pool *pool = png_get_mem_ptr(pp); - store_memory *new = malloc(cb + (sizeof *new) + (sizeof pool->mark)); + store_pool *pool = voidcast(store_pool*, png_get_mem_ptr(pp)); + store_memory *new = voidcast(store_memory*, malloc(cb + (sizeof *new) + + (sizeof pool->mark))); if (new != NULL) { @@ -1262,8 +1302,8 @@ store_malloc(png_structp pp, png_alloc_size_t cb) static void store_free(png_structp pp, png_voidp memory) { - store_pool *pool = png_get_mem_ptr(pp); - store_memory *this = memory, **test; + store_pool *pool = voidcast(store_pool*, png_get_mem_ptr(pp)); + store_memory *this = voidcast(store_memory*, memory), **test; /* First check that this 'memory' really is valid memory - it must be in the * pool list. If it is, use the shared memory_free function to free it. @@ -1483,17 +1523,125 @@ store_delete(png_store *ps) * png_store. There is a special read function, set_modifier_for_read, which * replaces set_store_for_read. */ +typedef enum modifier_state +{ + modifier_start, /* Initial value */ + modifier_signature, /* Have a signature */ + modifier_IHDR /* Have an IHDR */ +} modifier_state; + +typedef struct CIE_color +{ + /* A single CIE tristimulus value, representing the unique response of a + * standard observer to a variety of light spectra. The observer recognizes + * all spectra that produce this response as the same color, therefore this + * is effectively a description of a color. + */ + double X, Y, Z; +} CIE_color; + +static double +chromaticity_x(CIE_color c) +{ + return c.X / (c.X + c.Y + c.Z); +} + +static double +chromaticity_y(CIE_color c) +{ + return c.Y / (c.X + c.Y + c.Z); +} + +typedef struct color_encoding +{ + /* A description of an (R,G,B) encoding of color (as defined above); this + * includes the actual colors of the (R,G,B) triples (1,0,0), (0,1,0) and + * (0,0,1) plus an encoding value that is used to encode the linear + * components R, G and B to give the actual values R^gamma, G^gamma and + * B^gamma that are stored. + */ + double gamma; /* Encoding (file) gamma of space */ + CIE_color red, green, blue; /* End points */ +} color_encoding; + +static CIE_color +white_point(PNG_CONST color_encoding *encoding) +{ + CIE_color white; + + white.X = encoding->red.X + encoding->green.X + encoding->blue.X; + white.Y = encoding->red.Y + encoding->green.Y + encoding->blue.Y; + white.Z = encoding->red.Z + encoding->green.Z + encoding->blue.Z; + + return white; +} + +static void +normalize_color_encoding(color_encoding *encoding) +{ + PNG_CONST double whiteY = encoding->red.Y + encoding->green.Y + + encoding->blue.Y; + + if (whiteY != 1) + { + encoding->red.X /= whiteY; + encoding->red.Y /= whiteY; + encoding->red.Z /= whiteY; + encoding->green.X /= whiteY; + encoding->green.Y /= whiteY; + encoding->green.Z /= whiteY; + encoding->blue.X /= whiteY; + encoding->blue.Y /= whiteY; + encoding->blue.Z /= whiteY; + } +} + +static size_t +safecat_color_encoding(char *buffer, size_t bufsize, size_t pos, + PNG_CONST color_encoding *e, double encoding_gamma) +{ + if (e != 0) + { + if (encoding_gamma != 0) + pos = safecat(buffer, bufsize, pos, "("); + pos = safecat(buffer, bufsize, pos, "R("); + pos = safecatd(buffer, bufsize, pos, e->red.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->red.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->red.Z, 4); + pos = safecat(buffer, bufsize, pos, "),G("); + pos = safecatd(buffer, bufsize, pos, e->green.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->green.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->green.Z, 4); + pos = safecat(buffer, bufsize, pos, "),B("); + pos = safecatd(buffer, bufsize, pos, e->blue.X, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->blue.Y, 4); + pos = safecat(buffer, bufsize, pos, ","); + pos = safecatd(buffer, bufsize, pos, e->blue.Z, 4); + pos = safecat(buffer, bufsize, pos, ")"); + if (encoding_gamma != 0) + pos = safecat(buffer, bufsize, pos, ")"); + } + + if (encoding_gamma != 0) + { + pos = safecat(buffer, bufsize, pos, "^"); + pos = safecatd(buffer, bufsize, pos, encoding_gamma, 5); + } + + return pos; +} + typedef struct png_modifier { png_store this; /* I am a png_store */ struct png_modification *modifications; /* Changes to make */ - enum modifier_state - { - modifier_start, /* Initial value */ - modifier_signature, /* Have a signature */ - modifier_IHDR /* Have an IHDR */ - } state; /* My state */ + modifier_state state; /* My state */ /* Information from IHDR: */ png_byte bit_depth; /* From IHDR */ @@ -1506,8 +1654,22 @@ typedef struct png_modifier png_uint_32 pending_chunk; /* Test values */ - double *gammas; - unsigned int ngammas; + double *gammas; + unsigned int ngammas; + unsigned int ngamma_tests; /* Number of gamma tests to run*/ + double current_gamma; /* 0 if not set */ + PNG_CONST color_encoding *encodings; + unsigned int nencodings; + PNG_CONST color_encoding *current_encoding; /* If an encoding has been set */ + unsigned int encoding_counter; /* For iteration */ + int encoding_ignored; /* Something overwrote it */ + + /* Control variables used to iterate through possible encodings, the + * following must be set to 0 and tested by the function that uses the + * png_modifier because the modifier only sets it to 1 (true.) + */ + unsigned int repeat :1; /* Repeat this transform test. */ + unsigned int test_uses_encoding :1; /* Lowest sbit to test (libpng fails for sbit < 8) */ png_byte sbitlow; @@ -1524,6 +1686,13 @@ typedef struct png_modifier double maxcalc16;/* Absolute sample error 0..1 */ double maxpc16; /* Percentage sample error 0..100% */ + /* This is set by transforms that need to allow a higher limit, it is an + * internal check on pngvalid to ensure that the calculated error limits are + * not ridiculous; without this it is too easy to make a mistake in pngvalid + * that allows any value through. + */ + double limit; /* limit on error values, normally 4E-3 */ + /* Log limits - values above this are logged, but not necessarily * warned. */ @@ -1575,6 +1744,7 @@ typedef struct png_modifier unsigned int test_gamma_background :1; unsigned int test_gamma_alpha_mode :1; unsigned int test_gamma_expand16 :1; + unsigned int test_exhaustive :1; unsigned int log :1; /* Log max error */ @@ -1605,9 +1775,19 @@ modifier_init(png_modifier *pm) pm->state = modifier_start; pm->sbitlow = 1U; pm->ngammas = 0; + pm->ngamma_tests = 0; pm->gammas = 0; + pm->current_gamma = 0; + pm->encodings = 0; + pm->nencodings = 0; + pm->current_encoding = 0; + pm->encoding_counter = 0; + pm->encoding_ignored = 0; + pm->repeat = 0; + pm->test_uses_encoding = 0; pm->maxout8 = pm->maxpc8 = pm->maxabs8 = pm->maxcalc8 = 0; pm->maxout16 = pm->maxpc16 = pm->maxabs16 = pm->maxcalc16 = 0; + pm->limit = 4E-3; pm->log8 = pm->log16 = 0; /* Means 'off' */ pm->error_gray_2 = pm->error_gray_4 = pm->error_gray_8 = 0; pm->error_gray_16 = pm->error_color_8 = pm->error_color_16 = 0; @@ -1627,6 +1807,7 @@ modifier_init(png_modifier *pm) pm->test_gamma_background = 0; pm->test_gamma_alpha_mode = 0; pm->test_gamma_expand16 = 0; + pm->test_exhaustive = 0; pm->log = 0; /* Rely on the memset for all the other fields - there are no pointers */ @@ -1638,9 +1819,35 @@ modifier_init(png_modifier *pm) * * If pm->assume_16_bit_calculations is set then even 8 bit calculations use 16 * bit precision. This only affects those of the following limits that pertain - * to a calculation - not a digitization operation! + * to a calculation - not a digitization operation - unless the following API is + * called directly. */ -static double abserr(png_modifier *pm, int in_depth, int out_depth) +static double digitize(PNG_CONST png_modifier *pm, double value, + int sample_depth, int do_round) +{ + /* 'value' is in the range 0 to 1, the result is the same value rounded to a + * multiple of the digitization factor - 8 or 16 bits depending on both the + * sample depth and the 'assume' setting. Digitization is normally by + * rounding and 'do_round' should be 1, if it is 0 the digitized value will + * be truncated. + */ + PNG_CONST unsigned int digitization_factor = + (pm->assume_16_bit_calculations || sample_depth == 16) ? 65535 : 255; + + /* Limiting the range is done as a convenience to the caller - it's easier to + * do it once here than every time at the call site. + */ + if (value <= 0) + value = 0; + else if (value >= 1) + value = 1; + + value *= digitization_factor; + if (do_round) value += .5; + return floor(value)/digitization_factor; +} + +static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* Absolute error permitted in linear values - affected by the bit depth of * the calculations. @@ -1652,7 +1859,7 @@ static double abserr(png_modifier *pm, int in_depth, int out_depth) return pm->maxabs8; } -static double calcerr(png_modifier *pm, int in_depth, int out_depth) +static double calcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* Error in the linear composition arithmetic - only relevant when * composition actually happens (0 < alpha < 1). @@ -1664,7 +1871,7 @@ static double calcerr(png_modifier *pm, int in_depth, int out_depth) return pm->maxcalc8; } -static double pcerr(png_modifier *pm, int in_depth, int out_depth) +static double pcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* Percentage error permitted in the linear values. Note that the specified * value is a percentage but this routine returns a simple number. @@ -1687,11 +1894,11 @@ static double pcerr(png_modifier *pm, int in_depth, int out_depth) * The specified parameter does *not* include the base .5 digitization error but * it is added here. */ -static double outerr(png_modifier *pm, int in_depth, int out_depth) +static double outerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* There is a serious error in the 2 and 4 bit grayscale transform because * the gamma table value (8 bits) is simply shifted, not rounded, so the - * error in 4 bit greyscale gamma is up to the value below. This is a hack + * error in 4 bit grayscale gamma is up to the value below. This is a hack * to allow pngvalid to succeed: * * TODO: fix this in libpng @@ -1720,7 +1927,7 @@ static double outerr(png_modifier *pm, int in_depth, int out_depth) * rather than raising a warning. This is useful for debugging to track down * exactly what set of parameters cause high error values. */ -static double outlog(png_modifier *pm, int in_depth, int out_depth) +static double outlog(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* The command line parameters are either 8 bit (0..255) or 16 bit (0..65535) * and so must be adjusted for low bit depth grayscale: @@ -1759,7 +1966,7 @@ static double outlog(png_modifier *pm, int in_depth, int out_depth) * but in the 8 bit calculation case it's actually quantization to a multiple of * 257! */ -static int output_quantization_factor(png_modifier *pm, int in_depth, +static int output_quantization_factor(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { if (out_depth == 16 && in_depth != 16 @@ -1797,7 +2004,8 @@ typedef struct png_modification unsigned int removed :1; /* Chunk was removed */ } png_modification; -static void modification_reset(png_modification *pmm) +static void +modification_reset(png_modification *pmm) { if (pmm != NULL) { @@ -1820,14 +2028,174 @@ modification_init(png_modification *pmm) } static void +modifier_current_encoding(PNG_CONST png_modifier *pm, color_encoding *ce) +{ + if (pm->current_encoding != 0) + *ce = *pm->current_encoding; + + else + memset(ce, 0, sizeof *ce); + + ce->gamma = pm->current_gamma; +} + +static size_t +safecat_current_encoding(char *buffer, size_t bufsize, size_t pos, + PNG_CONST png_modifier *pm) +{ + pos = safecat_color_encoding(buffer, bufsize, pos, pm->current_encoding, + pm->current_gamma); + + if (pm->encoding_ignored) + pos = safecat(buffer, bufsize, pos, "[overridden]"); + + return pos; +} + +/* Iterate through the usefully testable color encodings. An encoding is one + * of: + * + * 1) Nothing (no color space, no gamma). + * 2) Just a gamma value from the gamma array (including 1.0) + * 3) A color space from the encodings array with the corresponding gamma. + * 4) The same, but with gamma 1.0 (only really useful with 16 bit calculations) + * + * The iterator selects these in turn, the randomizer selects one at random, + * which is used depends on the setting of the 'test_exhaustive' flag. Notice + * that this function changes the colour space encoding so it must only be + * called on completion of the previous test. This is what 'modifier_reset' + * does, below. + * + * After the function has been called the 'repeat' flag will still be set; the + * caller of modifier_reset must reset it at the start of each run of the test! + */ +static unsigned int +modifier_total_encodings(PNG_CONST png_modifier *pm) +{ + return 1 + /* (1) nothing */ + pm->ngammas + /* (2) gamma values to test */ + pm->nencodings + /* (3) total number of encodings */ + /* The following test only works after the first time through the + * png_modifier code because 'bit_depth' is set when the IHDR is read. + * modifier_reset, below, preserves the setting until after it has called + * the iterate function (also below.) + * + * For this reason do not rely on this function outside a call to + * modifier_reset. + */ + ((pm->bit_depth == 16 || pm->assume_16_bit_calculations) ? + pm->nencodings : 0); /* (4) encodings with gamma == 1.0 */ +} + +static void +modifier_encoding_iterate(png_modifier *pm) +{ + if (!pm->repeat && /* Else something needs the current encoding again. */ + pm->test_uses_encoding) /* Some transform is encoding dependent */ + { + if (pm->test_exhaustive) + { + if (++pm->encoding_counter >= modifier_total_encodings(pm)) + pm->encoding_counter = 0; /* This will stop the repeat */ + } + + else + { + /* Not exhaustive - choose an encoding at random; generate a number in + * the range 1..(max-1), so the result is always non-zero: + */ + if (pm->encoding_counter == 0) + pm->encoding_counter = random_mod(modifier_total_encodings(pm)-1)+1; + else + pm->encoding_counter = 0; + } + + if (pm->encoding_counter > 0) + pm->repeat = 1; + } + + else if (!pm->repeat) + pm->encoding_counter = 0; +} + +static void modifier_reset(png_modifier *pm) { store_read_reset(&pm->this); + pm->limit = 4E-3; + pm->pending_len = pm->pending_chunk = 0; + pm->flush = pm->buffer_count = pm->buffer_position = 0; pm->modifications = NULL; pm->state = modifier_start; + modifier_encoding_iterate(pm); + /* The following must be set in the next run. In particular + * test_uses_encodings must be set in the _ini function of each transform + * that looks at the encodings. (Not the 'add' function!) + */ + pm->test_uses_encoding = 0; + pm->current_gamma = 0; + pm->current_encoding = 0; + pm->encoding_ignored = 0; + /* These only become value after IHDR is read: */ pm->bit_depth = pm->colour_type = 0; - pm->pending_len = pm->pending_chunk = 0; - pm->flush = pm->buffer_count = pm->buffer_position = 0; +} + +/* The following must be called before anything else to get the encoding set up + * on the modifier. In particular it must be called before the transform init + * functions are called. + */ +static void +modifier_set_encoding(png_modifier *pm) +{ + /* Set the encoding to the one specified by the current encoding counter, + * first clear out all the settings - this corresponds to an encoding_counter + * of 0. + */ + pm->current_gamma = 0; + pm->current_encoding = 0; + pm->encoding_ignored = 0; /* not ignored yet - happens in _ini functions. */ + + /* Now, if required, set the gamma and encoding fields. */ + if (pm->encoding_counter > 0) + { + /* The gammas[] array is an array of screen gammas, not encoding gammas, + * so we need the inverse: + */ + if (pm->encoding_counter <= pm->ngammas) + pm->current_gamma = 1/pm->gammas[pm->encoding_counter-1]; + + else + { + unsigned int i = pm->encoding_counter - pm->ngammas; + + if (i >= pm->nencodings) + { + i %= pm->nencodings; + pm->current_gamma = 1; /* Linear, only in the 16 bit case */ + } + + else + pm->current_gamma = pm->encodings[i].gamma; + + pm->current_encoding = pm->encodings + i; + } + } +} + +/* Enquiry functions to find out what is set. Notice that there is an implicit + * assumption below that the first encoding in the list is the one for sRGB. + */ +static int +modifier_color_encoding_is_sRGB(PNG_CONST png_modifier *pm) +{ + return pm->current_encoding != 0 && pm->current_encoding == pm->encodings && + pm->current_encoding->gamma == pm->current_gamma; +} + +static int +modifier_color_encoding_is_set(PNG_CONST png_modifier *pm) +{ + return pm->current_gamma != 0; } /* Convenience macros. */ @@ -1849,7 +2217,10 @@ modifier_crc(png_bytep buffer) * the buffer, at the start. */ uInt datalen = png_get_uint_32(buffer); - png_save_uint_32(buffer+datalen+8, crc32(0L, buffer+4, datalen+4)); + uLong crc = crc32(0, buffer+4, datalen+4); + /* The cast to png_uint_32 is safe because a crc32 is always a 32 bit value. + */ + png_save_uint_32(buffer+datalen+8, (png_uint_32)crc); } static void @@ -2072,7 +2443,7 @@ modifier_read_imp(png_modifier *pm, png_bytep pb, png_size_t st) static void modifier_read(png_structp pp, png_bytep pb, png_size_t st) { - png_modifier *pm = png_get_io_ptr(pp); + png_modifier *pm = voidcast(png_modifier*, png_get_io_ptr(pp)); if (pm == NULL || pm->this.pread != pp) png_error(pp, "bad modifier_read call"); @@ -2091,7 +2462,7 @@ modifier_progressive_read(png_modifier *pm, png_structp pp, png_infop pi) png_error(pp, "store state damaged (progressive)"); /* This is another Horowitz and Hill random noise generator. In this case - * the aim is to stress the progressive reader with truely horrible variable + * the aim is to stress the progressive reader with truly horrible variable * buffer sizes in the range 1..500, so a sequence of 9 bit random numbers * is generated. We could probably just count from 1 to 32767 and get as * good a result. @@ -2158,6 +2529,205 @@ set_modifier_for_read(png_modifier *pm, png_infopp ppi, png_uint_32 id, return set_store_for_read(&pm->this, ppi, id, name); } + + +/******************************** MODIFICATIONS *******************************/ +/* Standard modifications to add chunks. These do not require the _SUPPORTED + * macros because the chunks can be there regardless of whether this specific + * libpng supports them. + */ +typedef struct gama_modification +{ + png_modification this; + png_fixed_point gamma; +} gama_modification; + +static int +gama_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* This simply dumps the given gamma value into the buffer. */ + png_save_uint_32(pm->buffer, 4); + png_save_uint_32(pm->buffer+4, CHUNK_gAMA); + png_save_uint_32(pm->buffer+8, ((gama_modification*)me)->gamma); + return 1; +} + +static void +gama_modification_init(gama_modification *me, png_modifier *pm, double gammad) +{ + double g; + + modification_init(&me->this); + me->this.chunk = CHUNK_gAMA; + me->this.modify_fn = gama_modify; + me->this.add = CHUNK_PLTE; + g = fix(gammad); + me->gamma = (png_fixed_point)g; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +typedef struct chrm_modification +{ + png_modification this; + PNG_CONST color_encoding *encoding; + png_fixed_point wx, wy, rx, ry, gx, gy, bx, by; +} chrm_modification; + +static int +chrm_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* As with gAMA this just adds the required cHRM chunk to the buffer. */ + png_save_uint_32(pm->buffer , 32); + png_save_uint_32(pm->buffer+ 4, CHUNK_cHRM); + png_save_uint_32(pm->buffer+ 8, ((chrm_modification*)me)->wx); + png_save_uint_32(pm->buffer+12, ((chrm_modification*)me)->wy); + png_save_uint_32(pm->buffer+16, ((chrm_modification*)me)->rx); + png_save_uint_32(pm->buffer+20, ((chrm_modification*)me)->ry); + png_save_uint_32(pm->buffer+24, ((chrm_modification*)me)->gx); + png_save_uint_32(pm->buffer+28, ((chrm_modification*)me)->gy); + png_save_uint_32(pm->buffer+32, ((chrm_modification*)me)->bx); + png_save_uint_32(pm->buffer+36, ((chrm_modification*)me)->by); + return 1; +} + +static void +chrm_modification_init(chrm_modification *me, png_modifier *pm, + PNG_CONST color_encoding *encoding) +{ + CIE_color white = white_point(encoding); + + /* Original end points: */ + me->encoding = encoding; + + /* Chromaticities (in fixed point): */ + me->wx = fix(chromaticity_x(white)); + me->wy = fix(chromaticity_y(white)); + + me->rx = fix(chromaticity_x(encoding->red)); + me->ry = fix(chromaticity_y(encoding->red)); + me->gx = fix(chromaticity_x(encoding->green)); + me->gy = fix(chromaticity_y(encoding->green)); + me->bx = fix(chromaticity_x(encoding->blue)); + me->by = fix(chromaticity_y(encoding->blue)); + + modification_init(&me->this); + me->this.chunk = CHUNK_cHRM; + me->this.modify_fn = chrm_modify; + me->this.add = CHUNK_PLTE; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +typedef struct srgb_modification +{ + png_modification this; + png_byte intent; +} srgb_modification; + +static int +srgb_modify(png_modifier *pm, png_modification *me, int add) +{ + UNUSED(add) + /* As above, ignore add and just make a new chunk */ + png_save_uint_32(pm->buffer, 1); + png_save_uint_32(pm->buffer+4, CHUNK_sRGB); + pm->buffer[8] = ((srgb_modification*)me)->intent; + return 1; +} + +static void +srgb_modification_init(srgb_modification *me, png_modifier *pm, png_byte intent) +{ + modification_init(&me->this); + me->this.chunk = CHUNK_sBIT; + + if (intent <= 3) /* if valid, else *delete* sRGB chunks */ + { + me->this.modify_fn = srgb_modify; + me->this.add = CHUNK_PLTE; + me->intent = intent; + } + + else + { + me->this.modify_fn = 0; + me->this.add = 0; + me->intent = 0; + } + + me->this.next = pm->modifications; + pm->modifications = &me->this; +} + +typedef struct sbit_modification +{ + png_modification this; + png_byte sbit; +} sbit_modification; + +static int +sbit_modify(png_modifier *pm, png_modification *me, int add) +{ + png_byte sbit = ((sbit_modification*)me)->sbit; + if (pm->bit_depth > sbit) + { + int cb = 0; + switch (pm->colour_type) + { + case 0: + cb = 1; + break; + + case 2: + case 3: + cb = 3; + break; + + case 4: + cb = 2; + break; + + case 6: + cb = 4; + break; + + default: + png_error(pm->this.pread, + "unexpected colour type in sBIT modification"); + } + + png_save_uint_32(pm->buffer, cb); + png_save_uint_32(pm->buffer+4, CHUNK_sBIT); + + while (cb > 0) + (pm->buffer+8)[--cb] = sbit; + + return 1; + } + else if (!add) + { + /* Remove the sBIT chunk */ + pm->buffer_count = pm->buffer_position = 0; + return 1; + } + else + return 0; /* do nothing */ +} + +static void +sbit_modification_init(sbit_modification *me, png_modifier *pm, png_byte sbit) +{ + modification_init(&me->this); + me->this.chunk = CHUNK_sBIT; + me->this.modify_fn = sbit_modify; + me->this.add = CHUNK_PLTE; + me->sbit = sbit; + me->this.next = pm->modifications; + pm->modifications = &me->this; +} #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ /***************************** STANDARD PNG FILES *****************************/ @@ -2224,7 +2794,7 @@ make_standard_palette(png_store* ps, int npalette, int do_tRNS) values[i][3] = (i&4) ? 255 : 0; } - /* Then add 62 greys (one quarter of the remaining 256 slots). */ + /* Then add 62 grays (one quarter of the remaining 256 slots). */ { int j = 0; png_byte random_bytes[4]; @@ -2255,7 +2825,7 @@ make_standard_palette(png_store* ps, int npalette, int do_tRNS) } /* Finally add 192 colors at random - don't worry about matches to things we - * already have, chance is less than 1/65536. Don't worry about greys, + * already have, chance is less than 1/65536. Don't worry about grays, * chance is the same, so we get a duplicate or extra gray less than 1 time * in 170. */ @@ -3323,6 +3893,8 @@ static void standard_display_init(standard_display *dp, png_store* ps, png_uint_32 id, int do_interlace) { + memset(dp, 0, sizeof *dp); + dp->ps = ps; dp->colour_type = COL_FROM_ID(id); dp->bit_depth = DEPTH_FROM_ID(id); @@ -3429,8 +4001,8 @@ read_palette(store_palette palette, int *npalette, png_structp pp, png_infop pi) if ((png_get_tRNS(pp, pi, &trans_alpha, &num, 0) & PNG_INFO_tRNS) != 0 && (trans_alpha != NULL || num != 1/*returns 1 for a transparent color*/) && /* Oops, if a palette tRNS gets expanded png_read_update_info (at least so - * far as 1.5.4) does not zap the trans_alpha pointer, only num_trans, so - * in the above call we get a success, we get a pointer (who knows what + * far as 1.5.4) does not remove the trans_alpha pointer, only num_trans, + * so in the above call we get a success, we get a pointer (who knows what * to) and we get num_trans == 0: */ !(trans_alpha != NULL && num == 0)) /* TODO: fix this in libpng. */ @@ -3711,7 +4283,8 @@ standard_info_imp(standard_display *dp, png_structp pp, png_infop pi, static void standard_info(png_structp pp, png_infop pi) { - standard_display *dp = png_get_progressive_ptr(pp); + standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); /* Call with nImages==1 because the progressive reader can only produce one * image. @@ -3722,7 +4295,8 @@ standard_info(png_structp pp, png_infop pi) static void progressive_row(png_structp pp, png_bytep new_row, png_uint_32 y, int pass) { - PNG_CONST standard_display *dp = png_get_progressive_ptr(pp); + PNG_CONST standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); /* When handling interlacing some rows will be absent in each pass, the * callback still gets called, but with a NULL pointer. This is checked @@ -3897,7 +4471,8 @@ standard_image_validate(standard_display *dp, png_structp pp, int iImage, static void standard_end(png_structp pp, png_infop pi) { - standard_display *dp = png_get_progressive_ptr(pp); + standard_display *dp = voidcast(standard_display*, + png_get_progressive_ptr(pp)); UNUSED(pi) @@ -4119,7 +4694,7 @@ perform_size_test(png_modifier *pm) return; /* For the moment don't do the palette test - it's a waste of time when - * compared to the greyscale test. + * compared to the grayscale test. */ #if 0 if (!test_size(pm, 3, 0, 3)) @@ -4290,7 +4865,7 @@ image_pixel_convert_PLTE(image_pixel *this) * least 8. Palette images will be converted to alpha (using the above API). */ static void -image_pixel_add_alpha(image_pixel *this, const standard_display *display) +image_pixel_add_alpha(image_pixel *this, PNG_CONST standard_display *display) { if (this->colour_type == PNG_COLOR_TYPE_PALETTE) image_pixel_convert_PLTE(this); @@ -4376,7 +4951,13 @@ typedef struct image_transform /* A single transform for the image, expressed as a series of function * callbacks and some space for values. * - * First a callback to set the transform on the current png_read_struct: + * First a callback to add any required modifications to the png_modifier; + * this gets called just before the modifier is set up for read. + */ + void (*ini)(PNG_CONST struct image_transform *this, + struct transform_display *that); + + /* And a callback to set the transform on the current png_read_struct: */ void (*set)(PNG_CONST struct image_transform *this, struct transform_display *that, png_structp pp, png_infop pi); @@ -4412,12 +4993,48 @@ typedef struct transform_display png_byte output_colour_type; png_byte output_bit_depth; - /* Variables for the individual transforms. */ - /* png_set_background */ - image_pixel background_colour; + /* Modifications (not necessarily used.) */ + gama_modification gama_mod; + chrm_modification chrm_mod; + srgb_modification srgb_mod; } transform_display; -/* Two functions to end the list: */ +/* Set sRGB, cHRM and gAMA transforms as required by the current encoding. */ +static void +transform_set_encoding(transform_display *this) +{ + /* Set up the png_modifier '_current' fields then use these to determine how + * to add appropriate chunks. + */ + png_modifier *pm = this->pm; + + modifier_set_encoding(pm); + + if (modifier_color_encoding_is_set(pm)) + { + if (modifier_color_encoding_is_sRGB(pm)) + srgb_modification_init(&this->srgb_mod, pm, PNG_sRGB_INTENT_ABSOLUTE); + + else + { + /* Set gAMA and cHRM separately. */ + gama_modification_init(&this->gama_mod, pm, pm->current_gamma); + + if (pm->current_encoding != 0) + chrm_modification_init(&this->chrm_mod, pm, pm->current_encoding); + } + } +} + +/* Three functions to end the list: */ +static void +image_transform_ini_end(PNG_CONST image_transform *this, + transform_display *that) +{ + UNUSED(this) + UNUSED(that) +} + static void image_transform_set_end(PNG_CONST image_transform *this, transform_display *that, png_structp pp, png_infop pi) @@ -4513,6 +5130,7 @@ static image_transform image_transform_end = 0, /* global_use */ 0, /* local_use */ 0, /* next */ + image_transform_ini_end, image_transform_set_end, image_transform_mod_end, 0 /* never called, I want it to crash if it is! */ @@ -4525,6 +5143,8 @@ static void transform_display_init(transform_display *dp, png_modifier *pm, png_uint_32 id, PNG_CONST image_transform *transform_list) { + memset(dp, 0, sizeof dp); + /* Standard fields */ standard_display_init(&dp->this, &pm->this, id, 0/*do_interlace*/); @@ -4657,25 +5277,26 @@ transform_info_imp(transform_display *dp, png_structp pp, png_infop pi) static void transform_info(png_structp pp, png_infop pi) { - transform_info_imp(png_get_progressive_ptr(pp), pp, pi); + transform_info_imp(voidcast(transform_display*, png_get_progressive_ptr(pp)), + pp, pi); } static void transform_range_check(png_structp pp, unsigned int r, unsigned int g, unsigned int b, unsigned int a, unsigned int in_digitized, double in, - unsigned int out, png_byte sample_depth, double err, PNG_CONST char *name, - double digitization_error) + unsigned int out, png_byte sample_depth, double err, double limit, + PNG_CONST char *name, double digitization_error) { /* Compare the scaled, digitzed, values of our local calculation (in+-err) * with the digitized values libpng produced; 'sample_depth' is the actual * digitization depth of the libpng output colors (the bit depth except for * palette images where it is always 8.) The check on 'err' is to detect - * internal errors in pngvalid itself (the threshold is about 1/255.) + * internal errors in pngvalid itself. */ unsigned int max = (1U<<sample_depth)-1; double in_min = ceil((in-err)*max - digitization_error); double in_max = floor((in+err)*max + digitization_error); - if (err > 4E-3 || !(out >= in_min && out <= in_max)) + if (err > limit || !(out >= in_min && out <= in_max)) { char message[256]; size_t pos; @@ -4830,26 +5451,30 @@ transform_image_validate(transform_display *dp, png_structp pp, png_infop pi) */ if (in_pixel.red != out_pixel.red) transform_range_check(pp, r, g, b, a, in_pixel.red, in_pixel.redf, - out_pixel.red, sample_depth, in_pixel.rede, "red/gray", + out_pixel.red, sample_depth, in_pixel.rede, + dp->pm->limit + 1./(2*((1U<<in_pixel.red_sBIT)-1)), "red/gray", digitization_error); if ((out_ct & PNG_COLOR_MASK_COLOR) != 0 && in_pixel.green != out_pixel.green) transform_range_check(pp, r, g, b, a, in_pixel.green, in_pixel.greenf, out_pixel.green, sample_depth, in_pixel.greene, - "green", digitization_error); + dp->pm->limit + 1./(2*((1U<<in_pixel.green_sBIT)-1)), "green", + digitization_error); if ((out_ct & PNG_COLOR_MASK_COLOR) != 0 && in_pixel.blue != out_pixel.blue) transform_range_check(pp, r, g, b, a, in_pixel.blue, in_pixel.bluef, - out_pixel.blue, sample_depth, in_pixel.bluee, "blue", + out_pixel.blue, sample_depth, in_pixel.bluee, + dp->pm->limit + 1./(2*((1U<<in_pixel.blue_sBIT)-1)), "blue", digitization_error); if ((out_ct & PNG_COLOR_MASK_ALPHA) != 0 && in_pixel.alpha != out_pixel.alpha) transform_range_check(pp, r, g, b, a, in_pixel.alpha, in_pixel.alphaf, out_pixel.alpha, sample_depth, in_pixel.alphae, - "alpha", digitization_error); + dp->pm->limit + 1./(2*((1U<<in_pixel.alpha_sBIT)-1)), "alpha", + digitization_error); } /* pixel (x) loop */ } /* row (y) loop */ @@ -4860,7 +5485,8 @@ transform_image_validate(transform_display *dp, png_structp pp, png_infop pi) static void transform_end(png_structp pp, png_infop pi) { - transform_display *dp = png_get_progressive_ptr(pp); + transform_display *dp = voidcast(transform_display*, + png_get_progressive_ptr(pp)); transform_image_validate(dp, pp, pi); } @@ -4868,7 +5494,7 @@ transform_end(png_structp pp, png_infop pi) /* A single test run. */ static void transform_test(png_modifier *pmIn, PNG_CONST png_uint_32 idIn, - PNG_CONST image_transform* transform_listIn, PNG_CONST char *name) + PNG_CONST image_transform* transform_listIn, PNG_CONST char * volatile name) { transform_display d; context(&pmIn->this, fault); @@ -4877,11 +5503,25 @@ transform_test(png_modifier *pmIn, PNG_CONST png_uint_32 idIn, Try { + size_t pos = 0; png_structp pp; png_infop pi; + char full_name[256]; + + /* Make sure the encoding fields are correct and enter the required + * modifications. + */ + transform_set_encoding(&d); + + /* Add any modifications required by the transform list. */ + d.transform_list->ini(d.transform_list, &d); + + /* Add the color space information, if any, to the name. */ + pos = safecat(full_name, sizeof full_name, pos, name); + pos = safecat_current_encoding(full_name, sizeof full_name, pos, d.pm); /* Get a png_struct for reading the image. */ - pp = set_modifier_for_read(d.pm, &pi, d.this.id, name); + pp = set_modifier_for_read(d.pm, &pi, d.this.id, full_name); standard_palette_init(&d.this); # if 0 @@ -4927,11 +5567,15 @@ transform_test(png_modifier *pmIn, PNG_CONST png_uint_32 idIn, } Catch(fault) + { modifier_reset((png_modifier*)fault); + } } /* The transforms: */ #define ITSTRUCT(name) image_transform_##name +#define ITDATA(name) image_transform_data_##name +#define image_transform_ini image_transform_default_ini #define IT(name)\ static image_transform ITSTRUCT(name) =\ {\ @@ -4941,6 +5585,7 @@ static image_transform ITSTRUCT(name) =\ 0, /*global_use*/\ 0, /*local_use*/\ 0, /*next*/\ + image_transform_ini,\ image_transform_png_set_##name##_set,\ image_transform_png_set_##name##_mod,\ image_transform_png_set_##name##_add\ @@ -4948,6 +5593,13 @@ static image_transform ITSTRUCT(name) =\ #define PT ITSTRUCT(end) /* stores the previous transform */ /* To save code: */ +static void +image_transform_default_ini(PNG_CONST image_transform *this, + transform_display *that) +{ + this->next->ini(this->next, that); +} + static int image_transform_default_add(image_transform *this, PNG_CONST image_transform **that, png_byte colour_type, png_byte bit_depth) @@ -5397,16 +6049,173 @@ IT(strip_alpha); * png_fixed_point green) * png_get_rgb_to_gray_status * - * At present the APIs are simply tested using the 16.16 fixed point conversion - * values known to be used inside libpng: + * The 'default' test here uses values known to be used inside libpng: * * red: 6968 * green: 23434 * blue: 2366 * - * NOTE: this currently ignores the gamma because no gamma is being set, the - * tests on gamma need to happen in the gamma test set. + * These values are being retained for compatibility, along with the somewhat + * broken truncation calculation in the fast-and-inaccurate code path. Older + * versions of libpng will fail the accuracy tests below because they use the + * truncation algorithm everywhere. */ +#define data ITDATA(rgb_to_gray) +static struct +{ + double gamma; /* File gamma to use in processing */ + + /* The following are the parameters for png_set_rgb_to_gray: */ +# ifdef PNG_FLOATING_POINT_SUPPORTED + double red_to_set; + double green_to_set; +# else + png_fixed_point red_to_set; + png_fixed_point green_to_set; +# endif + + /* The actual coefficients: */ + double red_coefficient; + double green_coefficient; + double blue_coefficient; + + /* Set if the coeefficients have been overridden. */ + int coefficients_overridden; +} data; + +#undef image_transform_ini +#define image_transform_ini image_transform_png_set_rgb_to_gray_ini +static void +image_transform_png_set_rgb_to_gray_ini(PNG_CONST image_transform *this, + transform_display *that) +{ + png_modifier *pm = that->pm; + PNG_CONST color_encoding *e = pm->current_encoding; + + UNUSED(this) + + /* Since we check the encoding this flag must be set: */ + pm->test_uses_encoding = 1; + + /* If 'e' is not NULL chromaticity information is present and either a cHRM + * or an sRGB chunk will be inserted. + */ + if (e != 0) + { + /* Coefficients come from the encoding, but may need to be normalized to a + * white point Y of 1.0 + */ + PNG_CONST double whiteY = e->red.Y + e->green.Y + e->blue.Y; + + data.red_coefficient = e->red.Y; + data.green_coefficient = e->green.Y; + data.blue_coefficient = e->blue.Y; + + if (whiteY != 1) + { + data.red_coefficient /= whiteY; + data.green_coefficient /= whiteY; + data.blue_coefficient /= whiteY; + } + } + + else + { + /* The default (built in) coeffcients, as above: */ + data.red_coefficient = 6968 / 32768.; + data.green_coefficient = 23434 / 32768.; + data.blue_coefficient = 2366 / 32768.; + } + + data.gamma = pm->current_gamma; + + /* If not set then the calculations assume linear encoding (implicitly): */ + if (data.gamma == 0) + data.gamma = 1; + + /* The arguments to png_set_rgb_to_gray can override the coefficients implied + * by the color space encoding. If doing exhaustive checks do the override + * in each case, otherwise do it randomly. + */ + if (pm->test_exhaustive) + { + /* First time in coefficients_overridden is 0, the following sets it to 1, + * so repeat if it is set. If a test fails this may mean we subsequently + * skip a non-override test, ignore that. + */ + data.coefficients_overridden = !data.coefficients_overridden; + pm->repeat = data.coefficients_overridden != 0; + } + + else + data.coefficients_overridden = random_choice(); + + if (data.coefficients_overridden) + { + /* These values override the color encoding defaults, simply use random + * numbers. + */ + png_uint_32 ru; + double total; + + RANDOMIZE(ru); + data.green_coefficient = total = (ru & 0xffff) / 65535.; + ru >>= 16; + data.red_coefficient = (1 - total) * (ru & 0xffff) / 65535.; + total += data.red_coefficient; + data.blue_coefficient = 1 - total; + +# ifdef PNG_FLOATING_POINT_SUPPORTED + data.red_to_set = data.red_coefficient; + data.green_to_set = data.green_coefficient; +# else + data.red_to_set = fix(data.red_coefficient); + data.green_to_set = fix(data.green_coefficient); +# endif + + /* The following just changes the error messages: */ + pm->encoding_ignored = 1; + } + + else + { + data.red_to_set = -1; + data.green_to_set = -1; + } + + /* Adjust the error limit in the png_modifier because of the larger errors + * produced in the digitization during the gamma handling. + */ + if (data.gamma != 1) /* Use gamma tables */ + { + if (that->this.bit_depth == 16 || pm->assume_16_bit_calculations) + { + /* The 16 bit case ends up producing a maximum error of about + * +/-5 in 65535, allow for +/-8 with the given gamma. + */ + that->pm->limit += pow(8./65535, data.gamma); + } + + else + { + /* Rounding to 8 bits in the linear space causes massive errors which + * will trigger the error check in transform_range_check. Fix that + * here by taking the gamma encoding into account. + */ + that->pm->limit += pow(1./255, data.gamma); + } + } + + else + { + /* With no gamma correction a large error comes from the truncation of the + * calculation in the 8 bit case, allow for that here. + */ + if (that->this.bit_depth != 16) + that->pm->limit += 4E-3; + } +} + static void image_transform_png_set_rgb_to_gray_set(PNG_CONST image_transform *this, transform_display *that, png_structp pp, png_infop pi) @@ -5414,11 +6223,123 @@ image_transform_png_set_rgb_to_gray_set(PNG_CONST image_transform *this, PNG_CONST int error_action = 1; /* no error, no defines in png.h */ # ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_rgb_to_gray(pp, error_action, -1, -1); + png_set_rgb_to_gray(pp, error_action, data.red_to_set, data.green_to_set); # else - png_set_rgb_to_gray_fixed(pp, error_action, -1, -1); + png_set_rgb_to_gray_fixed(pp, error_action, data.red_to_set, + data.green_to_set); # endif +# ifdef PNG_READ_cHRM_SUPPORTED + if (that->pm->current_encoding != 0) + { + /* We have an encoding so a cHRM chunk may have been set; if so then + * check that the libpng APIs give the correct (X,Y,Z) values within + * some margin of error for the round trip through the chromaticity + * form. + */ +# ifdef PNG_FLOATING_POINT_SUPPORTED +# define API_function png_get_cHRM_XYZ +# define API_form "FP" +# define API_type double +# define API_cvt(x) (x) +# else +# define API_function png_get_cHRM_XYZ_fixed +# define API_form "fixed" +# define API_type png_fixed_point +# define API_cvt(x) ((double)(x)/PNG_FP_1) +# endif + + API_type rX, gX, bX; + API_type rY, gY, bY; + API_type rZ, gZ, bZ; + + if ((API_function(pp, pi, &rX, &rY, &rZ, &gX, &gY, &gZ, &bX, &bY, &bZ) + & PNG_INFO_cHRM) != 0) + { + double maxe; + PNG_CONST char *el; + color_encoding e, o; + + /* Expect libpng to return a normalized result, but the original + * color space encoding may not be normalized. + */ + modifier_current_encoding(that->pm, &o); + normalize_color_encoding(&o); + + /* Sanity check the pngvalid code - the coefficients should match + * the normalized Y values of the encoding unless they were + * overridden. + */ + if (data.red_to_set == -1 && data.green_to_set == -1 && + (fabs(o.red.Y - data.red_coefficient) > DBL_EPSILON || + fabs(o.green.Y - data.green_coefficient) > DBL_EPSILON || + fabs(o.blue.Y - data.blue_coefficient) > DBL_EPSILON)) + png_error(pp, "internal pngvalid cHRM coefficient error"); + + /* Generate a colour space encoding. */ + e.gamma = o.gamma; /* not used */ + e.red.X = API_cvt(rX); + e.red.Y = API_cvt(rY); + e.red.Z = API_cvt(rZ); + e.green.X = API_cvt(gX); + e.green.Y = API_cvt(gY); + e.green.Z = API_cvt(gZ); + e.blue.X = API_cvt(bX); + e.blue.Y = API_cvt(bY); + e.blue.Z = API_cvt(bZ); + + /* This should match the original one from the png_modifier, within + * the range permitted by the libpng fixed point representation. + */ + maxe = 0; + el = "-"; /* Set to element name with error */ + +# define CHECK(col,x)\ + {\ + double err = fabs(o.col.x - e.col.x);\ + if (err > maxe)\ + {\ + maxe = err;\ + el = #col "(" #x ")";\ + }\ + } + + CHECK(red,X) + CHECK(red,Y) + CHECK(red,Z) + CHECK(green,X) + CHECK(green,Y) + CHECK(green,Z) + CHECK(blue,X) + CHECK(blue,Y) + CHECK(blue,Z) + + /* Here in both fixed and floating cases to check the values read + * from the cHRm chunk. PNG uses fixed point in the cHRM chunk, so + * we can't expect better than +/-.5E-5 on the result, allow 1E-5. + */ + if (maxe >= 1E-5) + { + size_t pos = 0; + char buffer[256]; + + pos = safecat(buffer, sizeof buffer, pos, API_form); + pos = safecat(buffer, sizeof buffer, pos, " cHRM "); + pos = safecat(buffer, sizeof buffer, pos, el); + pos = safecat(buffer, sizeof buffer, pos, " error: "); + pos = safecatd(buffer, sizeof buffer, pos, maxe, 7); + pos = safecat(buffer, sizeof buffer, pos, " "); + /* Print the color space without the gamma value: */ + pos = safecat_color_encoding(buffer, sizeof buffer, pos, &o, 0); + pos = safecat(buffer, sizeof buffer, pos, " -> "); + pos = safecat_color_encoding(buffer, sizeof buffer, pos, &e, 0); + + png_error(pp, buffer); + } + } + } +# endif /* READ_cHRM */ + this->next->set(this->next, that, pp, pi); } @@ -5428,15 +6349,144 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this, { if ((that->colour_type & PNG_COLOR_MASK_COLOR) != 0) { + double gray, err; + if (that->colour_type == PNG_COLOR_TYPE_PALETTE) image_pixel_convert_PLTE(that); /* Image now has RGB channels... */ - that->bluef = that->greenf = that->redf = (that->redf * 6968 + - that->greenf * 23434 + that->bluef * 2366) / 32768; - that->bluee = that->greene = that->rede = (that->rede * 6968 + - that->greene * 23434 + that->bluee * 2366) / 32768 * - (1 + DBL_EPSILON * 6); + { + PNG_CONST png_modifier *pm = display->pm; + PNG_CONST unsigned int sample_depth = that->sample_depth; + int isgray; + double r, g, b; + double rlo, rhi, glo, ghi, blo, bhi, graylo, grayhi; + + /* Do this using interval arithmetic, otherwise it is too difficult to + * handle the errors correctly. + * + * To handle the gamma correction work out the upper and lower bounds + * of the digitized value. Assume rounding here - normally the values + * will be identical after this operation if there is only one + * transform, feel free to delete the png_error checks on this below in + * the future (this is just me trying to ensure it works!) + */ + r = rlo = rhi = that->redf; + rlo -= that->rede; + rlo = digitize(pm, rlo, sample_depth, 1/*round*/); + rhi += that->rede; + rhi = digitize(pm, rhi, sample_depth, 1/*round*/); + + g = glo = ghi = that->greenf; + glo -= that->greene; + glo = digitize(pm, glo, sample_depth, 1/*round*/); + ghi += that->greene; + ghi = digitize(pm, ghi, sample_depth, 1/*round*/); + + b = blo = bhi = that->bluef; + blo -= that->bluee; + blo = digitize(pm, blo, sample_depth, 1/*round*/); + bhi += that->greene; + bhi = digitize(pm, bhi, sample_depth, 1/*round*/); + + isgray = r==g && g==b; + + if (data.gamma != 1) + { + PNG_CONST double power = 1/data.gamma; + PNG_CONST double abse = abserr(pm, sample_depth, sample_depth); + + /* 'abse' is the absolute error permitted in linear calculations. It + * is used here to capture the error permitted in the handling + * (undoing) of the gamma encoding. Once again digitization occurs + * to handle the upper and lower bounds of the values. This is + * where the real errors are introduced. + */ + r = pow(r, power); + rlo = digitize(pm, pow(rlo, power)-abse, sample_depth, 1); + rhi = digitize(pm, pow(rhi, power)+abse, sample_depth, 1); + + g = pow(g, power); + glo = digitize(pm, pow(glo, power)-abse, sample_depth, 1); + ghi = digitize(pm, pow(ghi, power)+abse, sample_depth, 1); + + b = pow(b, power); + blo = digitize(pm, pow(blo, power)-abse, sample_depth, 1); + bhi = digitize(pm, pow(bhi, power)+abse, sample_depth, 1); + } + + /* Now calculate the actual gray values. Although the error in the + * coefficients depends on whether they were specified on the command + * line (in which case truncation to 15 bits happened) or not (rounding + * was used) the maxium error in an individual coefficient is always + * 1/32768, because even in the rounding case the requirement that + * coefficients add up to 32768 can cause a larger rounding error. + * + * The only time when rounding doesn't occur in 1.5.5 and later is when + * the non-gamma code path is used for less than 16 bit data. + */ + gray = r * data.red_coefficient + g * data.green_coefficient + + b * data.blue_coefficient; + + { + PNG_CONST int do_round = data.gamma != 1 || sample_depth == 16; + PNG_CONST double ce = 1. / 32768; + + graylo = digitize(pm, rlo * (data.red_coefficient-ce) + + glo * (data.green_coefficient-ce) + + blo * (data.blue_coefficient-ce), sample_depth, do_round); + if (graylo <= 0) + graylo = 0; + + grayhi = digitize(pm, rhi * (data.red_coefficient+ce) + + ghi * (data.green_coefficient+ce) + + bhi * (data.blue_coefficient+ce), sample_depth, do_round); + if (grayhi >= 1) + grayhi = 1; + } + + /* And invert the gamma. */ + if (data.gamma != 1) + { + PNG_CONST double power = data.gamma; + + gray = pow(gray, power); + graylo = digitize(pm, pow(graylo, power), sample_depth, 1); + grayhi = digitize(pm, pow(grayhi, power), sample_depth, 1); + } + + /* Now the error can be calculated. + * + * If r==g==b because there is no overall gamma correction libpng + * currently preserves the original value. + */ + if (isgray) + err = (that->rede + that->greene + that->bluee)/3; + + else + { + err = fabs(grayhi-gray); + if (fabs(gray - graylo) > err) + err = fabs(graylo-gray); + + /* Check that this worked: */ + if (err > display->pm->limit) + { + size_t pos = 0; + char buffer[128]; + + pos = safecat(buffer, sizeof buffer, pos, "rgb_to_gray error "); + pos = safecatd(buffer, sizeof buffer, pos, err, 6); + pos = safecat(buffer, sizeof buffer, pos, " exceeds limit "); + pos = safecatd(buffer, sizeof buffer, pos, + display->pm->limit, 6); + png_error(pp, buffer); + } + } + } + + that->bluef = that->greenf = that->redf = gray; + that->bluee = that->greene = that->rede = err; /* The sBIT is the minium of the three colour channel sBITs. */ if (that->red_sBIT > that->green_sBIT) @@ -5445,7 +6495,7 @@ image_transform_png_set_rgb_to_gray_mod(PNG_CONST image_transform *this, that->red_sBIT = that->blue_sBIT; that->blue_sBIT = that->green_sBIT = that->red_sBIT; - /* And zap the colour bit in the type: */ + /* And remove the colour bit in the type: */ if (that->colour_type == PNG_COLOR_TYPE_RGB) that->colour_type = PNG_COLOR_TYPE_GRAY; else if (that->colour_type == PNG_COLOR_TYPE_RGB_ALPHA) @@ -5467,9 +6517,12 @@ image_transform_png_set_rgb_to_gray_add(image_transform *this, return (colour_type & PNG_COLOR_MASK_COLOR) != 0; } +#undef data IT(rgb_to_gray); #undef PT #define PT ITSTRUCT(rgb_to_gray) +#undef image_transform_ini +#define image_transform_ini image_transform_default_ini #endif /* PNG_READ_RGB_TO_GRAY_SUPPORTED */ #ifdef PNG_READ_BACKGROUND_SUPPORTED @@ -5479,8 +6532,11 @@ IT(rgb_to_gray); * int background_gamma_code, int need_expand, * png_fixed_point background_gamma) * - * As with rgb_to_gray this ignores the gamma. + * As with rgb_to_gray this ignores the gamma (at present.) */ +#define data ITDATA(background) +static image_pixel data; + static void image_transform_png_set_background_set(PNG_CONST image_transform *this, transform_display *that, png_structp pp, png_infop pi) @@ -5509,7 +6565,7 @@ image_transform_png_set_background_set(PNG_CONST image_transform *this, else bit_depth = that->this.bit_depth; - image_pixel_init(&that->background_colour, random_bytes, colour_type, + image_pixel_init(&data, random_bytes, colour_type, bit_depth, 0/*x*/, 0/*unused: palette*/); /* Extract the background colour from this image_pixel, but make sure the @@ -5519,13 +6575,13 @@ image_transform_png_set_background_set(PNG_CONST image_transform *this, if (colour_type & PNG_COLOR_MASK_COLOR) { - back.red = (png_uint_16)that->background_colour.red; - back.green = (png_uint_16)that->background_colour.green; - back.blue = (png_uint_16)that->background_colour.blue; + back.red = (png_uint_16)data.red; + back.green = (png_uint_16)data.green; + back.blue = (png_uint_16)data.blue; } else - back.gray = (png_uint_16)that->background_colour.red; + back.gray = (png_uint_16)data.red; # ifdef PNG_FLOATING_POINT_SUPPORTED png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, 1/*need expand*/, @@ -5549,36 +6605,34 @@ image_transform_png_set_background_mod(PNG_CONST image_transform *this, /* This is only necessary if the alpha value is less than 1. */ if (that->alphaf < 1) { - PNG_CONST image_pixel *back = &display->background_colour; - /* Now we do the background calculation without any gamma correction. */ if (that->alphaf <= 0) { - that->redf = back->redf; - that->greenf = back->greenf; - that->bluef = back->bluef; + that->redf = data.redf; + that->greenf = data.greenf; + that->bluef = data.bluef; - that->rede = back->rede; - that->greene = back->greene; - that->bluee = back->bluee; + that->rede = data.rede; + that->greene = data.greene; + that->bluee = data.bluee; - that->red_sBIT= back->red_sBIT; - that->green_sBIT= back->green_sBIT; - that->blue_sBIT= back->blue_sBIT; + that->red_sBIT= data.red_sBIT; + that->green_sBIT= data.green_sBIT; + that->blue_sBIT= data.blue_sBIT; } else /* 0 < alpha < 1 */ { double alf = 1 - that->alphaf; - that->redf = that->redf * that->alphaf + back->redf * alf; - that->rede = that->rede * that->alphaf + back->rede * alf + + that->redf = that->redf * that->alphaf + data.redf * alf; + that->rede = that->rede * that->alphaf + data.rede * alf + DBL_EPSILON; - that->greenf = that->greenf * that->alphaf + back->greenf * alf; - that->greene = that->greene * that->alphaf + back->greene * alf + + that->greenf = that->greenf * that->alphaf + data.greenf * alf; + that->greene = that->greene * that->alphaf + data.greene * alf + DBL_EPSILON; - that->bluef = that->bluef * that->alphaf + back->bluef * alf; - that->bluee = that->bluee * that->alphaf + back->bluee * alf + + that->bluef = that->bluef * that->alphaf + data.bluef * alf; + that->bluee = that->bluee * that->alphaf + data.bluee * alf + DBL_EPSILON; } @@ -5598,6 +6652,7 @@ image_transform_png_set_background_mod(PNG_CONST image_transform *this, #define image_transform_png_set_background_add image_transform_default_add +#undef data IT(background); #undef PT #define PT ITSTRUCT(background) @@ -5755,7 +6810,7 @@ image_transform_add(PNG_CONST image_transform **this, unsigned int max, else { - /* Not useful and max>0, so remvoe it from *this: */ + /* Not useful and max>0, so remove it from *this: */ *this = list->next; list->next = 0; @@ -5886,11 +6941,16 @@ perform_transform_test(png_modifier *pm) break; /* The command line can change this to checking interlaced images. */ - transform_test(pm, FILEID(colour_type, bit_depth, palette_number, - pm->interlace_type, 0, 0, 0), list, name); + do + { + pm->repeat = 0; + transform_test(pm, FILEID(colour_type, bit_depth, palette_number, + pm->interlace_type, 0, 0, 0), list, name); - if (fail(pm)) - return; + if (fail(pm)) + return; + } + while (pm->repeat); } } } @@ -5898,147 +6958,6 @@ perform_transform_test(png_modifier *pm) /********************************* GAMMA TESTS ********************************/ #ifdef PNG_READ_GAMMA_SUPPORTED -/* Gamma test images. */ -typedef struct gamma_modification -{ - png_modification this; - png_fixed_point gamma; -} gamma_modification; - -static int -gamma_modify(png_modifier *pm, png_modification *me, int add) -{ - UNUSED(add) - /* This simply dumps the given gamma value into the buffer. */ - png_save_uint_32(pm->buffer, 4); - png_save_uint_32(pm->buffer+4, CHUNK_gAMA); - png_save_uint_32(pm->buffer+8, ((gamma_modification*)me)->gamma); - return 1; -} - -static void -gamma_modification_init(gamma_modification *me, png_modifier *pm, double gammad) -{ - double g; - - modification_init(&me->this); - me->this.chunk = CHUNK_gAMA; - me->this.modify_fn = gamma_modify; - me->this.add = CHUNK_PLTE; - g = floor(gammad * 100000 + .5); - me->gamma = (png_fixed_point)g; - me->this.next = pm->modifications; - pm->modifications = &me->this; -} - -typedef struct srgb_modification -{ - png_modification this; - png_byte intent; -} srgb_modification; - -static int -srgb_modify(png_modifier *pm, png_modification *me, int add) -{ - UNUSED(add) - /* As above, ignore add and just make a new chunk */ - png_save_uint_32(pm->buffer, 1); - png_save_uint_32(pm->buffer+4, CHUNK_sRGB); - pm->buffer[8] = ((srgb_modification*)me)->intent; - return 1; -} - -static void -srgb_modification_init(srgb_modification *me, png_modifier *pm, png_byte intent) -{ - modification_init(&me->this); - me->this.chunk = CHUNK_sBIT; - - if (intent <= 3) /* if valid, else *delete* sRGB chunks */ - { - me->this.modify_fn = srgb_modify; - me->this.add = CHUNK_PLTE; - me->intent = intent; - } - - else - { - me->this.modify_fn = 0; - me->this.add = 0; - me->intent = 0; - } - - me->this.next = pm->modifications; - pm->modifications = &me->this; -} - -typedef struct sbit_modification -{ - png_modification this; - png_byte sbit; -} sbit_modification; - -static int -sbit_modify(png_modifier *pm, png_modification *me, int add) -{ - png_byte sbit = ((sbit_modification*)me)->sbit; - if (pm->bit_depth > sbit) - { - int cb = 0; - switch (pm->colour_type) - { - case 0: - cb = 1; - break; - - case 2: - case 3: - cb = 3; - break; - - case 4: - cb = 2; - break; - - case 6: - cb = 4; - break; - - default: - png_error(pm->this.pread, - "unexpected colour type in sBIT modification"); - } - - png_save_uint_32(pm->buffer, cb); - png_save_uint_32(pm->buffer+4, CHUNK_sBIT); - - while (cb > 0) - (pm->buffer+8)[--cb] = sbit; - - return 1; - } - else if (!add) - { - /* Remove the sBIT chunk */ - pm->buffer_count = pm->buffer_position = 0; - return 1; - } - else - return 0; /* do nothing */ -} - -static void -sbit_modification_init(sbit_modification *me, png_modifier *pm, png_byte sbit) -{ - modification_init(&me->this); - me->this.chunk = CHUNK_sBIT; - me->this.modify_fn = sbit_modify; - me->this.add = CHUNK_PLTE; - me->sbit = sbit; - me->this.next = pm->modifications; - pm->modifications = &me->this; -} - /* Reader callbacks and implementations, where they differ from the standard * ones. */ @@ -6140,7 +7059,7 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) */ PNG_CONST double sg = dp->screen_gamma; # ifndef PNG_FLOATING_POINT_SUPPORTED - PNG_CONST png_fixed_point g = (png_fixed_point)(sg*100000+.5); + PNG_CONST png_fixed_point g = fix(sg); # endif # ifdef PNG_FLOATING_POINT_SUPPORTED @@ -6158,7 +7077,7 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) # ifdef PNG_FLOATING_POINT_SUPPORTED png_set_gamma(pp, sg, dp->file_gamma); # else - png_fixed_point f = (png_fixed_point)(dp->file_gamma*100000+.5); + png_fixed_point f = fix(dp->file_gamma); png_set_gamma_fixed(pp, g, f); # endif } @@ -6175,8 +7094,8 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) png_set_gamma(pp, dp->screen_gamma, dp->file_gamma); # else { - png_fixed_point s = (png_fixed_point)(dp->screen_gamma*100000+.5); - png_fixed_point f = (png_fixed_point)(dp->file_gamma*100000+.5); + png_fixed_point s = fix(dp->screen_gamma); + png_fixed_point f = fix(dp->file_gamma); png_set_gamma_fixed(pp, s, f); } # endif @@ -6188,7 +7107,7 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) */ PNG_CONST double bg = dp->background_gamma; # ifndef PNG_FLOATING_POINT_SUPPORTED - PNG_CONST png_fixed_point g = (png_fixed_point)(bg*100000+.5); + PNG_CONST png_fixed_point g = fix(bg); # endif # ifdef PNG_FLOATING_POINT_SUPPORTED @@ -6213,7 +7132,8 @@ gamma_info_imp(gamma_display *dp, png_structp pp, png_infop pi) static void gamma_info(png_structp pp, png_infop pi) { - gamma_info_imp(png_get_progressive_ptr(pp), pp, pi); + gamma_info_imp(voidcast(gamma_display*, png_get_progressive_ptr(pp)), pp, + pi); } /* Validate a single component value - the routine gets the input and output @@ -7107,8 +8027,8 @@ gamma_image_validate(gamma_display *dp, png_structp pp, png_infop pi) } } - /* Handle greyscale or RGB components. */ - if ((in_ct & PNG_COLOR_MASK_COLOR) == 0) /* greyscale */ + /* Handle grayscale or RGB components. */ + if ((in_ct & PNG_COLOR_MASK_COLOR) == 0) /* grayscale */ (void)gamma_component_validate("gray", &vi, sample(std, in_ct, in_bd, x, 0), sample(pRow, out_ct, out_bd, x, 0), alpha/*component*/, @@ -7156,7 +8076,7 @@ gamma_image_validate(gamma_display *dp, png_structp pp, png_infop pi) static void gamma_end(png_structp pp, png_infop pi) { - gamma_display *dp = png_get_progressive_ptr(pp); + gamma_display *dp = voidcast(gamma_display*, png_get_progressive_ptr(pp)); if (!dp->this.speed) gamma_image_validate(dp, pp, pi); @@ -7192,15 +8112,20 @@ gamma_test(png_modifier *pmIn, PNG_CONST png_byte colour_typeIn, { png_structp pp; png_infop pi; - gamma_modification gamma_mod; + gama_modification gama_mod; srgb_modification srgb_mod; sbit_modification sbit_mod; + /* For the moment don't use the png_modifier support here. */ + d.pm->encoding_counter = 0; + modifier_set_encoding(d.pm); /* Just resets everything */ + d.pm->current_gamma = d.file_gamma; + /* Make an appropriate modifier to set the PNG file gamma to the * given gamma value and the sBIT chunk to the given precision. */ d.pm->modifications = NULL; - gamma_modification_init(&gamma_mod, d.pm, d.file_gamma); + gama_modification_init(&gama_mod, d.pm, d.file_gamma); srgb_modification_init(&srgb_mod, d.pm, 127 /*delete*/); if (d.sbit > 0) sbit_modification_init(&sbit_mod, d.pm, d.sbit); @@ -7410,15 +8335,16 @@ static void perform_gamma_transform_tests(png_modifier *pm) { unsigned int i, j; - for (i=0; i<pm->ngammas; ++i) for (j=0; j<pm->ngammas; ++j) if (i != j) - { - gamma_transform_test(pm, colour_type, bit_depth, palette_number, - pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], 0/*sBIT*/, - pm->use_input_precision, 0 /*do not scale16*/); + for (i=0; i<pm->ngamma_tests; ++i) for (j=0; j<pm->ngamma_tests; ++j) + if (i != j) + { + gamma_transform_test(pm, colour_type, bit_depth, palette_number, + pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], 0/*sBIT*/, + pm->use_input_precision, 0 /*do not scale16*/); - if (fail(pm)) - return; - } + if (fail(pm)) + return; + } } } @@ -7445,11 +8371,11 @@ static void perform_gamma_sbit_tests(png_modifier *pm) { unsigned int i; - for (i=0; i<pm->ngammas; ++i) + for (i=0; i<pm->ngamma_tests; ++i) { unsigned int j; - for (j=0; j<pm->ngammas; ++j) if (i != j) + for (j=0; j<pm->ngamma_tests; ++j) if (i != j) { gamma_transform_test(pm, colour_type, bit_depth, npalette, pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], @@ -7482,9 +8408,9 @@ static void perform_gamma_scale16_tests(png_modifier *pm) * by much) - this could be fixed, it only appears with the -g option. */ unsigned int i, j; - for (i=0; i<pm->ngammas; ++i) + for (i=0; i<pm->ngamma_tests; ++i) { - for (j=0; j<pm->ngammas; ++j) + for (j=0; j<pm->ngamma_tests; ++j) { if (i != j && fabs(pm->gammas[j]/pm->gammas[i]-1) >= PNG_GAMMA_THRESHOLD) @@ -7663,7 +8589,7 @@ perform_gamma_composition_tests(png_modifier *pm, int do_background, unsigned int i, j; /* Don't skip the i==j case here - it's relevant. */ - for (i=0; i<pm->ngammas; ++i) for (j=0; j<pm->ngammas; ++j) + for (i=0; i<pm->ngamma_tests; ++i) for (j=0; j<pm->ngamma_tests; ++j) { gamma_composition_test(pm, colour_type, bit_depth, palette_number, pm->interlace_type, 1/pm->gammas[i], pm->gammas[j], @@ -8179,6 +9105,41 @@ perform_interlace_macro_validation(void) } } +/* Test color encodings. These values are back-calculated from the published + * chromaticities. The values are accurate to about 14 decimal places; 15 are + * given. These values are much more accurate than the ones given in the spec, + * which typically don't exceed 4 decimal places. This allows testing of the + * libpng code to its theoretical accuracy of 4 decimal places. (If pngvalid + * used the published errors the 'slack' permitted would have to be +/-.5E-4 or + * more.) + * + * The png_modifier code assumes that encodings[0] is sRGB and treats it + * specially: do not change the first entry in this list! + */ +static PNG_CONST color_encoding test_encodings[] = +{ +/* sRGB: must be first in this list! */ +/*gamma:*/ { 1/2.2, +/*red: */ { 0.412390799265959, 0.212639005871510, 0.019330818715592 }, +/*green:*/ { 0.357584339383878, 0.715168678767756, 0.119194779794626 }, +/*blue: */ { 0.180480788401834, 0.072192315360734, 0.950532152249660} }, +/* Kodak ProPhoto (wide gamut) */ +/*gamma:*/ { 1/1.6 /*approximate: uses 1.8 power law compared to sRGB 2.4*/, +/*red: */ { 0.797760489672303, 0.288071128229293, 0.000000000000000 }, +/*green:*/ { 0.135185837175740, 0.711843217810102, 0.000000000000000 }, +/*blue: */ { 0.031349349581525, 0.000085653960605, 0.825104602510460} }, +/* Adobe RGB (1998) */ +/*gamma:*/ { 1/(2+51./256), +/*red: */ { 0.576669042910131, 0.297344975250536, 0.027031361386412 }, +/*green:*/ { 0.185558237906546, 0.627363566255466, 0.070688852535827 }, +/*blue: */ { 0.188228646234995, 0.075291458493998, 0.991337536837639} }, +/* Adobe Wide Gamut RGB */ +/*gamma:*/ { 1/(2+51./256), +/*red: */ { 0.716500716779386, 0.258728243040113, 0.000000000000000 }, +/*green:*/ { 0.101020574397477, 0.724682314948566, 0.051211818965388 }, +/*blue: */ { 0.146774385252705, 0.016589442011321, 0.773892783545073} }, +}; + /* main program */ int main(int argc, PNG_CONST char **argv) { @@ -8220,7 +9181,13 @@ int main(int argc, PNG_CONST char **argv) /* Store the test gammas */ pm.gammas = gammas; - pm.ngammas = 0; /* default to off */ + pm.ngammas = (sizeof gammas) / (sizeof gammas[0]); + pm.ngamma_tests = 0; /* default to off */ + + /* And the test encodings */ + pm.encodings = test_encodings; + pm.nencodings = (sizeof test_encodings) / (sizeof test_encodings[0]); + pm.sbitlow = 8U; /* because libpng doesn't do sBIT below 8! */ /* The following allows results to pass if they correspond to anything in the * transformed range [input-.5,input+.5]; this is is required because of the @@ -8277,8 +9244,8 @@ int main(int argc, PNG_CONST char **argv) pm.this.treat_warnings_as_errors = 0; else if (strcmp(*argv, "--speed") == 0) - pm.this.speed = 1, pm.ngammas = (sizeof gammas)/(sizeof gammas[0]), - pm.test_standard = 0, summary = 0; + pm.this.speed = 1, pm.ngamma_tests = pm.ngammas, pm.test_standard = 0, + summary = 0; else if (strcmp(*argv, "--memory") == 0) memstats = 1; @@ -8320,7 +9287,7 @@ int main(int argc, PNG_CONST char **argv) else if (strcmp(*argv, "--gamma") == 0) { /* Just do two gamma tests here (2.2 and linear) for speed: */ - pm.ngammas = 2U; + pm.ngamma_tests = 2U; pm.test_gamma_threshold = 1; pm.test_gamma_transform = 1; pm.test_gamma_sbit = 1; @@ -8330,40 +9297,40 @@ int main(int argc, PNG_CONST char **argv) } else if (strcmp(*argv, "--nogamma") == 0) - pm.ngammas = 0; + pm.ngamma_tests = 0; else if (strcmp(*argv, "--gamma-threshold") == 0) - pm.ngammas = 2U, pm.test_gamma_threshold = 1; + pm.ngamma_tests = 2U, pm.test_gamma_threshold = 1; else if (strcmp(*argv, "--nogamma-threshold") == 0) pm.test_gamma_threshold = 0; else if (strcmp(*argv, "--gamma-transform") == 0) - pm.ngammas = 2U, pm.test_gamma_transform = 1; + pm.ngamma_tests = 2U, pm.test_gamma_transform = 1; else if (strcmp(*argv, "--nogamma-transform") == 0) pm.test_gamma_transform = 0; else if (strcmp(*argv, "--gamma-sbit") == 0) - pm.ngammas = 2U, pm.test_gamma_sbit = 1; + pm.ngamma_tests = 2U, pm.test_gamma_sbit = 1; else if (strcmp(*argv, "--nogamma-sbit") == 0) pm.test_gamma_sbit = 0; else if (strcmp(*argv, "--gamma-16-to-8") == 0) - pm.ngammas = 2U, pm.test_gamma_scale16 = 1; + pm.ngamma_tests = 2U, pm.test_gamma_scale16 = 1; else if (strcmp(*argv, "--nogamma-16-to-8") == 0) pm.test_gamma_scale16 = 0; else if (strcmp(*argv, "--gamma-background") == 0) - pm.ngammas = 2U, pm.test_gamma_background = 1; + pm.ngamma_tests = 2U, pm.test_gamma_background = 1; else if (strcmp(*argv, "--nogamma-background") == 0) pm.test_gamma_background = 0; else if (strcmp(*argv, "--gamma-alpha-mode") == 0) - pm.ngammas = 2U, pm.test_gamma_alpha_mode = 1; + pm.ngamma_tests = 2U, pm.test_gamma_alpha_mode = 1; else if (strcmp(*argv, "--nogamma-alpha-mode") == 0) pm.test_gamma_alpha_mode = 0; @@ -8375,10 +9342,10 @@ int main(int argc, PNG_CONST char **argv) pm.test_gamma_expand16 = 0; else if (strcmp(*argv, "--more-gammas") == 0) - pm.ngammas = 3U; + pm.ngamma_tests = 3U; else if (strcmp(*argv, "--all-gammas") == 0) - pm.ngammas = (sizeof gammas)/(sizeof gammas[0]); + pm.ngamma_tests = pm.ngammas; else if (strcmp(*argv, "--progressive-read") == 0) pm.this.progressive = 1; @@ -8399,6 +9366,9 @@ int main(int argc, PNG_CONST char **argv) pm.calculations_use_input_precision = pm.assume_16_bit_calculations = 0; + else if (strcmp(*argv, "--exhaustive") == 0) + pm.test_exhaustive = 1; + else if (argc > 1 && strcmp(*argv, "--sbitlow") == 0) --argc, pm.sbitlow = (png_byte)atoi(*++argv), catmore = 1; @@ -8465,7 +9435,7 @@ int main(int argc, PNG_CONST char **argv) * tests. */ if (pm.test_standard == 0 && pm.test_size == 0 && pm.test_transform == 0 && - pm.ngammas == 0) + pm.ngamma_tests == 0) { /* Make this do all the tests done in the test shell scripts with the same * parameters, where possible. The limitation is that all the progressive @@ -8475,10 +9445,10 @@ int main(int argc, PNG_CONST char **argv) pm.test_standard = 1; pm.test_size = 1; pm.test_transform = 1; - pm.ngammas = 2U; + pm.ngamma_tests = 2U; } - if (pm.ngammas > 0 && + if (pm.ngamma_tests > 0 && pm.test_gamma_threshold == 0 && pm.test_gamma_transform == 0 && pm.test_gamma_sbit == 0 && pm.test_gamma_scale16 == 0 && pm.test_gamma_background == 0 && pm.test_gamma_alpha_mode == 0) @@ -8491,7 +9461,7 @@ int main(int argc, PNG_CONST char **argv) pm.test_gamma_alpha_mode = 1; } - else if (pm.ngammas == 0) + else if (pm.ngamma_tests == 0) { /* Nothing to test so turn everything off: */ pm.test_gamma_threshold = 0; @@ -8530,7 +9500,7 @@ int main(int argc, PNG_CONST char **argv) #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ #ifdef PNG_READ_GAMMA_SUPPORTED - if (pm.ngammas > 0) + if (pm.ngamma_tests > 0) perform_gamma_test(&pm, summary); #endif } diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngwio.c b/Build/source/libs/libpng/libpng-1.5.5/pngwio.c index 95ffb3429f1..95ffb3429f1 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngwio.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngwio.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngwrite.c b/Build/source/libs/libpng/libpng-1.5.5/pngwrite.c index d1af9e899fb..d1af9e899fb 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngwrite.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngwrite.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngwtran.c b/Build/source/libs/libpng/libpng-1.5.5/pngwtran.c index 124d708c4a3..124d708c4a3 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngwtran.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngwtran.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/pngwutil.c b/Build/source/libs/libpng/libpng-1.5.5/pngwutil.c index 3ae5ed4e2f1..bc3e4dd9dad 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/pngwutil.c +++ b/Build/source/libs/libpng/libpng-1.5.5/pngwutil.c @@ -1,7 +1,7 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.5 [September 22, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -1860,7 +1860,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, { PNG_pCAL; png_size_t purpose_len, units_len, total_len; - png_uint_32p params_len; + png_size_tp params_len; png_byte buf[10]; png_charp new_purpose; int i; @@ -1876,8 +1876,8 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, png_debug1(3, "pCAL units length = %d", (int)units_len); total_len = purpose_len + units_len + 10; - params_len = (png_uint_32p)png_malloc(png_ptr, - (png_alloc_size_t)(nparams * png_sizeof(png_uint_32))); + params_len = (png_size_tp)png_malloc(png_ptr, + (png_alloc_size_t)(nparams * png_sizeof(png_size_t))); /* Find the length of each parameter, making sure we don't count the * null terminator for the last parameter. @@ -1887,13 +1887,12 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); png_debug2(3, "pCAL parameter %d length = %lu", i, (unsigned long)params_len[i]); - total_len += (png_size_t)params_len[i]; + total_len += params_len[i]; } png_debug1(3, "pCAL total length = %d", (int)total_len); png_write_chunk_start(png_ptr, png_pCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_const_bytep)new_purpose, - (png_size_t)purpose_len); + png_write_chunk_data(png_ptr, (png_const_bytep)new_purpose, purpose_len); png_save_int_32(buf, X0); png_save_int_32(buf + 4, X1); buf[8] = (png_byte)type; @@ -1905,8 +1904,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, for (i = 0; i < nparams; i++) { - png_write_chunk_data(png_ptr, (png_const_bytep)params[i], - (png_size_t)params_len[i]); + png_write_chunk_data(png_ptr, (png_const_bytep)params[i], params_len[i]); } png_free(png_ptr, params_len); diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.tgt b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt index 096b2eef179..096b2eef179 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.tgt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.tgt diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.wpj b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj index e2e591cf87a..e2e591cf87a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/libpng.wpj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/libpng.wpj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngconfig.mak b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak index 6943e15d4f7..6943e15d4f7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngconfig.mak +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngconfig.mak diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngtest.tgt b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt index ca3db8c3ac4..ca3db8c3ac4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngtest.tgt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngtest.tgt diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngvalid.tgt b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt index 83d47490c47..83d47490c47 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/owatcom/pngvalid.tgt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/owatcom/pngvalid.tgt diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/PRJ0041.mak b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak index c7a68b503e7..c7a68b503e7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/PRJ0041.mak +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/PRJ0041.mak diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README.txt b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt index 625eefcab7f..625eefcab7f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README.txt diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README_zlib.txt b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt index 81d11cbb577..81d11cbb577 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/README_zlib.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/README_zlib.txt diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.sln b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln index eeb101f2e31..eeb101f2e31 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.sln +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.sln diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.vcproj b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj index 4c5acf94c8b..4c5acf94c8b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/libpng.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/libpng.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/pngtest.vcproj b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj index ff330ae350f..ff330ae350f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/pngtest.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/pngtest.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/zlib.vcproj b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj index eb218488dcf..eb218488dcf 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/visualc71/zlib.vcproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/visualc71/zlib.vcproj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/libpng/libpng.vcxproj b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj index 69779007cfd..c4bf04184ee 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/libpng/libpng.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/libpng/libpng.vcxproj @@ -118,7 +118,7 @@ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <Optimization>Disabled</Optimization> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <IntrinsicFunctions>true</IntrinsicFunctions> <FunctionLevelLinking>true</FunctionLevelLinking> <FloatingPointExceptions>false</FloatingPointExceptions> @@ -175,7 +175,7 @@ <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <FloatingPointExceptions>false</FloatingPointExceptions> <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType> <PrecompiledHeaderFile>pngpriv.h</PrecompiledHeaderFile> diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pnglibconf/pnglibconf.vcxproj b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj index 7c691c32d34..7c691c32d34 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pnglibconf/pnglibconf.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pnglibconf/pnglibconf.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngtest/pngtest.vcxproj b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj index a03dca565ff..a03dca565ff 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngtest/pngtest.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngtest/pngtest.vcxproj diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngvalid/pngvalid.vcxproj b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj index 79fd1bd82bf..bd85806aba2 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/pngvalid/pngvalid.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/pngvalid/pngvalid.vcxproj @@ -81,7 +81,7 @@ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <Optimization>Disabled</Optimization> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> - <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DisableSpecificWarnings>4996;4127</DisableSpecificWarnings> <CompileAsManaged>false</CompileAsManaged> @@ -146,7 +146,7 @@ <Optimization>Full</Optimization> <FunctionLevelLinking>false</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;PNG_USE_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(ZLibSrcDir);..\..\..\scripts;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DisableSpecificWarnings>4996;4127</DisableSpecificWarnings> <CompileAsManaged>false</CompileAsManaged> diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/readme.txt b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt index cfdc43c7df9..e1a726b02f7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/readme.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.5.4 - July 7, 2011 +libpng version 1.5.5 - September 22, 2011 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/vstudio.sln b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln index fad771b1fce..fad771b1fce 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/vstudio.sln +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/vstudio.sln diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib.props b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props index 2128edd25e9..31ddabfacbf 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib.props +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib.props @@ -2,7 +2,7 @@ <!-- * zlib.props - location of zlib source * - * libpng version 1.5.4 - July 7, 2011 + * libpng version 1.5.5 - September 22, 2011 * * Copyright (c) 1998-2011 Glenn Randers-Pehrson * @@ -19,11 +19,14 @@ <PropertyGroup Label="Globals"> <!-- Place the name of the directory containing the source of zlib used for debugging in this property. + The directory need only contain the '.c' and '.h' files from the source. + If you use a relative directory name (as below) then it must be relative to the project directories; these are one level deepers than the directories containing this file. + If the version of zlib you use does not match that used when the distribution was built you will get warnings from pngtest that the zlib versions do not match. The zlib version used in this build is recorded diff --git a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib/zlib.vcxproj b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj index aa125defe0c..d627817969a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/projects/vstudio/zlib/zlib.vcxproj +++ b/Build/source/libs/libpng/libpng-1.5.5/projects/vstudio/zlib/zlib.vcxproj @@ -84,7 +84,7 @@ </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Library|Win32'"> <ClCompile> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <WarningLevel>TurnOffAllWarnings</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> @@ -99,7 +99,7 @@ </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>TurnOffAllWarnings</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <Optimization>Disabled</Optimization> @@ -156,7 +156,7 @@ </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DEBUGZLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/README.txt b/Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt index beb5fb8cb40..a53f1520f8e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/README.txt +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/README.txt @@ -1,9 +1,9 @@ -Makefiles for libpng version 1.5.4 - July 7, 2011 +Makefiles for libpng version 1.5.5 - September 22, 2011 pnglibconf.h.prebuilt => Stores configuration settings makefile.linux => Linux/ELF makefile - (gcc, creates libpng15.so.15.1.5.4) + (gcc, creates libpng15.so.15.1.5.5) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with ansi2knr (Requires ansi2knr.c from @@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings makefile.dec => DEC Alpha UNIX makefile makefile.dj2 => DJGPP 2 makefile makefile.elf => Linux/ELF makefile symbol versioning, - (gcc, creates libpng15.so.15.1.5.4) + (gcc, creates libpng15.so.15.1.5.5) makefile.freebsd => FreeBSD makefile makefile.gcc => Generic gcc makefile makefile.hpgcc => HPUX makefile using gcc @@ -35,12 +35,12 @@ pnglibconf.h.prebuilt => Stores configuration settings makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sggcc => Silicon Graphics (gcc, - creates libpng15.so.15.1.5.4) + creates libpng15.so.15.1.5.5) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.solaris => Solaris 2.X makefile (gcc, - creates libpng15.so.15.1.5.4) + creates libpng15.so.15.1.5.5) makefile.so9 => Solaris 9 makefile (gcc, - creates libpng15.so.15.1.5.4) + creates libpng15.so.15.1.5.5) makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.sunos => Sun makefile makefile.32sunu => Sun Ultra 32-bit makefile diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/SCOPTIONS.ppc b/Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc index 2c3503e9eb2..2c3503e9eb2 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/SCOPTIONS.ppc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/SCOPTIONS.ppc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/checksym.awk b/Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk index ba4c99b564d..ba4c99b564d 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/checksym.awk +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/checksym.awk diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/chkfmt b/Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt index 9da6475fd4e..9da6475fd4e 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/chkfmt +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/chkfmt diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/def.dfn b/Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn index d918d4c3c8b..d918d4c3c8b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/def.dfn +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/def.dfn diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/descrip.mms b/Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms index 99ea1abccd1..99ea1abccd1 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/descrip.mms +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/descrip.mms diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-body.in b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in index b466432d546..b466432d546 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-body.in +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-body.in diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-head.in b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in index a20e77e6abe..4694f6b33f3 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng-config-head.in +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng-config-head.in @@ -11,7 +11,7 @@ # Modeled after libxml-config. -version=1.5.4 +version=1.5.5 prefix="" libdir="" libs="" diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng.pc.in b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in index ba70c3f91f7..ec8f82da338 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/libpng.pc.in +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/libpng.pc.in @@ -5,6 +5,6 @@ includedir=@includedir@/libpng15 Name: libpng Description: Loads and saves PNG files -Version: 1.5.4 +Version: 1.5.5 Libs: -L${libdir} -lpng15 Cflags: -I${includedir} diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.32sunu b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu index b5e5a33a06f..b5e5a33a06f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.32sunu +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.32sunu diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.64sunu b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu index a0331d670e0..a0331d670e0 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.64sunu +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.64sunu diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.acorn b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn index 00b8fb5b35c..00b8fb5b35c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.acorn +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.acorn diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.aix b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix index bb4c40d4b0d..bb4c40d4b0d 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.aix +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.aix diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.amiga b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga index 228b5c22a75..228b5c22a75 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.amiga +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.amiga diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.atari b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari index 1aeb7d5b7dd..1aeb7d5b7dd 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.atari +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.atari diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bc32 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32 index ebbd5ce3d27..ebbd5ce3d27 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bc32 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bc32 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.beos b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos index 749db78ad32..749db78ad32 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.beos +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.beos diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bor b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor index 96d5e861a3a..96d5e861a3a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.bor +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.bor diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.cegcc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc index 57414dd4b88..ebf6c6d4f71 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.cegcc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.cegcc @@ -23,7 +23,7 @@ VERMAJ = 1 VERMIN = 5 -VERMIC = 4 +VERMIC = 5 VER = $(VERMAJ).$(VERMIN).$(VERMIC) NAME = libpng PACKAGE = $(NAME)-$(VER) diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.darwin b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin index aaec54dcb31..337a8151eb5 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.darwin +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.darwin @@ -37,10 +37,11 @@ MKDIR_P=mkdir -p LN_SF=ln -sf RANLIB=ranlib RM_F=/bin/rm -f +ARCH="-arch i386 -arch x86_64" # CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops -LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz +CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops $(ARCH) +LDFLAGS=-L. -L$(ZLIBLIB) -lpng15 -lz $(ARCH) INCPATH=$(prefix)/include LIBPATH=$(exec_prefix)/lib diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dec b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec index 5301d87d33e..5301d87d33e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dec +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dec diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dj2 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2 index 87a05a364ac..87a05a364ac 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.dj2 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.dj2 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.elf b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf index 5af43b18452..5af43b18452 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.elf +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.elf diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.freebsd b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd index 994608c993a..994608c993a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.freebsd +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.freebsd diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.gcc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc index 2e5b611367f..2e5b611367f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.gcc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.gcc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hp64 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64 index b5b631d11c7..b5b631d11c7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hp64 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hp64 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpgcc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc index 3fe21177a4c..3fe21177a4c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpgcc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpgcc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpux b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux index 650ab4f6621..650ab4f6621 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.hpux +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.hpux diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ibmc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc index 209d513b1cb..209d513b1cb 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ibmc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ibmc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.intel b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel index 1cb9ef37497..1cb9ef37497 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.intel +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.intel diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.knr b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr index 18a39f53755..18a39f53755 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.knr +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.knr diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.linux b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux index f91d4644420..df8a59db4f8 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.linux +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.linux @@ -10,7 +10,7 @@ # Library name: LIBNAME = libpng15 PNGMAJ = 15 -RELEASE = 4 +RELEASE = 5 # Shared library names: LIBSO=$(LIBNAME).so diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.mips b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips index 179d3850b69..179d3850b69 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.mips +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.mips diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.msc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc index baa863dad99..baa863dad99 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.msc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.msc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ne12bsd b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd index d69781cca0e..d6ed321d89a 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.ne12bsd +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.ne12bsd @@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15 LIB= png15 SHLIB_MAJOR= 0 -SHLIB_MINOR= 1.5.4 +SHLIB_MINOR= 1.5.5 SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.netbsd b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd index ad713c96e72..45c821b178b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.netbsd +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.netbsd @@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include LIB= png SHLIB_MAJOR= 15 -SHLIB_MINOR= 1.5.4 +SHLIB_MINOR= 1.5.5 SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.openbsd b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd index 5fd72518d37..9c12d606605 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.openbsd +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.openbsd @@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib MANDIR= ${PREFIX}/man/cat SHLIB_MAJOR= 15 -SHLIB_MINOR= 1.5.4 +SHLIB_MINOR= 1.5.5 LIB= png SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sco b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco index 0aad789a981..0aad789a981 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sco +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sco diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sggcc b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc index 1611638ba6c..1611638ba6c 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sggcc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sggcc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sgi b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi index 83db59f817e..83db59f817e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sgi +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sgi diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.so9 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9 index 615c2e34580..615c2e34580 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.so9 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.so9 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris index 24bd61033ce..24bd61033ce 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris-x86 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86 index 76467622a85..76467622a85 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.solaris-x86 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.solaris-x86 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.std b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std index 30e16464360..30e16464360 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.std +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.std diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sunos b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos index 383954987ee..383954987ee 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.sunos +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.sunos diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.tc3 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3 index 462c47fece9..462c47fece9 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.tc3 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.tc3 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.vcwin32 b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32 index 6bfeac03f7e..6bfeac03f7e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makefile.vcwin32 +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makefile.vcwin32 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/makevms.com b/Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com index f6c326103c2..f6c326103c2 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/makevms.com +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/makevms.com diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/options.awk b/Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk index 24f07137f18..24f07137f18 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/options.awk +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/options.awk diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.dfa b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa index dfa79651eec..07b7f6927a4 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.dfa +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.dfa @@ -267,10 +267,10 @@ option SET_USER_LIMITS enables SET_CHUNK_CACHE_LIMIT option SET_USER_LIMITS enables SET_CHUNK_MALLOC_LIMIT # Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter -# how large, set these two limits to 0x7fffffffL +# how large, set these two limits to 0x7fffffff -setting USER_WIDTH_MAX default 1000000L -setting USER_HEIGHT_MAX default 1000000L +setting USER_WIDTH_MAX default 1000000 +setting USER_HEIGHT_MAX default 1000000 # Added at libpng-1.2.43. To accept all valid PNGs no matter # how large, set these two limits to 0. diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.h.prebuilt b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt index 827d17e544c..8022a5a8814 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.h.prebuilt +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.h.prebuilt @@ -33,8 +33,8 @@ #define PNG_sCAL_PRECISION 5 #define PNG_USER_CHUNK_CACHE_MAX 0 #define PNG_USER_CHUNK_MALLOC_MAX 0 -#define PNG_USER_HEIGHT_MAX 1000000L -#define PNG_USER_WIDTH_MAX 1000000L +#define PNG_USER_HEIGHT_MAX 1000000 +#define PNG_USER_WIDTH_MAX 1000000 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 /* end of settings */ diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.mak b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak index 1509ee242ec..1509ee242ec 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/pnglibconf.mak +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/pnglibconf.mak diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/pngwin.rc b/Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc index 9335cbbe03b..9335cbbe03b 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/pngwin.rc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/pngwin.rc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/smakefile.ppc b/Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc index 2e7380b1f98..2e7380b1f98 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/smakefile.ppc +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/smakefile.ppc diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/sym.dfn b/Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn index 4b12ec2bf6e..4b12ec2bf6e 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/sym.dfn +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/sym.dfn diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.def b/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def index 487f2b43491..3d0e1e7f58f 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.def +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.def @@ -5,7 +5,7 @@ LIBRARY EXPORTS -;Version 1.5.4 +;Version 1.5.5 png_access_version_number @1 png_set_sig_bytes @2 png_sig_cmp @3 @@ -235,3 +235,7 @@ EXPORTS png_set_alpha_mode @227 png_set_alpha_mode_fixed @228 png_set_scale_16 @229 + png_get_cHRM_XYZ @230 + png_get_cHRM_XYZ_fixed @231 + png_set_cHRM_XYZ @232 + png_set_cHRM_XYZ_fixed @233 diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.dfn b/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn index d790929e7e7..d790929e7e7 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/symbols.dfn +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/symbols.dfn diff --git a/Build/source/libs/libpng/libpng-1.5.4/scripts/vers.dfn b/Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn index a4bf5c720ee..a4bf5c720ee 100644 --- a/Build/source/libs/libpng/libpng-1.5.4/scripts/vers.dfn +++ b/Build/source/libs/libpng/libpng-1.5.5/scripts/vers.dfn diff --git a/Build/source/libs/libpng/libpng-1.5.4/test-pngtest.sh b/Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh index 5d12f4acbd3..5d12f4acbd3 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/test-pngtest.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/test-pngtest.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-full.sh b/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh index d8c6faa23b4..d8c6faa23b4 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-full.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-full.sh diff --git a/Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-simple.sh b/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh index 9eb0c0a06e1..9eb0c0a06e1 100755 --- a/Build/source/libs/libpng/libpng-1.5.4/test-pngvalid-simple.sh +++ b/Build/source/libs/libpng/libpng-1.5.5/test-pngvalid-simple.sh |