mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
463 Commits
libpng-1.0
...
v1.2.41bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c099ea497a | ||
|
|
336b43d278 | ||
|
|
08e585d948 | ||
|
|
7aacd895ee | ||
|
|
3130af0e2b | ||
|
|
02a58af3c0 | ||
|
|
86645a3f19 | ||
|
|
edc3994cfd | ||
|
|
71f29b701d | ||
|
|
b4b853b4c5 | ||
|
|
d5483f3352 | ||
|
|
2522de8594 | ||
|
|
e5e60564cf | ||
|
|
bf2dabe6f1 | ||
|
|
70c873bcac | ||
|
|
5aabf5b8eb | ||
|
|
20e82ae2a2 | ||
|
|
e890cb118c | ||
|
|
275d1aa94e | ||
|
|
f748fda0ed | ||
|
|
87480bf6d4 | ||
|
|
bd6f1edea8 | ||
|
|
ed4c9fc4e9 | ||
|
|
8f8be84024 | ||
|
|
ead562ed05 | ||
|
|
8cf8726c7c | ||
|
|
b83df4e711 | ||
|
|
7e64470a71 | ||
|
|
fd3d717df5 | ||
|
|
d4ebb803fa | ||
|
|
5d276731e6 | ||
|
|
6dcfbc479d | ||
|
|
d8bf20d9ac | ||
|
|
38453101f0 | ||
|
|
8e46375186 | ||
|
|
c75d7fb32e | ||
|
|
6e0cf087ad | ||
|
|
af9a41d770 | ||
|
|
d6dc43db7d | ||
|
|
4c49647788 | ||
|
|
3de7bde0e1 | ||
|
|
dc38e24fed | ||
|
|
a61724c004 | ||
|
|
29b738b4e6 | ||
|
|
602d314ba0 | ||
|
|
a68974409c | ||
|
|
5d67107c79 | ||
|
|
da9b591621 | ||
|
|
2e8aa25844 | ||
|
|
6611322a8b | ||
|
|
948c6ee88d | ||
|
|
b7a9d80f28 | ||
|
|
277f6fbe49 | ||
|
|
e05080f5a8 | ||
|
|
4de250dd75 | ||
|
|
8f2f7f431c | ||
|
|
4f67b78853 | ||
|
|
4b14b35208 | ||
|
|
bc2ab12f99 | ||
|
|
c3166b2a48 | ||
|
|
1eef1e5b2f | ||
|
|
8191965555 | ||
|
|
f1c9244dfd | ||
|
|
58155a9921 | ||
|
|
5d398a69fb | ||
|
|
4560de58f4 | ||
|
|
7f9f605781 | ||
|
|
41cad5fbed | ||
|
|
e4f15b0f0e | ||
|
|
d4e3ef6eae | ||
|
|
eda90ace80 | ||
|
|
0c127348e1 | ||
|
|
eb6b59af64 | ||
|
|
11066e33f8 | ||
|
|
51a32d64d8 | ||
|
|
77a9f59487 | ||
|
|
1814c4e45b | ||
|
|
722f5fd8d4 | ||
|
|
e9c8dcf96c | ||
|
|
89e0d95883 | ||
|
|
aeb9906717 | ||
|
|
368971ec8b | ||
|
|
0112826daf | ||
|
|
9023e8f7bb | ||
|
|
48fac4e8ce | ||
|
|
edeccce619 | ||
|
|
60668aa210 | ||
|
|
455e8a4281 | ||
|
|
5d7fe7a718 | ||
|
|
64ca95e375 | ||
|
|
837eecbc91 | ||
|
|
26cc10a00c | ||
|
|
f12abe957d | ||
|
|
caaf688582 | ||
|
|
3dfd0cd62a | ||
|
|
18bd86f154 | ||
|
|
338f465019 | ||
|
|
ac13f5e6f9 | ||
|
|
1b6f6d80ea | ||
|
|
18b078414a | ||
|
|
f6ce318061 | ||
|
|
a21c94e3dc | ||
|
|
38b92d56e7 | ||
|
|
a08d95b971 | ||
|
|
339416b38b | ||
|
|
7e2f07486a | ||
|
|
a3e569cdda | ||
|
|
d68d8d82e6 | ||
|
|
997b4a544d | ||
|
|
176d2b622e | ||
|
|
3a9ab23713 | ||
|
|
9e88fcd58c | ||
|
|
39ffc1c3c7 | ||
|
|
69d0e44295 | ||
|
|
d2d5e540ac | ||
|
|
d7bd2d2b2c | ||
|
|
ddf5fc8a42 | ||
|
|
0841c63e0d | ||
|
|
a4d439b975 | ||
|
|
8de509a837 | ||
|
|
219760639a | ||
|
|
38ed8795ab | ||
|
|
55697d7dc9 | ||
|
|
a7fb782aea | ||
|
|
d91c64e428 | ||
|
|
4aa911abc6 | ||
|
|
64c72bb919 | ||
|
|
fec191d3cc | ||
|
|
7430bcbc44 | ||
|
|
eba11d2ba5 | ||
|
|
a3a724f805 | ||
|
|
a770d71890 | ||
|
|
1de866cd09 | ||
|
|
54380f53a2 | ||
|
|
7d870524d3 | ||
|
|
d28aad9a58 | ||
|
|
8be63adbc8 | ||
|
|
7d8f352e0a | ||
|
|
587382c0ba | ||
|
|
0f714ca6bc | ||
|
|
63da1df6fe | ||
|
|
bbe589da44 | ||
|
|
b278e91338 | ||
|
|
f2609e133d | ||
|
|
e14fdbbddb | ||
|
|
a162155919 | ||
|
|
4d7ae382a8 | ||
|
|
0c86eb2dc7 | ||
|
|
70c2db8b9f | ||
|
|
c1dd118d2c | ||
|
|
2d21d91abd | ||
|
|
e5ee05dc0d | ||
|
|
c0d53e176b | ||
|
|
b26d188190 | ||
|
|
0a6382e2af | ||
|
|
1214d8cd26 | ||
|
|
65a30ab0a2 | ||
|
|
61616abef2 | ||
|
|
bb1fcd1ba8 | ||
|
|
6d65121993 | ||
|
|
ecf0bffb79 | ||
|
|
af2ea0a1f2 | ||
|
|
286467db82 | ||
|
|
6b60a31ebf | ||
|
|
54028e5943 | ||
|
|
0c062e839d | ||
|
|
0fcbf05b6d | ||
|
|
f4276c36c9 | ||
|
|
ba05bddf92 | ||
|
|
7a63d75a83 | ||
|
|
da3f74a70e | ||
|
|
5f26656fc5 | ||
|
|
2f76e90d1a | ||
|
|
1296329f02 | ||
|
|
e38b432846 | ||
|
|
549a5101e7 | ||
|
|
031a8648cb | ||
|
|
a8476a8404 | ||
|
|
25c8491fc8 | ||
|
|
d0d637dd47 | ||
|
|
977c6bd44c | ||
|
|
89ad3aa168 | ||
|
|
55b921dab2 | ||
|
|
92d0fe938f | ||
|
|
d07e9b03c4 | ||
|
|
6cbd1cba68 | ||
|
|
3b8df1f143 | ||
|
|
85f7d0a8d5 | ||
|
|
556450a2ff | ||
|
|
6048b12510 | ||
|
|
8cafc1e1ac | ||
|
|
51807d7608 | ||
|
|
e104df5bb7 | ||
|
|
c6df7e5899 | ||
|
|
d0a4300dde | ||
|
|
d8865433f9 | ||
|
|
9c2bd642ba | ||
|
|
09883db208 | ||
|
|
f7f68f7160 | ||
|
|
31f744a8c0 | ||
|
|
bc66c96275 | ||
|
|
87c2acdeae | ||
|
|
6b90023764 | ||
|
|
e502bca962 | ||
|
|
c4d44b72e8 | ||
|
|
e7324bb94f | ||
|
|
8431b2c190 | ||
|
|
7d376ccd8c | ||
|
|
382410249d | ||
|
|
bfb5132362 | ||
|
|
4489dbc630 | ||
|
|
5c31bc8ffc | ||
|
|
baee5f46cf | ||
|
|
66ab7ffa15 | ||
|
|
32df7eb346 | ||
|
|
576b532b45 | ||
|
|
b520414d5a | ||
|
|
b54fd5c588 | ||
|
|
d9b4c01719 | ||
|
|
84d5d968a6 | ||
|
|
9c8717e42f | ||
|
|
3215e97b17 | ||
|
|
975e721432 | ||
|
|
b8bccdd081 | ||
|
|
4310a4d813 | ||
|
|
b96b342561 | ||
|
|
eb1cd11d57 | ||
|
|
a55c72890d | ||
|
|
247e230581 | ||
|
|
1586ea6fe9 | ||
|
|
ae505c50b0 | ||
|
|
fce1b4b1fb | ||
|
|
c6bcbf4951 | ||
|
|
6ed6086da5 | ||
|
|
9f7b16ad19 | ||
|
|
fc70a92071 | ||
|
|
ccaaab2898 | ||
|
|
8d36e630f2 | ||
|
|
eb1f347bca | ||
|
|
7db798186c | ||
|
|
a1cd94bfbb | ||
|
|
d9d2a6f6d9 | ||
|
|
b8c4b82d18 | ||
|
|
b8f615d7a1 | ||
|
|
35d97eb5c5 | ||
|
|
fc15b2e479 | ||
|
|
936df0d290 | ||
|
|
3236beddf8 | ||
|
|
c13f8f10e6 | ||
|
|
d8b530b93c | ||
|
|
2296f211e8 | ||
|
|
a5136b8863 | ||
|
|
913bc38217 | ||
|
|
4b7dca3d2c | ||
|
|
5c58e3ee31 | ||
|
|
49f304bd07 | ||
|
|
c95be42221 | ||
|
|
dbc07e13bb | ||
|
|
5ca40ebc22 | ||
|
|
a8e07274ae | ||
|
|
af99dba018 | ||
|
|
03dfa028d2 | ||
|
|
541b47ac2a | ||
|
|
507a35a9be | ||
|
|
1eddb5463e | ||
|
|
d91769efd4 | ||
|
|
134a8eb272 | ||
|
|
930be98598 | ||
|
|
28e3cb3e93 | ||
|
|
6328671ef8 | ||
|
|
fab1959d00 | ||
|
|
5ab788cd84 | ||
|
|
ce2a6d3739 | ||
|
|
40dd10dfb2 | ||
|
|
e41076e082 | ||
|
|
582fec4e11 | ||
|
|
42ae02aa08 | ||
|
|
79e3fc64c4 | ||
|
|
b188d671d1 | ||
|
|
5ecf1b53ea | ||
|
|
0636311d37 | ||
|
|
219d3b449f | ||
|
|
22eaa89c5a | ||
|
|
79e28a4c2e | ||
|
|
db05b1eb2b | ||
|
|
d20666a228 | ||
|
|
9cc7b03503 | ||
|
|
b38f12d519 | ||
|
|
e736f1ead9 | ||
|
|
b56c1f6023 | ||
|
|
268f0d64fc | ||
|
|
b3ea17736b | ||
|
|
963daeaec5 | ||
|
|
249bd44ebc | ||
|
|
04a1b1c123 | ||
|
|
3922e7afc3 | ||
|
|
f0a97a0d80 | ||
|
|
88713fd590 | ||
|
|
394759e0c8 | ||
|
|
c229f65dcf | ||
|
|
f929861609 | ||
|
|
f024ce7675 | ||
|
|
f3fcf00392 | ||
|
|
08313ef870 | ||
|
|
911c469d69 | ||
|
|
07c089ee04 | ||
|
|
dadc944810 | ||
|
|
80663032a9 | ||
|
|
67c75ee7f0 | ||
|
|
62626737a5 | ||
|
|
e404eed318 | ||
|
|
3c115428ea | ||
|
|
db40ca4aca | ||
|
|
f456d0d6bb | ||
|
|
06fe17eb9f | ||
|
|
7945bdb88f | ||
|
|
f7794ec181 | ||
|
|
16851b3eb3 | ||
|
|
c72d8d4d29 | ||
|
|
2b7436558e | ||
|
|
e59c47d5b1 | ||
|
|
c1523ad16d | ||
|
|
d0be8e27de | ||
|
|
5c66b81289 | ||
|
|
1a42cb2013 | ||
|
|
cf2978cbbb | ||
|
|
8a9733e777 | ||
|
|
ba880c5501 | ||
|
|
788f962fbd | ||
|
|
12f8283560 | ||
|
|
4d27f6b77b | ||
|
|
413ed28246 | ||
|
|
ad084f559a | ||
|
|
3832ab1c21 | ||
|
|
999bceb413 | ||
|
|
e8f6605642 | ||
|
|
3148c65323 | ||
|
|
0a3d2cc68b | ||
|
|
11cf76edb3 | ||
|
|
8833ad415c | ||
|
|
bc290d8e6c | ||
|
|
9c5b3a4060 | ||
|
|
04bbba55c7 | ||
|
|
40b70d5373 | ||
|
|
833d32646e | ||
|
|
6cdefb3cac | ||
|
|
f959d3ee7a | ||
|
|
b0952eabc7 | ||
|
|
43bb4ba4bf | ||
|
|
c2de22abeb | ||
|
|
a0113ee049 | ||
|
|
05db10fda3 | ||
|
|
948ee23a2a | ||
|
|
271a2931b6 | ||
|
|
9fe05edd47 | ||
|
|
c2573702cf | ||
|
|
b8e76b586e | ||
|
|
11a89964b9 | ||
|
|
b5bfcbae59 | ||
|
|
efe95a6953 | ||
|
|
e88a5eca8b | ||
|
|
2e3980e1de | ||
|
|
0ff85c6923 | ||
|
|
e3358d1839 | ||
|
|
f5eac0c7fa | ||
|
|
6034592a27 | ||
|
|
7b00d826d3 | ||
|
|
52ef3586b9 | ||
|
|
4118fcdd14 | ||
|
|
d9e18047d3 | ||
|
|
734f320ade | ||
|
|
79f25cdeb2 | ||
|
|
413f3db617 | ||
|
|
4db11d5143 | ||
|
|
78d28c6b96 | ||
|
|
24df7333a2 | ||
|
|
8694cd8bf5 | ||
|
|
f628ee2fa4 | ||
|
|
ad310547a2 | ||
|
|
629330e761 | ||
|
|
b511b60aaa | ||
|
|
77be22c09a | ||
|
|
b0270f77a9 | ||
|
|
3a5a759bb7 | ||
|
|
d5d63601b9 | ||
|
|
a7d0c94169 | ||
|
|
3a51203c48 | ||
|
|
4deeb795f6 | ||
|
|
26e47d9a71 | ||
|
|
170b70ce30 | ||
|
|
1ce0836b4a | ||
|
|
5c60b2367e | ||
|
|
b7f9593715 | ||
|
|
e64746200b | ||
|
|
c3d51c14f2 | ||
|
|
7b34df33a5 | ||
|
|
ddfebd35be | ||
|
|
9c3ab68145 | ||
|
|
917648ecb9 | ||
|
|
584b96e859 | ||
|
|
228c637527 | ||
|
|
c3dda6daea | ||
|
|
73b029f9d3 | ||
|
|
5dd2b8e208 | ||
|
|
4093607bc9 | ||
|
|
878b31e0b4 | ||
|
|
7806777139 | ||
|
|
94d9362fc5 | ||
|
|
16e11660fe | ||
|
|
250dfe1777 | ||
|
|
5b77916ecd | ||
|
|
67864af957 | ||
|
|
a4981d4ded | ||
|
|
37f116a900 | ||
|
|
8f3dd833d7 | ||
|
|
36d7bc7530 | ||
|
|
d029a75d4f | ||
|
|
dff799ef89 | ||
|
|
272489dc69 | ||
|
|
5fea36fb00 | ||
|
|
5b5dcf8b88 | ||
|
|
761bf9f06f | ||
|
|
c33ab4e8df | ||
|
|
0cc2f95a9d | ||
|
|
5ff38d3e16 | ||
|
|
865f4f073a | ||
|
|
51d9250c88 | ||
|
|
8a7df0024b | ||
|
|
859665d847 | ||
|
|
484a8a10fe | ||
|
|
2ae022da7e | ||
|
|
d020e9d826 | ||
|
|
d1e8c8694d | ||
|
|
07748d1b2c | ||
|
|
cfbed9bdf2 | ||
|
|
22f28966c4 | ||
|
|
837a3d1745 | ||
|
|
704228f7e7 | ||
|
|
299d73503c | ||
|
|
25d8224d15 | ||
|
|
03008a08d1 | ||
|
|
4fb046a52d | ||
|
|
fcbd7870e9 | ||
|
|
25228abdc1 | ||
|
|
73d57cb97b | ||
|
|
377657d1d6 | ||
|
|
c1bfe686ce | ||
|
|
c6de22da1d | ||
|
|
9c0f094b21 | ||
|
|
f50c91b7bd | ||
|
|
db3b88dad2 | ||
|
|
ae498dcff3 | ||
|
|
5cded0b4b5 | ||
|
|
3f549259b2 | ||
|
|
6c97ddbffc | ||
|
|
5a0be341ba | ||
|
|
10781048be | ||
|
|
1b8e567237 | ||
|
|
1ea0ff34fa | ||
|
|
b182893c04 | ||
|
|
8b6a889881 | ||
|
|
3097f618f2 | ||
|
|
1fd5fb33c2 |
156
ANNOUNCE
156
ANNOUNCE
@@ -1,56 +1,160 @@
|
|||||||
|
|
||||||
Libpng 1.0.65 - December 3, 2015
|
Libpng 1.2.41beta17 - November 10, 2009
|
||||||
|
|
||||||
This is a public release of libpng, intended for use in production codes.
|
This is not intended to be a public release. It will be replaced
|
||||||
|
within a few weeks by a public version or by another test version.
|
||||||
|
|
||||||
Files available for download:
|
Files available for download:
|
||||||
|
|
||||||
Source files with LF line endings (for Unix/Linux) and with a
|
Source files with LF line endings (for Unix/Linux) and with a
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
libpng-1.0.65.tar.xz (LZMA-compressed, recommended)
|
libpng-1.2.41beta17.tar.xz (LZMA-compressed, recommended)
|
||||||
libpng-1.0.65.tar.gz
|
libpng-1.2.41beta17.tar.gz
|
||||||
|
libpng-1.2.41beta17.tar.bz2
|
||||||
|
|
||||||
Source files with LF line endings (for Unix/Linux) without the
|
Source files with LF line endings (for Unix/Linux) without the
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
libpng-1.0.65-no-config.tar.xz (LZMA-compressed, recommended)
|
libpng-1.2.41beta17-no-config.tar.xz (LZMA-compressed, recommended)
|
||||||
libpng-1.0.65-no-config.tar.gz
|
libpng-1.2.41beta17-no-config.tar.gz
|
||||||
|
libpng-1.2.41beta17-no-config.tar.bz2
|
||||||
|
|
||||||
Source files with CRLF line endings (for Windows), without the
|
Source files with CRLF line endings (for Windows), without the
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
lpng1065.zip
|
lp1241b17.zip
|
||||||
lpng1065.7z
|
lp1241b17.7z
|
||||||
|
lp1241b17.tar.bz2
|
||||||
|
|
||||||
Project files
|
Project files
|
||||||
|
|
||||||
libpng-1.0.65-project-netware.zip
|
libpng-1.2.41beta17-project-netware.zip
|
||||||
libpng-1.0.65-project-wince.zip
|
libpng-1.2.41beta17-project-wince.zip
|
||||||
|
|
||||||
Other information:
|
Other information:
|
||||||
|
|
||||||
libpng-1.0.65-README.txt
|
libpng-1.2.41beta17-README.txt
|
||||||
libpng-1.0.65-KNOWNBUGS.txt
|
libpng-1.2.41beta17-KNOWNBUGS.txt
|
||||||
libpng-1.0.65-LICENSE.txt
|
libpng-1.2.41beta17-LICENSE.txt
|
||||||
libpng-1.0.65-Y2K-compliance.txt
|
libpng-1.2.41beta17-Y2K-compliance.txt
|
||||||
libpng-1.0.65-*.asc (armored detached GPG signatures)
|
libpng-1.2.41beta17-[previous version]-diff.txt
|
||||||
|
|
||||||
Changes since the last public release (1.0.64):
|
Changes since the last public release (1.2.40):
|
||||||
|
|
||||||
Avoid potential pointer overflow in png_handle_iTXt(), png_handle_zTXt(),
|
version 1.2.41beta01 [September 25, 2009]
|
||||||
png_handle_sPLT(), and png_handle_pCAL() (Bug report by John Regehr).
|
Moved redundant IHDR checking into new png_check_IHDR() in png.c
|
||||||
Fixed incorrect implementation of png_set_PLTE() that uses png_ptr
|
and report all errors found in the IHDR data.
|
||||||
not info_ptr, that left png_set_PLTE() open to the CVE-2015-8126
|
Eliminated useless call to png_check_cHRM() from pngset.c
|
||||||
vulnerability.
|
Expanded TAB characters in pngrtran.c
|
||||||
Discontinued distributing tar.bz2 archives.
|
|
||||||
Discontinued distributing libpng-oldversion-newversion-diff.txt
|
version 1.2.41beta02 [September 30, 2009]
|
||||||
|
Revised png_check_IHDR().
|
||||||
|
|
||||||
|
version 1.2.41beta03 [October 1, 2009]
|
||||||
|
Revised png_check_IHDR() again, to check info_ptr members instead of
|
||||||
|
the contents of the returned parameters.
|
||||||
|
|
||||||
|
version 1.2.41beta04 [October 7, 2009]
|
||||||
|
Added "xcode" project similar one already in libpng-1.4.0beta (Alam Arias).
|
||||||
|
Ported some cosmetic changes from libpng-1.4.0beta86.
|
||||||
|
Eliminated a shadowed declaration of "pp" in png_handle_sPLT().
|
||||||
|
|
||||||
|
version 1.2.41beta05 [October 17, 2009]
|
||||||
|
Revised pngconf.h to make it easier to enable iTXt support. From libpng
|
||||||
|
version 1.2.9 through 1.2.40, defining PNG_iTXt_SUPPORTED did not work
|
||||||
|
as expected.
|
||||||
|
Ported some cosmetic changes from libpng-1.4.0beta87, changing
|
||||||
|
many "#if defined(x)" to "#ifdef x".
|
||||||
|
|
||||||
|
version 1.2.41beta06 [October 18, 2009]
|
||||||
|
Restored PNG_USE_LOCAL_ARRAYS code in pngread.c that was inadvertently
|
||||||
|
deleted in libpng-1.2.41beta05.
|
||||||
|
Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h
|
||||||
|
as in libpng-1.4.0beta78 and later.
|
||||||
|
|
||||||
|
version 1.2.41beta07 [October 21, 2009]
|
||||||
|
Ported some cosmetic changes from libpng-1.4.0rc01, changing
|
||||||
|
many "#if defined(x)" to "#ifdef x" in png.h and pngconf.h.
|
||||||
|
|
||||||
|
version 1.2.41beta08 [October 30, 2009]
|
||||||
|
Ported from libpng-1.4.0rc01: png_calloc(), png_get_io_chunk_name(),
|
||||||
|
png_get_io_state(), png_set_user_cache_max(), png_get_user_cache_max(),
|
||||||
|
png_set_premultiply_alpha, and png_do_read_premultiply_alpha().
|
||||||
|
Relocated png_do_chop() ahead of building gamma tables in pngrtran.c
|
||||||
|
This avoids building 16-bit gamma tables unnecessarily.
|
||||||
|
|
||||||
|
version 1.2.41beta09 [November 1, 2009]
|
||||||
|
Removed a harmless extra png_set_invert_alpha() from pngwrite.c
|
||||||
|
More bugfixes and improvements to CMakeLists.txt (Philip Lowman)
|
||||||
|
Moved CMakeLists.txt from scripts into the main libpng directory.
|
||||||
|
Apply png_user_chunk_cache_max within png_decompress_chunk().
|
||||||
|
Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate.
|
||||||
|
|
||||||
|
version 1.2.41beta10 [November 1, 2009]
|
||||||
|
Enabled iTXt support by default. To ensure binary compatibility with
|
||||||
|
previous versions, the "lang" and "lang_key" members will be assumed
|
||||||
|
to be omitted from previous versions unless the current libpng
|
||||||
|
version was built with PNG_iTXt_SUPPORTED (which is otherwise no
|
||||||
|
longer necessary to gain iTXt support), as a signal that the user has
|
||||||
|
been building previous versions with PNG_iTXt_SUPPORTED as well.
|
||||||
|
|
||||||
|
version 1.2.41beta11 [November 2, 2009]
|
||||||
|
Store user's user_png_ver in new png_ptr->user_png_ver element.
|
||||||
|
Revised iTXt support. To ensure binary compatibility with
|
||||||
|
previous versions, the "lang" and "lang_key" members will be assumed
|
||||||
|
to be omitted from versions prior to 1.2.41beta11 whenever there is a
|
||||||
|
library mismatch.
|
||||||
|
|
||||||
|
version 1.2.41beta12 [November 2, 2009]
|
||||||
|
Free png_ptr->user_png_ver when destroying png_ptr.
|
||||||
|
|
||||||
|
version 1.2.41beta13 [November 3, 2009]
|
||||||
|
Updated scripts/pngw32.def and projects/wince/png32ce.def
|
||||||
|
Copied projects/wince/png32ce.def to the scripts directory.
|
||||||
|
Added scripts/makefile.wce
|
||||||
|
Patched ltmain.sh for wince support.
|
||||||
|
Added PNG_CONVERT_tIME_SUPPORTED macro.
|
||||||
|
|
||||||
|
version 1.2.41beta14 [November 8, 2009]
|
||||||
|
versions 1.2.41beta05 through 1.2.41beta13 were abandoned.
|
||||||
|
Make inclusion of time.h in pngconf.h depend on PNG_CONVERT_tIME_SUPPORTED
|
||||||
|
Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED
|
||||||
|
Reverted iTXt compatibility stuff from 1.2.41beta05, 1.2.41beta11, and
|
||||||
|
1.2.41beta12.
|
||||||
|
Reverted IOSTATE feature, user_cache_max, and premultiply_alpha features
|
||||||
|
from 1.2.41beta08.
|
||||||
|
Retained png_calloc() from 1.2.41beta08 but as a non-exported function,
|
||||||
|
and removed reference to png_calloc from scripts/*.def
|
||||||
|
|
||||||
|
version 1.2.41beta15 [November 8, 2009]
|
||||||
|
Added PNG_DEPSTRUCT, PNG_DEPRECATED, PNG_USE_RESULT, PNG_NORETURN, and
|
||||||
|
PNG_ALLOCATED macros to detect deprecated direct access to the
|
||||||
|
png_struct or info_struct members and other deprecated usage in
|
||||||
|
applications (John Bowler).
|
||||||
|
Updated scripts/makefile* to add "-DPNG_CONFIGURE_LIBPNG" to CFLAGS,
|
||||||
|
to prevent warnings about direct access to png structs by libpng
|
||||||
|
functions while building libpng. They need to be tested, especially
|
||||||
|
those using compilers other than gcc.
|
||||||
|
Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
|
||||||
|
|
||||||
|
version 1.2.41beta16 [November 9, 2009]
|
||||||
|
Removed three direct references to read_info_ptr members in pngtest.c
|
||||||
|
that were detected by the new PNG_DEPSTRUCT macro.
|
||||||
|
Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
|
||||||
|
|
||||||
|
version 1.2.41beta17 [November 10, 2009]
|
||||||
|
Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions.
|
||||||
|
Marked deprecated function prototypes with PNG_DEPRECATED.
|
||||||
|
Marked memory allocation function prototypes with PNG_ALLOCATED.
|
||||||
|
Changed png_check_sig() to !png_sig_cmp() in contrib programs.
|
||||||
|
Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c
|
||||||
|
Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
|
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
to subscribe)
|
to subscribe) or to glennrp at users.sourceforge.net
|
||||||
or to glennrp at users.sourceforge.net
|
|
||||||
|
|
||||||
Glenn R-P
|
Glenn R-P
|
||||||
#endif
|
|
||||||
|
|||||||
368
CHANGES
368
CHANGES
@@ -1,14 +1,11 @@
|
|||||||
#if 0
|
/*
|
||||||
CHANGES - changes for libpng
|
CHANGES - changes for libpng
|
||||||
|
|
||||||
version 0.1 [March 29, 1995]
|
version 0.2
|
||||||
initial beta release
|
|
||||||
|
|
||||||
version 0.2 [April 1, 1995]
|
|
||||||
added reader into png.h
|
added reader into png.h
|
||||||
fixed small problems in stub file
|
fixed small problems in stub file
|
||||||
|
|
||||||
version 0.3 [April 8, 1995]
|
version 0.3
|
||||||
added pull reader
|
added pull reader
|
||||||
split up pngwrite.c to several files
|
split up pngwrite.c to several files
|
||||||
added pnglib.txt
|
added pnglib.txt
|
||||||
@@ -19,7 +16,7 @@ version 0.3 [April 8, 1995]
|
|||||||
added K&R support
|
added K&R support
|
||||||
added check for 64 KB blocks for 16 bit machines
|
added check for 64 KB blocks for 16 bit machines
|
||||||
|
|
||||||
version 0.4 [April 26, 1995]
|
version 0.4
|
||||||
cleaned up code and commented code
|
cleaned up code and commented code
|
||||||
simplified time handling into png_time
|
simplified time handling into png_time
|
||||||
created png_color_16 and png_color_8 to handle color needs
|
created png_color_16 and png_color_8 to handle color needs
|
||||||
@@ -30,29 +27,28 @@ version 0.4 [April 26, 1995]
|
|||||||
cleaned up zTXt reader and writer (using zlib's Reset functions)
|
cleaned up zTXt reader and writer (using zlib's Reset functions)
|
||||||
split transformations into pngrtran.c and pngwtran.c
|
split transformations into pngrtran.c and pngwtran.c
|
||||||
|
|
||||||
version 0.5 [April 30, 1995]
|
version 0.5
|
||||||
interfaced with zlib 0.8
|
interfaced with zlib 0.8
|
||||||
fixed many reading and writing bugs
|
fixed many reading and writing bugs
|
||||||
saved using 3 spaces instead of tabs
|
saved using 3 spaces instead of tabs
|
||||||
|
|
||||||
version 0.6 [May 1, 1995]
|
version 0.6
|
||||||
first beta release
|
|
||||||
added png_large_malloc() and png_large_free()
|
added png_large_malloc() and png_large_free()
|
||||||
added png_size_t
|
added png_size_t
|
||||||
cleaned up some compiler warnings
|
cleaned up some compiler warnings
|
||||||
added png_start_read_image()
|
added png_start_read_image()
|
||||||
|
|
||||||
version 0.7 [June 24, 1995]
|
version 0.7
|
||||||
cleaned up lots of bugs
|
cleaned up lots of bugs
|
||||||
finished dithering and other stuff
|
finished dithering and other stuff
|
||||||
added test program
|
added test program
|
||||||
changed name from pnglib to libpng
|
changed name from pnglib to libpng
|
||||||
|
|
||||||
version 0.71 [June 26, 1995]
|
version 0.71 [June, 1995]
|
||||||
changed pngtest.png for zlib 0.93
|
changed pngtest.png for zlib 0.93
|
||||||
fixed error in libpng.txt and example.c
|
fixed error in libpng.txt and example.c
|
||||||
|
|
||||||
version 0.8 [August 20, 1995]
|
version 0.8
|
||||||
cleaned up some bugs
|
cleaned up some bugs
|
||||||
added png_set_filler()
|
added png_set_filler()
|
||||||
split up pngstub.c into pngmem.c, pngio.c, and pngerror.c
|
split up pngstub.c into pngmem.c, pngio.c, and pngerror.c
|
||||||
@@ -469,7 +465,7 @@ version 1.0.3d [September 4, 1999]
|
|||||||
Added new png_expand functions to scripts/pngdef.pas and pngos2.def
|
Added new png_expand functions to scripts/pngdef.pas and pngos2.def
|
||||||
Added a demo read_user_transform_fn that examines the row filters in pngtest.c
|
Added a demo read_user_transform_fn that examines the row filters in pngtest.c
|
||||||
|
|
||||||
Version 1.0.4 [September 24, 1999, not distributed publicly]
|
version 1.0.4 [September 24, 1999]
|
||||||
Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined
|
Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined
|
||||||
Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h
|
Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h
|
||||||
Made several minor corrections to pngtest.c
|
Made several minor corrections to pngtest.c
|
||||||
@@ -493,7 +489,6 @@ version 1.0.4c [October 1, 1999]
|
|||||||
Added a "png_check_version" function in png.c and pngtest.c that will generate
|
Added a "png_check_version" function in png.c and pngtest.c that will generate
|
||||||
a helpful compiler error if an old png.h is found in the search path.
|
a helpful compiler error if an old png.h is found in the search path.
|
||||||
Changed type of png_user_transform_depth|channels from int to png_byte.
|
Changed type of png_user_transform_depth|channels from int to png_byte.
|
||||||
Added "Libpng is OSI Certified Open Source Software" statement to png.h
|
|
||||||
version 1.0.4d [October 6, 1999]
|
version 1.0.4d [October 6, 1999]
|
||||||
Changed 0.45 to 0.45455 in png_set_sRGB()
|
Changed 0.45 to 0.45455 in png_set_sRGB()
|
||||||
Removed unused PLTE entries from pngnow.png
|
Removed unused PLTE entries from pngnow.png
|
||||||
@@ -983,16 +978,21 @@ version 1.2.0beta1 [May 6, 2001]
|
|||||||
Bumped DLLNUM to 2.
|
Bumped DLLNUM to 2.
|
||||||
Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED
|
Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
by default.
|
by default.
|
||||||
|
Added runtime selection of MMX features.
|
||||||
|
Added png_set_strip_error_numbers function and related macros.
|
||||||
version 1.2.0beta2 [May 7, 2001]
|
version 1.2.0beta2 [May 7, 2001]
|
||||||
Finished merging 1.2.0beta1 with version 1.0.11
|
Finished merging 1.2.0beta1 with version 1.0.11
|
||||||
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
|
||||||
version 1.2.0beta3 [May 17, 2001]
|
version 1.2.0beta3 [May 17, 2001]
|
||||||
|
Enabled user memory function by default.
|
||||||
Modified png_create_struct so it passes user mem_ptr to user memory allocator.
|
Modified png_create_struct so it passes user mem_ptr to user memory allocator.
|
||||||
Increased png_mng_features flag from png_byte to png_uint_32.
|
Increased png_mng_features flag from png_byte to png_uint_32.
|
||||||
version 1.0.12 [June 8, 2001]
|
Bumped shared-library (so-number) and dll-number to 3.
|
||||||
version 1.2.0beta4 [June 23, 2001]
|
version 1.2.0beta4 [June 23, 2001]
|
||||||
Check for missing profile length field in iCCP chunk and free chunk_data
|
Check for missing profile length field in iCCP chunk and free chunk_data
|
||||||
in case of truncated iCCP chunk.
|
in case of truncated iCCP chunk.
|
||||||
|
Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc
|
||||||
|
Bumped dll-number from 2 to 3 in makefile.cygwin
|
||||||
Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly
|
Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly
|
||||||
if user attempts to run it on an 8-bit display.
|
if user attempts to run it on an 8-bit display.
|
||||||
Updated contrib/gregbook
|
Updated contrib/gregbook
|
||||||
@@ -1071,6 +1071,7 @@ version 1.2.2beta3 [March 7, 2002]
|
|||||||
Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
|
Modified shared-library makefiles to install pkgconfig/libpngNN.pc.
|
||||||
Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
|
Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown
|
||||||
Removed unused png_write_destroy_info prototype from png.h
|
Removed unused png_write_destroy_info prototype from png.h
|
||||||
|
Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case
|
||||||
Added install-shared target to all makefiles that make shared libraries.
|
Added install-shared target to all makefiles that make shared libraries.
|
||||||
Stopped a double free of palette, hist, and trans when not using free_me.
|
Stopped a double free of palette, hist, and trans when not using free_me.
|
||||||
Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
|
Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64.
|
||||||
@@ -1265,6 +1266,8 @@ version 1.2.6beta3 [July 18, 2004]
|
|||||||
Updated scripts/makefile.vc(a)win32 (Cosmin).
|
Updated scripts/makefile.vc(a)win32 (Cosmin).
|
||||||
Updated the MSVC project (Simon-Pierre, Cosmin).
|
Updated the MSVC project (Simon-Pierre, Cosmin).
|
||||||
Updated the Borland C++ Builder project (Cosmin).
|
Updated the Borland C++ Builder project (Cosmin).
|
||||||
|
Avoided access to asm_flags in pngvcrd.c, if PNG_1_0_X is defined (Cosmin).
|
||||||
|
Commented out warning about uninitialized mmx_support in pngvcrd.c (Cosmin).
|
||||||
Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin).
|
Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin).
|
||||||
Added extra guard around inclusion of Turbo C memory headers, in pngconf.h
|
Added extra guard around inclusion of Turbo C memory headers, in pngconf.h
|
||||||
(Cosmin).
|
(Cosmin).
|
||||||
@@ -1301,9 +1304,8 @@ version 1.2.6beta4 [July 28, 2004]
|
|||||||
Removed some redundancy with #ifdef/#endif in png_malloc_default().
|
Removed some redundancy with #ifdef/#endif in png_malloc_default().
|
||||||
Use png_malloc instead of png_zalloc to allocate the pallete.
|
Use png_malloc instead of png_zalloc to allocate the pallete.
|
||||||
version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004]
|
version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004]
|
||||||
Fixed buffer overflow vulnerability (CVE-2004-0597) in png_handle_tRNS().
|
Fixed buffer overflow vulnerability in png_handle_tRNS()
|
||||||
Fixed NULL dereference vulnerability (CVE-2004-0598) in png_handle_iCCP().
|
Fixed integer arithmetic overflow vulnerability in png_read_png().
|
||||||
Fixed integer overflow vulnerability (CVE-2004-0599) in png_read_png().
|
|
||||||
Fixed some harmless bugs in png_handle_sBIT, etc, that would cause
|
Fixed some harmless bugs in png_handle_sBIT, etc, that would cause
|
||||||
duplicate chunk types to go undetected.
|
duplicate chunk types to go undetected.
|
||||||
Fixed some timestamps in the -config version
|
Fixed some timestamps in the -config version
|
||||||
@@ -1357,6 +1359,7 @@ version 1.2.7beta2 [August 28, 2004]
|
|||||||
Fixed bug with sCAL chunk and big-endian machines (David Munro).
|
Fixed bug with sCAL chunk and big-endian machines (David Munro).
|
||||||
Undid new code added in 1.2.6rc2 to update the color_type in
|
Undid new code added in 1.2.6rc2 to update the color_type in
|
||||||
png_set_filler().
|
png_set_filler().
|
||||||
|
Added png_set_add_alpha() that updates color type.
|
||||||
version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004]
|
version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004]
|
||||||
Revised png_set_strip_filler() to not remove alpha if color_type has alpha.
|
Revised png_set_strip_filler() to not remove alpha if color_type has alpha.
|
||||||
|
|
||||||
@@ -1367,6 +1370,7 @@ version 1.2.8beta1 [November 1, 2004]
|
|||||||
Fixed bug in png_text_compress() that would fail to complete a large block.
|
Fixed bug in png_text_compress() that would fail to complete a large block.
|
||||||
Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during
|
Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during
|
||||||
strip alpha operation in png_do_strip_filler().
|
strip alpha operation in png_do_strip_filler().
|
||||||
|
Added PNG_1_2_X definition in pngconf.h
|
||||||
Comment out with #ifdef/#endif png_info_init in png.c and png_read_init
|
Comment out with #ifdef/#endif png_info_init in png.c and png_read_init
|
||||||
in pngread.c (as of 1.3.0)
|
in pngread.c (as of 1.3.0)
|
||||||
version 1.2.8beta2 [November 2, 2004]
|
version 1.2.8beta2 [November 2, 2004]
|
||||||
@@ -1408,7 +1412,7 @@ version 1.2.8rc4 [November 29, 2004]
|
|||||||
version 1.2.8rc5 [November 29, 2004]
|
version 1.2.8rc5 [November 29, 2004]
|
||||||
Fixed new typo in scripts/pngw32.rc
|
Fixed new typo in scripts/pngw32.rc
|
||||||
|
|
||||||
version 1.0.18, 1.2.8 [December 3, 2004]
|
version 1.2.8 [December 3, 2004]
|
||||||
Removed projects/visualc7, added projects/visualc71.
|
Removed projects/visualc7, added projects/visualc71.
|
||||||
|
|
||||||
version 1.2.9beta1 [February 21, 2006]
|
version 1.2.9beta1 [February 21, 2006]
|
||||||
@@ -1474,7 +1478,7 @@ version 1.2.9beta5 [March 4, 2006]
|
|||||||
Removed trailing blanks from source files.
|
Removed trailing blanks from source files.
|
||||||
Put version and date of latest change in each source file, and changed
|
Put version and date of latest change in each source file, and changed
|
||||||
copyright year accordingly.
|
copyright year accordingly.
|
||||||
More cleanup of configure.ac, Makefile.am, and associated scripts.
|
More cleanup of configure.ac, Makefile.ac, and associated scripts.
|
||||||
Restored scripts/makefile.elf which was inadvertently deleted.
|
Restored scripts/makefile.elf which was inadvertently deleted.
|
||||||
|
|
||||||
version 1.2.9beta6 [March 6, 2006]
|
version 1.2.9beta6 [March 6, 2006]
|
||||||
@@ -2578,326 +2582,6 @@ version 1.2.41beta17 [November 10, 2009]
|
|||||||
Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c
|
Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c
|
||||||
Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles.
|
Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles.
|
||||||
|
|
||||||
version 1.2.41beta18 [November 11, 2009]
|
|
||||||
Renamed scripts/makefile.wce to scripts/makefile.cegcc
|
|
||||||
Marked nonexported functions with PNG_PRIVATE macro.
|
|
||||||
|
|
||||||
version 1.2.41rc01 and 1.0.51rc01 [November 18, 2009]
|
|
||||||
Revised scripts/*.def to reflect functions actually exported by libpng.
|
|
||||||
Updated the copyright year in scripts/pngw32.rc from 2004 to 2009.
|
|
||||||
Moved descriptions of makefiles and other scripts out of INSTALL into
|
|
||||||
scripts/README.txt
|
|
||||||
|
|
||||||
version 1.2.41rc02 [November 22, 2009]
|
|
||||||
Rebuilt the configure scripts with autoconf-2.65
|
|
||||||
|
|
||||||
version 1.2.41rc03 [November 25, 2009]
|
|
||||||
Disabled the new pedantic warnings about deprecated function use
|
|
||||||
and deprecated structure access unless the user defines
|
|
||||||
PNG_PEDANTIC_WARNINGS.
|
|
||||||
Added "#define PNG_NO_PEDANTIC_WARNINGS" in the libpng source files.
|
|
||||||
Removed "-DPNG_CONFIGURE_LIBPNG" from the makefiles and projects.
|
|
||||||
|
|
||||||
version 1.2.41 and 1.0.51 [December 3, 2009]
|
|
||||||
Updated the list of files and made some cosmetic changes in README.
|
|
||||||
|
|
||||||
version 1.2.42beta01 [December 4, 2009]
|
|
||||||
Removed "#define PNG_NO_ERROR_NUMBERS" that was inadvertently added
|
|
||||||
to pngconf.h in version 1.2.41.
|
|
||||||
Revised scripts/makefile.netbsd, makefile.openbsd, and makefile.sco
|
|
||||||
to put png.h and pngconf.h in $prefix/include, like the other scripts,
|
|
||||||
instead of in $prefix/include/libpng. Also revised makefile.sco
|
|
||||||
to put them in $prefix/include/libpng10 instead of in
|
|
||||||
$prefix/include/libpng/libpng10.
|
|
||||||
Removed leftover "-DPNG_CONFIGURE_LIBPNG" from scripts/makefile.darwin
|
|
||||||
|
|
||||||
version 1.2.42beta02 [December 11, 2009]
|
|
||||||
Removed leftover "-DPNG_CONFIGURE_LIBPNG" from contrib/pngminim/*/makefile
|
|
||||||
Relocated png_do_chop() to its original position in pngrtran.c. The
|
|
||||||
change in version 1.2.41beta08 caused transparency to be handled wrong
|
|
||||||
in some 16-bit datastreams (Yusaku Sugai).
|
|
||||||
|
|
||||||
version 1.2.42rc01 [December 17, 2009]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.42rc02 [December 22, 2009]
|
|
||||||
Renamed libpng-pc.in back to libpng.pc.in and revised CMakeLists.txt
|
|
||||||
(revising changes made in 1.2.41beta17 and 1.2.41rc01)
|
|
||||||
|
|
||||||
version 1.2.42rc03 [December 25, 2009]
|
|
||||||
Swapped PNG_UNKNOWN_CHUNKS_SUPPORTED and PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
|
||||||
in pngset.c to be consistent with other changes in version 1.2.38.
|
|
||||||
|
|
||||||
version 1.2.42rc04 [January 1, 2010]
|
|
||||||
Marked png_memcpy_check() and png_memset_check() PNG_DEPRECATED.
|
|
||||||
Updated copyright year.
|
|
||||||
|
|
||||||
version 1.2.42rc05 [January 2, 2010]
|
|
||||||
Avoid deprecated references to png_ptr-io_ptr and png_ptr->error_ptr
|
|
||||||
in pngtest.c
|
|
||||||
|
|
||||||
version 1.2.42 and 1.0.52 [January 3, 2010]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.43beta01 [January 27, 2010]
|
|
||||||
Updated CMakeLists.txt for consistent indentation and to avoid an
|
|
||||||
unclosed if-statement warning (Philip Lowman).
|
|
||||||
Removed "#ifdef PNG_1_0_X / #endif" surrounding
|
|
||||||
PNG_READ_16_TO_8_SUPPORTED and PNG_READ_GRAY_TO_RGB_SUPPORTED
|
|
||||||
in pngconf.h. These were added in libpng-1.2.41beta08 and libpng-1.0.51,
|
|
||||||
which introduced a binary incompatibility with libpng-1.0.50.
|
|
||||||
Backported new png_decompress_chunk() algorithm from libpng-1.4.1.
|
|
||||||
|
|
||||||
version 1.2.43beta02 [February 1, 2010]
|
|
||||||
Backported two-pass png_decompress_chunk() algorithm from libpng-1.4.1.
|
|
||||||
|
|
||||||
version 1.2.43beta03 [February 6, 2010]
|
|
||||||
Backported fast png_push_save_buffer() algorithm from libpng-1.4.1.
|
|
||||||
Backported some cosmetic changes from libpng-1.4.1.
|
|
||||||
|
|
||||||
version 1.2.43beta04 [February 8, 2010]
|
|
||||||
Reverted recent changes to png_push_save-buffer().
|
|
||||||
Removed PNGAPI declaration of png_calloc() and png_write_sig() in
|
|
||||||
1ibpng-1.2.X, introduced by mistake in libpng-1.2.41.
|
|
||||||
Return allocated "old_buffer" in png_push_save_buffer() before png_error()
|
|
||||||
to avoid a potential memory leak.
|
|
||||||
|
|
||||||
version 1.2.43beta05 [February 8, 2010]
|
|
||||||
Ported rewritten png_decompress_chunk() by John Bowler from libpng-1.4.1.
|
|
||||||
|
|
||||||
version 1.0.53rc01 and 1.2.43rc01 [February 18, 2010]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.0.53rc02 and 1.2.43rc02 [February 19, 2010]
|
|
||||||
Define _ALL_SOURCE in configure.ac, makefile.aix, and CMakeLists.txt
|
|
||||||
when using AIX compiler.
|
|
||||||
|
|
||||||
version 1.0.53 and 1.2.43 [February 25, 2010]
|
|
||||||
Removed unused gzio.c from contrib/pngminim gather and makefile scripts
|
|
||||||
|
|
||||||
version 1.2.44beta01 [June 18, 2010]
|
|
||||||
In pngpread.c: png_push_have_row() add check for new_row > height
|
|
||||||
Removed the now-redundant check for out-of-bounds new_row from example.c
|
|
||||||
|
|
||||||
version 1.2.44beta02 [June 19, 2010]
|
|
||||||
In pngpread.c: png_push_process_row() add check for too many rows.
|
|
||||||
Removed the now-redundant check for new_row > height in png_push_have_row().
|
|
||||||
|
|
||||||
version 1.2.44beta03 [June 20, 2010]
|
|
||||||
Rewrote png_process_IDAT_data() to consistently treat extra data as warnings
|
|
||||||
and handle end conditions more cleanly.
|
|
||||||
Removed the new (beta02) check in png_push_process_row().
|
|
||||||
|
|
||||||
version 1.2.44rc01 [June 21, 2010]
|
|
||||||
Revised some comments in png_process_IDAT_data().
|
|
||||||
|
|
||||||
version 1.2.44rc02 [June 22, 2010]
|
|
||||||
Stop memory leak when reading a malformed sCAL chunk.
|
|
||||||
|
|
||||||
version 1.2.44rc03 [June 23, 2010]
|
|
||||||
Revised pngpread.c patch of beta05 to avoid an endless loop.
|
|
||||||
|
|
||||||
version 1.2.44 [June 26, 2010]
|
|
||||||
Updated some of the "last changed" dates.
|
|
||||||
|
|
||||||
version 1.2.45beta01 [June 7, 2011]
|
|
||||||
Fixed uninitialized memory read in png_format_buffer() (Bug
|
|
||||||
report by Frank Busse, related to CVE-2004-0421).
|
|
||||||
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
|
|
||||||
was introduced in libpng-1.2.20beta01.
|
|
||||||
Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
|
|
||||||
before IDAT.
|
|
||||||
Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image,
|
|
||||||
always expand to RGBA if transparency is present.
|
|
||||||
|
|
||||||
version 1.2.45beta02 [June 8, 2011]
|
|
||||||
Check for integer overflow in png_set_rgb_to_gray().
|
|
||||||
|
|
||||||
version 1.2.45beta03 [June 19, 2011]
|
|
||||||
Check for sCAL chunk too short.
|
|
||||||
|
|
||||||
version 1.2.45rc01 and 1.0.55rc01 [June 30, 2011]
|
|
||||||
Updated "last changed" dates and copyright year.
|
|
||||||
|
|
||||||
version 1.2.45 and 1.0.55 [July 7, 2011]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.46rc01 and 1.0.56rc01 [July 8, 2011]
|
|
||||||
Reverted changes to Makefile.am and Makefile.in to libpng-1.2.44 versions.
|
|
||||||
|
|
||||||
version 1.2.46rc02 and 1.0.56rc02 [July 8, 2011]
|
|
||||||
Added CMakeLists.txt, projects/xcode, and pnggccrd.c to EXTRA_DIST in
|
|
||||||
Makefile.am and Makefile.in
|
|
||||||
|
|
||||||
version 1.2.46 and 1.0.56 [July 9, 2011]
|
|
||||||
Udated copyright year to 2011.
|
|
||||||
|
|
||||||
version 1.2.47beta01 [February 17, 2012]
|
|
||||||
Updated contrib/pngminus/makefile.std (Samuli Souminen)
|
|
||||||
|
|
||||||
version 1.0.57rc01 and 1.2.47rc01 [February 17, 2012]
|
|
||||||
Fixed CVE-2011-3026 buffer overrun bug. This bug was introduced when
|
|
||||||
iCCP chunk support was added at libpng-1.0.6.
|
|
||||||
|
|
||||||
version 1.0.57 and 1.2.47 [February 18, 2012]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.48beta01 [February 27, 2012]
|
|
||||||
Removed two useless #ifdef directives from pngread.c and one from pngrutil.c
|
|
||||||
Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
|
|
||||||
pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
|
|
||||||
now that png_ptr->buffer is inaccessible to applications, the special
|
|
||||||
handling is no longer useful.
|
|
||||||
Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
|
|
||||||
Fixed incorrect type (int copy should be png_size_t copy) in png_inflate().
|
|
||||||
Fixed off-by-one bug in png_handle_sCAL() when using fixed point arithmetic,
|
|
||||||
causing out-of-bounds read in png_set_sCAL() because of failure to copy
|
|
||||||
the string terminators. This bug was introduced in libpng-1.0.6 (Frank
|
|
||||||
Busse).
|
|
||||||
|
|
||||||
version 1.2.48rc01 [March 2, 2012]
|
|
||||||
Removed the png_free() of unused png_ptr->current_text from pngread.c.
|
|
||||||
Added libpng license text to pnggccrd.c and pngvcrd.c (requested by Chrome).
|
|
||||||
|
|
||||||
version 1.2.48rc02 [March 2, 2012]
|
|
||||||
Removed all of the assembler code from pnggccrd.c and just "return 2;".
|
|
||||||
|
|
||||||
version 1.0.58 and 1.2.48 [March 8, 2012]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.0.59 and 1.2.49 [March 29, 2012]
|
|
||||||
Revised png_set_text_2() to avoid potential memory corruption (fixes
|
|
||||||
CVE-2011-3048, also known as CVE-2012-3425).
|
|
||||||
Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
|
|
||||||
|
|
||||||
version 1.0.60 and 1.2.50 [July 9, 2012]
|
|
||||||
Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.
|
|
||||||
|
|
||||||
version 1.2.51beta01 [January 22, 2013]
|
|
||||||
Ignore, with a warning, out-of-range value of num_trans in png_set_tRNS().
|
|
||||||
Replaced AM_CONFIG_HEADER(config.h) with AC_CONFIG_HEADERS([config.h])
|
|
||||||
in configure.ac
|
|
||||||
Changed default value of PNG_USER_CACHE_MAX from 0 to 32767 in pngconf.h.
|
|
||||||
|
|
||||||
version 1.2.51beta02 [June 13, 2013]
|
|
||||||
Avoid a possible memory leak in contrib/gregbook/readpng.c
|
|
||||||
Revised libpng.3 so that "doclifter" can process it.
|
|
||||||
|
|
||||||
version 1.2.51beta03 [January 1, 2014]
|
|
||||||
Changed '"%s"m' to '"%s" m' in png_debug macros to improve portability
|
|
||||||
among compilers.
|
|
||||||
Rebuilt the configure scripts with autoconf-2.69 and automake-1.14.1
|
|
||||||
|
|
||||||
version 1.2.51beta04 [January 10, 2014]
|
|
||||||
Removed potentially misleading warning from png_check_IHDR().
|
|
||||||
|
|
||||||
version 1.2.51beta05 [January 22, 2014]
|
|
||||||
Quiet set-but-not-used warnings in pngset.c
|
|
||||||
|
|
||||||
version 1.2.51rc01 [January 28, 2014]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.51rc02 [January 30, 2014]
|
|
||||||
Quiet an uninitialized memory warning from VC2013 in png_get_png().
|
|
||||||
|
|
||||||
version 1.2.51rc03 [February 3, 2014]
|
|
||||||
Quiet unused variable warnings from clang by porting PNG_UNUSED() from
|
|
||||||
libpng-1.4.6.
|
|
||||||
|
|
||||||
version 1.2.51rc04 [February 3, 2014]
|
|
||||||
Added -DZ_SOLO to CFLAGS in contrib/pngminim/*/makefile
|
|
||||||
|
|
||||||
version 1.0.61 and 1.2.51 [February 6, 2014]
|
|
||||||
Added an #ifdef PNG_FIXED_POINT_SUPPORTED/#endif in pngset.c
|
|
||||||
|
|
||||||
version 1.2.52beta01 [November 6, 2014]
|
|
||||||
Avoid out-of-bounds memory access while checking version string in
|
|
||||||
pngread.c and pngwrite.c
|
|
||||||
|
|
||||||
version 1.2.52rc01 [November 13, 2014]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.52rc02 [November 17, 2014]
|
|
||||||
Added "-D_CRT_SECURE_NO_DEPRECATE" to CFLAGS in scripts/makefile.vcwin32
|
|
||||||
and scripts/makefile.vcawin32.
|
|
||||||
|
|
||||||
version 1.0.62 and 1.2.52 [November 20, 2014]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.53beta01 [omitted]
|
|
||||||
|
|
||||||
version 1.2.53beta02 [February 6, 2015]
|
|
||||||
Issue a png_error() instead of a png_warning() when width is
|
|
||||||
potentially too large for the architecture, in case the calling
|
|
||||||
application has overridden the default 1,000,000-column limit
|
|
||||||
(fixes CVE-2014-9495 and CVE-2015-0973).
|
|
||||||
Quieted some harmless warnings from Coverity-scan.
|
|
||||||
|
|
||||||
version 1.2.53rc01 [February 12, 2015]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.53rc02 [February 21, 2015]
|
|
||||||
Display user limits in the output from pngtest.
|
|
||||||
Changed PNG_USER_CHUNK_MALLOC_MAX from unlimited to 8,000,000.
|
|
||||||
This can only be changed at library-build time. It only
|
|
||||||
affects the maximum memory that can be allocated to an
|
|
||||||
ancillary chunk; it does not limit the size of IDAT
|
|
||||||
data, which is instead limited by PNG_USER_WIDTH_MAX.
|
|
||||||
Rebuilt configure scripts with automake-1.15 and libtool-2.4.6
|
|
||||||
|
|
||||||
versions 1.0.63 and 1.2.53 [February 26, 2015]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.54beta01 [October 23, 2015]
|
|
||||||
Fixed typecast in a png_debug2() statement in png_set_text_2() to
|
|
||||||
avoid a compiler warning in PNG_DEBUG builds.
|
|
||||||
Fixed printf formats in pngtest.c to avoid compiler warnings and a
|
|
||||||
Coverity warning in PNG_DEBUG builds.
|
|
||||||
Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c PNG_DEBUG builds.
|
|
||||||
Removed WRITE_WEIGHTED_FILTERED code.
|
|
||||||
Avoid potentially dereferencing NULL info_ptr in png_info_init_3().
|
|
||||||
Fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c
|
|
||||||
Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c
|
|
||||||
because usleep() is deprecated (port from libpng16).
|
|
||||||
Fixed some bad links in the man page.
|
|
||||||
Added a safety check in png_set_tIME() (Fixes CVE-2015-7981, bug report
|
|
||||||
from Qixue Xiao).
|
|
||||||
|
|
||||||
version 1.2.54rc01 [October 28, 2015]
|
|
||||||
No changes.
|
|
||||||
|
|
||||||
version 1.2.54rc02 [October 31, 2015]
|
|
||||||
Prevent writing over-length PLTE chunk (Cosmin Truta).
|
|
||||||
Silently truncate over-length PLTE chunk while reading.
|
|
||||||
|
|
||||||
version 1.2.54rc03 [November 3, 2015]
|
|
||||||
Clarified COPYRIGHT information to state explicitly that versions
|
|
||||||
are derived from previous versions.
|
|
||||||
Removed much of the long list of previous versions from png.h and
|
|
||||||
libpng.3.
|
|
||||||
|
|
||||||
version 1.2.54rc04 [November 5, 2015]
|
|
||||||
Fixed new bug with CRC error after reading an over-length palette
|
|
||||||
(bug report by Cosmin Truta) (CVE-2015-8126).
|
|
||||||
|
|
||||||
version 1.2.54 [November 12, 2015]
|
|
||||||
Cleaned up coding style in png_handle_PLTE().
|
|
||||||
|
|
||||||
version 1.2.55beta01 [November 20, 2015]
|
|
||||||
Avoid potential pointer overflow in png_handle_iTXt(), png_handle_zTXt(),
|
|
||||||
png_handle_sPLT(), and png_handle_pCAL() (Bug report by John Regehr).
|
|
||||||
|
|
||||||
version 1.2.55beta02 [November 23, 2015]
|
|
||||||
Fixed incorrect implementation of png_set_PLTE() that uses png_ptr
|
|
||||||
not info_ptr, that left png_set_PLTE() open to the CVE-2015-8126
|
|
||||||
vulnerability.
|
|
||||||
|
|
||||||
version 1.2.55rc01 [November 26, 2015]
|
|
||||||
Discontinued distributing tar.bz2 archives.
|
|
||||||
|
|
||||||
version 1.2.55 and 1.0.65 [December 3, 2015]
|
|
||||||
Discontinued distributing libpng-oldversion-newversion-diff.txt
|
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
@@ -2905,4 +2589,4 @@ to subscribe)
|
|||||||
or to glennrp at users.sourceforge.net
|
or to glennrp at users.sourceforge.net
|
||||||
|
|
||||||
Glenn R-P
|
Glenn R-P
|
||||||
#endif
|
*/
|
||||||
|
|||||||
267
CMakeLists.txt
Normal file
267
CMakeLists.txt
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.4.3)
|
||||||
|
if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of
|
||||||
|
build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
|
||||||
|
Release RelWithDebInfo MinSizeRel.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(PNG C)
|
||||||
|
enable_testing()
|
||||||
|
|
||||||
|
# Copyright (C) 2007 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 2)
|
||||||
|
set(PNGLIB_RELEASE 41)
|
||||||
|
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
|
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||||
|
|
||||||
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||||
|
|
||||||
|
# needed packages
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
find_library(M_LIBRARY
|
||||||
|
NAMES m
|
||||||
|
PATHS /usr/lib /usr/local/lib
|
||||||
|
)
|
||||||
|
if(NOT M_LIBRARY)
|
||||||
|
message(STATUS
|
||||||
|
"math library 'libm' not found - floating point support disabled")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# not needed on windows
|
||||||
|
set(M_LIBRARY "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# COMMAND LINE OPTIONS
|
||||||
|
if(DEFINED PNG_SHARED)
|
||||||
|
option(PNG_SHARED "Build shared lib" ${PNG_SHARED})
|
||||||
|
else()
|
||||||
|
option(PNG_SHARED "Build shared lib" ON)
|
||||||
|
endif()
|
||||||
|
if(DEFINED PNG_STATIC)
|
||||||
|
option(PNG_STATIC "Build static lib" ${PNG_STATIC})
|
||||||
|
else()
|
||||||
|
option(PNG_STATIC "Build static lib" ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(MINGW)
|
||||||
|
option(PNG_TESTS "Build pngtest" NO)
|
||||||
|
else(MINGW)
|
||||||
|
option(PNG_TESTS "Build pngtest" YES)
|
||||||
|
endif(MINGW)
|
||||||
|
|
||||||
|
option(PNG_NO_CONSOLE_IO "FIXME" YES)
|
||||||
|
option(PNG_NO_STDIO "FIXME" YES)
|
||||||
|
option(PNG_DEBUG "Build with debug output" NO)
|
||||||
|
option(PNGARG "FIXME" YES)
|
||||||
|
#TODO:
|
||||||
|
# PNG_CONSOLE_IO_SUPPORTED
|
||||||
|
|
||||||
|
# maybe needs improving, but currently I don't know when we can enable what :)
|
||||||
|
set(png_asm_tmp "OFF")
|
||||||
|
if(NOT WIN32)
|
||||||
|
find_program(uname_executable NAMES uname PATHS /bin /usr/bin /usr/local/bin)
|
||||||
|
if(uname_executable)
|
||||||
|
EXEC_PROGRAM(${uname_executable} ARGS --machine OUTPUT_VARIABLE uname_output)
|
||||||
|
if("uname_output" MATCHES "^.*i[1-9]86.*$")
|
||||||
|
set(png_asm_tmp "ON")
|
||||||
|
else("uname_output" MATCHES "^.*i[1-9]86.*$")
|
||||||
|
set(png_asm_tmp "OFF")
|
||||||
|
endif("uname_output" MATCHES "^.*i[1-9]86.*$")
|
||||||
|
endif(uname_executable)
|
||||||
|
else()
|
||||||
|
# this env var is normally only set on win64
|
||||||
|
SET(TEXT "ProgramFiles(x86)")
|
||||||
|
if("$ENV{${TEXT}}" STREQUAL "")
|
||||||
|
set(png_asm_tmp "ON")
|
||||||
|
endif("$ENV{${TEXT}}" STREQUAL "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# SET LIBNAME
|
||||||
|
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
|
|
||||||
|
# to distinguish between debug and release lib
|
||||||
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
|
|
||||||
|
|
||||||
|
# OUR SOURCES
|
||||||
|
set(libpng_sources
|
||||||
|
png.h
|
||||||
|
pngconf.h
|
||||||
|
png.c
|
||||||
|
pngerror.c
|
||||||
|
pngget.c
|
||||||
|
pngmem.c
|
||||||
|
pngpread.c
|
||||||
|
pngread.c
|
||||||
|
pngrio.c
|
||||||
|
pngrtran.c
|
||||||
|
pngrutil.c
|
||||||
|
pngset.c
|
||||||
|
pngtrans.c
|
||||||
|
pngwio.c
|
||||||
|
pngwrite.c
|
||||||
|
pngwtran.c
|
||||||
|
pngwutil.c
|
||||||
|
)
|
||||||
|
set(pngtest_sources
|
||||||
|
pngtest.c
|
||||||
|
)
|
||||||
|
# SOME NEEDED DEFINITIONS
|
||||||
|
|
||||||
|
add_definitions(-DPNG_CONFIGURE_LIBPNG)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
|
if(PNG_SHARED OR NOT MSVC)
|
||||||
|
#if building msvc static this has NOT to be defined
|
||||||
|
add_definitions(-DZLIB_DLL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_definitions(-DLIBPNG_NO_MMX)
|
||||||
|
add_definitions(-DPNG_NO_MMX_CODE)
|
||||||
|
|
||||||
|
if(PNG_CONSOLE_IO_SUPPORTED)
|
||||||
|
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_NO_CONSOLE_IO)
|
||||||
|
add_definitions(-DPNG_NO_CONSOLE_IO)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_NO_STDIO)
|
||||||
|
add_definitions(-DPNG_NO_STDIO)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_DEBUG)
|
||||||
|
add_definitions(-DPNG_DEBUG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT M_LIBRARY AND NOT WIN32)
|
||||||
|
add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# NOW BUILD OUR TARGET
|
||||||
|
include_directories(${PNG_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(PNG_SHARED)
|
||||||
|
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
||||||
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_STATIC)
|
||||||
|
# does not work without changing name
|
||||||
|
set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)
|
||||||
|
add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources})
|
||||||
|
if(MSVC)
|
||||||
|
# msvc does not append 'lib' - do it here to have consistent name
|
||||||
|
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(PNG_SHARED AND WIN32)
|
||||||
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PNG_TESTS AND PNG_SHARED)
|
||||||
|
# does not work with msvc due to png_lib_ver issue
|
||||||
|
add_executable(pngtest ${pngtest_sources})
|
||||||
|
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
||||||
|
add_test(pngtest pngtest ${PNG_SOURCE_DIR}/pngtest.png)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# CREATE PKGCONFIG FILES
|
||||||
|
# we use the same files like ./configure, so we have to set its vars
|
||||||
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
|
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
|
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
||||||
|
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
||||||
|
|
||||||
|
configure_file(${PNG_SOURCE_DIR}/scripts/libpng.pc.in
|
||||||
|
${PNG_BINARY_DIR}/libpng.pc)
|
||||||
|
configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||||
|
${PNG_BINARY_DIR}/libpng-config)
|
||||||
|
configure_file(${PNG_SOURCE_DIR}/scripts/libpng.pc.in
|
||||||
|
${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc)
|
||||||
|
configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||||
|
${PNG_BINARY_DIR}/${PNGLIB_NAME}-config)
|
||||||
|
|
||||||
|
# SET UP LINKS
|
||||||
|
if(PNG_SHARED)
|
||||||
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||||
|
# VERSION 0.${PNGLIB_RELEASE}.1.2.41beta17
|
||||||
|
VERSION 0.${PNGLIB_RELEASE}.0
|
||||||
|
SOVERSION 0
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
endif()
|
||||||
|
if(PNG_STATIC)
|
||||||
|
if(NOT WIN32)
|
||||||
|
# that's uncool on win32 - it overwrites our static import lib...
|
||||||
|
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
||||||
|
OUTPUT_NAME ${PNG_LIB_NAME}
|
||||||
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# INSTALL
|
||||||
|
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||||
|
if(PNG_SHARED)
|
||||||
|
install(TARGETS ${PNG_LIB_NAME}
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
if(PNG_STATIC)
|
||||||
|
install(TARGETS ${PNG_LIB_NAME_STATIC}
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
|
||||||
|
install(FILES png.h pngconf.h DESTINATION include)
|
||||||
|
install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME})
|
||||||
|
endif()
|
||||||
|
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
|
||||||
|
install(PROGRAMS ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||||
|
install(PROGRAMS ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
|
||||||
|
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
||||||
|
install(FILES png.5 DESTINATION man/man5)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/libpng.pc DESTINATION lib/pkgconfig)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}.pc DESTINATION lib/pkgconfig)
|
||||||
|
install(FILES ${PNG_BINARY_DIR}/${PNGLIB_NAME}-config DESTINATION bin)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# what's with libpng.txt and all the extra files?
|
||||||
|
|
||||||
|
|
||||||
|
# UNINSTALL
|
||||||
|
# do we need this?
|
||||||
|
|
||||||
|
|
||||||
|
# DIST
|
||||||
|
# do we need this?
|
||||||
|
|
||||||
|
# to create msvc import lib for mingw compiled shared lib
|
||||||
|
# pexports libpng.dll > libpng.def
|
||||||
|
# lib /def:libpng.def /machine:x86
|
||||||
|
|
||||||
114
INSTALL
114
INSTALL
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Installing libpng version 1.0.65 - December 3, 2015
|
Installing libpng version 1.2.41beta17 - November 10, 2009
|
||||||
|
|
||||||
On Unix/Linux and similar systems, you can simply type
|
On Unix/Linux and similar systems, you can simply type
|
||||||
|
|
||||||
@@ -25,29 +25,27 @@ Instead, you can use one of the custom-built makefiles in the
|
|||||||
make test
|
make test
|
||||||
make install
|
make install
|
||||||
|
|
||||||
The files that are presently available in the scripts directory
|
|
||||||
are listed and described in scripts/README.txt.
|
|
||||||
|
|
||||||
Or you can use one of the "projects" in the "projects" directory.
|
Or you can use one of the "projects" in the "projects" directory.
|
||||||
|
|
||||||
|
If you want to use "cmake" (see www.cmake.org), copy CMakeLists.txt
|
||||||
|
from the "scripts" directory to this directory and type
|
||||||
|
|
||||||
|
cmake . [-DPNG_MMX=YES] -DCMAKE_INSTALL_PREFIX=/path
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
Before installing libpng, you must first install zlib, if it
|
Before installing libpng, you must first install zlib, if it
|
||||||
is not already on your system. zlib can usually be found
|
is not already on your system. zlib can usually be found
|
||||||
wherever you got libpng. zlib can be placed in another directory,
|
wherever you got libpng. zlib can be placed in another directory,
|
||||||
at the same level as libpng.
|
at the same level as libpng.
|
||||||
|
|
||||||
If you want to use "cmake" (see www.cmake.org), type
|
|
||||||
|
|
||||||
cmake . -DCMAKE_INSTALL_PREFIX=/path
|
|
||||||
make
|
|
||||||
make install
|
|
||||||
|
|
||||||
If your system already has a preinstalled zlib you will still need
|
If your system already has a preinstalled zlib you will still need
|
||||||
to have access to the zlib.h and zconf.h include files that
|
to have access to the zlib.h and zconf.h include files that
|
||||||
correspond to the version of zlib that's installed.
|
correspond to the version of zlib that's installed.
|
||||||
|
|
||||||
You can rename the directories that you downloaded (they
|
You can rename the directories that you downloaded (they
|
||||||
might be called "libpng-1.0.65" or "libpng10" and "zlib-1.2.3"
|
might be called "libpng-1.2.41beta17" or "lpng109" and "zlib-1.2.1"
|
||||||
or "zlib123") so that you have directories called "zlib" and "libpng".
|
or "zlib121") so that you have directories called "zlib" and "libpng".
|
||||||
|
|
||||||
Your directory structure should look like this:
|
Your directory structure should look like this:
|
||||||
|
|
||||||
@@ -57,26 +55,19 @@ Your directory structure should look like this:
|
|||||||
README
|
README
|
||||||
*.h
|
*.h
|
||||||
*.c
|
*.c
|
||||||
CMakeLists.txt => "cmake" script
|
|
||||||
configuration files:
|
|
||||||
configure.ac, configure, Makefile.am, Makefile.in,
|
|
||||||
autogen.sh, config.guess, ltmain.sh, missing,
|
|
||||||
aclocal.m4, config.h.in, config.sub,
|
|
||||||
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
|
|
||||||
contrib
|
contrib
|
||||||
gregbook
|
gregbook
|
||||||
pngminim
|
|
||||||
pngminus
|
pngminus
|
||||||
pngsuite
|
pngsuite
|
||||||
visupng
|
visupng
|
||||||
projects
|
projects
|
||||||
cbuilder5 (Borland)
|
beos
|
||||||
|
c5builder (Borland)
|
||||||
visualc6 (msvc)
|
visualc6 (msvc)
|
||||||
visualc71
|
netware.txt
|
||||||
xcode
|
wince.txt
|
||||||
scripts
|
scripts
|
||||||
makefile.*
|
makefile.*
|
||||||
*.def (module definition files)
|
|
||||||
pngtest.png
|
pngtest.png
|
||||||
etc.
|
etc.
|
||||||
zlib
|
zlib
|
||||||
@@ -91,13 +82,80 @@ distribution of libpng. It is available in both tar.gz (UNIX style line
|
|||||||
endings) and zip (DOS style line endings) formats.
|
endings) and zip (DOS style line endings) formats.
|
||||||
|
|
||||||
If you are building libpng with MSVC, you can enter the
|
If you are building libpng with MSVC, you can enter the
|
||||||
libpng projects\visualc6 or visualc71 directory and follow the instructions
|
libpng projects\visualc6 directory and follow the instructions in
|
||||||
in README.txt.
|
projects\visualc6\README.txt.
|
||||||
|
|
||||||
Otherwise enter the zlib directory and follow the instructions in zlib/README,
|
You can build libpng for WindowsCE by downloading and installing
|
||||||
|
the projects\wince directory as instructed in the projects\wince.txt file, and
|
||||||
|
then following the instructions in the README* files. Similarly, you can
|
||||||
|
build libpng for Netware or Beos as instructed in projects\netware.txt
|
||||||
|
or projects\beos.
|
||||||
|
|
||||||
|
Else enter the zlib directory and follow the instructions in zlib/README,
|
||||||
then come back here and run "configure" or choose the appropriate
|
then come back here and run "configure" or choose the appropriate
|
||||||
makefile.sys in the scripts directory.
|
makefile.sys in the scripts directory.
|
||||||
|
|
||||||
|
The files that are presently available in the scripts directory
|
||||||
|
include
|
||||||
|
|
||||||
|
CMakeLists.txt => "cmake" script
|
||||||
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
|
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||||
|
gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.linux => Linux/ELF makefile
|
||||||
|
(gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
|
ansi2knr (Requires ansi2knr.c from
|
||||||
|
ftp://ftp.cs.wisc.edu/ghost)
|
||||||
|
makefile.aix => AIX/gcc makefile
|
||||||
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
|
makefile.darwin => Darwin makefile, can use on MacosX
|
||||||
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
|
makefile.freebsd => FreeBSD makefile
|
||||||
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
|
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit
|
||||||
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
|
makefile.intel => Intel C/C++ version 4.0 and later
|
||||||
|
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||||
|
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
||||||
|
makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD,
|
||||||
|
makes libpng12.so
|
||||||
|
makefile.openbsd => OpenBSD makefile
|
||||||
|
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||||
|
makefile.sggcc => Silicon Graphics (gcc,
|
||||||
|
creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.sunos => Sun makefile
|
||||||
|
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||||
|
creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
|
||||||
|
creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.so9 => Solaris 9 makefile (gcc,
|
||||||
|
creates libpng12.so.0.1.2.41beta17)
|
||||||
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
|
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||||
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
|
makefile.mips => MIPS makefile
|
||||||
|
makefile.acorn => Acorn makefile
|
||||||
|
makefile.amiga => Amiga makefile
|
||||||
|
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
||||||
|
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
||||||
|
makefile.atari => Atari makefile
|
||||||
|
makefile.beos => BEOS makefile for X86
|
||||||
|
makefile.bor => Borland makefile (uses bcc)
|
||||||
|
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
|
||||||
|
makefile.tc3 => Turbo C 3.0 makefile
|
||||||
|
makefile.dj2 => DJGPP 2 makefile
|
||||||
|
makefile.msc => Microsoft C makefile
|
||||||
|
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later
|
||||||
|
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||||
|
pngos2.def => OS/2 module definition file used by makefile.os2
|
||||||
|
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
|
||||||
|
makevms.com => VMS build script
|
||||||
|
descrip.mms => VMS makefile for MMS or MMK
|
||||||
|
SCOPTIONS.ppc => Used with smakefile.ppc
|
||||||
|
|
||||||
Copy the file (or files) that you need from the
|
Copy the file (or files) that you need from the
|
||||||
scripts directory into this directory, for example
|
scripts directory into this directory, for example
|
||||||
|
|
||||||
@@ -127,11 +185,9 @@ run "make install".
|
|||||||
|
|
||||||
If you encounter a compiler error message complaining about the
|
If you encounter a compiler error message complaining about the
|
||||||
lines
|
lines
|
||||||
|
|
||||||
__png.h__ already includes setjmp.h;
|
__png.h__ already includes setjmp.h;
|
||||||
__dont__ include it again.;
|
__dont__ include it again.;
|
||||||
|
This means you have compiled another module that includes setjmp.h,
|
||||||
this means you have compiled another module that includes setjmp.h,
|
|
||||||
which is hazardous because the two modules might not include exactly
|
which is hazardous because the two modules might not include exactly
|
||||||
the same setjmp.h. If you are sure that you know what you are doing
|
the same setjmp.h. If you are sure that you know what you are doing
|
||||||
and that they are exactly the same, then you can comment out or
|
and that they are exactly the same, then you can comment out or
|
||||||
|
|||||||
2
KNOWNBUG
2
KNOWNBUG
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Known bugs in libpng version 1.0.65
|
Known bugs in libpng version 1.2.41beta17
|
||||||
|
|
||||||
1. February 23, 2006: The custom makefiles don't build libpng with -lz.
|
1. February 23, 2006: The custom makefiles don't build libpng with -lz.
|
||||||
|
|
||||||
|
|||||||
49
LICENSE
49
LICENSE
@@ -10,15 +10,20 @@ this sentence.
|
|||||||
|
|
||||||
This code is released under the libpng license.
|
This code is released under the libpng license.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000, through 1.0.65, December 3, 2015, are
|
libpng versions 1.2.6, August 15, 2004, through 1.2.41beta17, November 10, 2009, are
|
||||||
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are
|
Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
|
||||||
derived from libpng-1.0.6, and are distributed according to the same
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
with the following individual added to the list of Contributing Authors
|
||||||
added to the list of Contributing Authors:
|
|
||||||
|
Cosmin Truta
|
||||||
|
|
||||||
|
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
|
||||||
|
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
|
||||||
|
distributed according to the same disclaimer and license as libpng-1.0.6
|
||||||
|
with the following individuals added to the list of Contributing Authors
|
||||||
|
|
||||||
Simon-Pierre Cadieux
|
Simon-Pierre Cadieux
|
||||||
Eric S. Raymond
|
Eric S. Raymond
|
||||||
Cosmin Truta
|
|
||||||
Gilles Vollant
|
Gilles Vollant
|
||||||
|
|
||||||
and with the following additions to the disclaimer:
|
and with the following additions to the disclaimer:
|
||||||
@@ -31,20 +36,18 @@ and with the following additions to the disclaimer:
|
|||||||
the user.
|
the user.
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||||
Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
|
||||||
libpng-0.96, and are distributed according to the same disclaimer and
|
distributed according to the same disclaimer and license as libpng-0.96,
|
||||||
license as libpng-0.96, with the following individuals added to the list
|
with the following individuals added to the list of Contributing Authors:
|
||||||
of Contributing Authors:
|
|
||||||
|
|
||||||
Tom Lane
|
Tom Lane
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
Willem van Schaik
|
Willem van Schaik
|
||||||
|
|
||||||
libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
||||||
Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
and are distributed according to the same disclaimer and license as
|
Distributed according to the same disclaimer and license as libpng-0.88,
|
||||||
libpng-0.88, with the following individuals added to the list of
|
with the following individuals added to the list of Contributing Authors:
|
||||||
Contributing Authors:
|
|
||||||
|
|
||||||
John Bowler
|
John Bowler
|
||||||
Kevin Bracey
|
Kevin Bracey
|
||||||
@@ -54,7 +57,7 @@ Contributing Authors:
|
|||||||
Tom Tanner
|
Tom Tanner
|
||||||
|
|
||||||
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
libpng versions 0.5, May 1995, through 0.88, January 1996, are
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
|
|
||||||
For the purposes of this copyright and license, "Contributing Authors"
|
For the purposes of this copyright and license, "Contributing Authors"
|
||||||
is defined as the following set of individuals:
|
is defined as the following set of individuals:
|
||||||
@@ -77,12 +80,12 @@ Permission is hereby granted to use, copy, modify, and distribute this
|
|||||||
source code, or portions hereof, for any purpose, without fee, subject
|
source code, or portions hereof, for any purpose, without fee, subject
|
||||||
to the following restrictions:
|
to the following restrictions:
|
||||||
|
|
||||||
1. The origin of this source code must not be misrepresented.
|
1. The origin of this source code must not be misrepresented.
|
||||||
|
|
||||||
2. Altered versions must be plainly marked as such and must not
|
2. Altered versions must be plainly marked as such and must not
|
||||||
be misrepresented as being the original source.
|
be misrepresented as being the original source.
|
||||||
|
|
||||||
3. This Copyright notice may not be removed or altered from any
|
3. This Copyright notice may not be removed or altered from any
|
||||||
source or altered source distribution.
|
source or altered source distribution.
|
||||||
|
|
||||||
The Contributing Authors and Group 42, Inc. specifically permit, without
|
The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||||
@@ -91,20 +94,18 @@ supporting the PNG file format in commercial products. If you use this
|
|||||||
source code in a product, acknowledgment is not required but would be
|
source code in a product, acknowledgment is not required but would be
|
||||||
appreciated.
|
appreciated.
|
||||||
|
|
||||||
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
|
||||||
|
|
||||||
A "png_get_copyright" function is available, for convenient use in "about"
|
A "png_get_copyright" function is available, for convenient use in "about"
|
||||||
boxes and the like:
|
boxes and the like:
|
||||||
|
|
||||||
printf("%s", png_get_copyright(NULL));
|
printf("%s",png_get_copyright(NULL));
|
||||||
|
|
||||||
Also, the PNG logo (in PNG format, of course) is supplied in the
|
Also, the PNG logo (in PNG format, of course) is supplied in the
|
||||||
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
|
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
|
||||||
|
|
||||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
|
||||||
a certification mark of the Open Source Initiative. OSI has not addressed
|
certification mark of the Open Source Initiative.
|
||||||
the additional disclaimers inserted at version 1.0.7.
|
|
||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
December 3, 2015
|
November 10, 2009
|
||||||
|
|||||||
39
Makefile.am
39
Makefile.am
@@ -16,7 +16,7 @@ AUTOMAKE_OPTIONS = foreign
|
|||||||
# test programs - run on make check, make distcheck
|
# test programs - run on make check, make distcheck
|
||||||
check_PROGRAMS= pngtest
|
check_PROGRAMS= pngtest
|
||||||
pngtest_SOURCES = pngtest.c
|
pngtest_SOURCES = pngtest.c
|
||||||
pngtest_LDADD = libpng10.la
|
pngtest_LDADD = libpng12.la
|
||||||
TESTS = test-pngtest.sh
|
TESTS = test-pngtest.sh
|
||||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||||
|
|
||||||
@@ -24,39 +24,39 @@ TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
|||||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||||
|
|
||||||
# generate the -config scripts if required
|
# generate the -config scripts if required
|
||||||
binconfigs= libpng10-config
|
binconfigs= libpng12-config
|
||||||
EXTRA_SCRIPTS= libpng-config libpng10-config
|
EXTRA_SCRIPTS= libpng-config libpng12-config
|
||||||
bin_SCRIPTS= @binconfigs@
|
bin_SCRIPTS= @binconfigs@
|
||||||
|
|
||||||
# rules to build libpng, only build the old library on request
|
# rules to build libpng, only build the old library on request
|
||||||
lib_LTLIBRARIES=libpng10.la @compatlib@
|
lib_LTLIBRARIES=libpng12.la @compatlib@
|
||||||
EXTRA_LTLIBRARIES= libpng.la
|
EXTRA_LTLIBRARIES= libpng.la
|
||||||
libpng10_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
libpng12_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c \
|
pngwtran.c pngmem.c pngerror.c pngpread.c \
|
||||||
png.h pngconf.h
|
png.h pngconf.h
|
||||||
libpng_la_SOURCES = $(libpng10_la_SOURCES)
|
libpng_la_SOURCES = $(libpng12_la_SOURCES)
|
||||||
|
|
||||||
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
|
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||||
libpng10_la_CPPFLAGS = @LIBPNG_DEFINES@
|
libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||||
|
|
||||||
# MAJOR UPGRADE: the version-number settings below must be changed.
|
# MAJOR UPGRADE: the version-number settings below must be changed.
|
||||||
libpng10_la_LDFLAGS = -no-undefined -export-dynamic \
|
libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||||
-version-number 0:@PNGLIB_RELEASE@:0
|
-version-number 0:@PNGLIB_RELEASE@:0
|
||||||
# -rpath is needed as automake doesn't know the directory
|
# -rpath is needed as automake doesn't know the directory
|
||||||
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
|
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
|
||||||
-version-number 2:@PNGLIB_RELEASE@:0
|
-version-number 3:@PNGLIB_RELEASE@:0
|
||||||
|
|
||||||
if HAVE_LD_VERSION_SCRIPT
|
if HAVE_LD_VERSION_SCRIPT
|
||||||
# Versioned symbols and restricted exports
|
# Versioned symbols and restricted exports
|
||||||
libpng10_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
libpng12_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||||
libpng10_la_DEPENDENCIES = libpng.vers
|
libpng12_la_DEPENDENCIES = libpng.vers
|
||||||
else
|
else
|
||||||
# Only restricted exports when possible
|
# Only restricted exports when possible
|
||||||
libpng10_la_LDFLAGS += -export-symbols libpng.sym
|
libpng12_la_LDFLAGS += -export-symbols libpng.sym
|
||||||
libpng10_la_DEPENDENCIES = libpng.sym
|
libpng12_la_DEPENDENCIES = libpng.sym
|
||||||
endif
|
endif
|
||||||
libpng_la_DEPENDENCIES = $(libpng10_la_DEPENDENCIES)
|
libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
|
||||||
|
|
||||||
# Avoid depending upon Character Ranges.
|
# Avoid depending upon Character Ranges.
|
||||||
AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||||
@@ -68,30 +68,27 @@ pkginclude_HEADERS= png.h pngconf.h
|
|||||||
# pkg-config stuff, note that libpng.pc is always required in order
|
# pkg-config stuff, note that libpng.pc is always required in order
|
||||||
# to get the correct library
|
# to get the correct library
|
||||||
pkgconfigdir = @pkgconfigdir@
|
pkgconfigdir = @pkgconfigdir@
|
||||||
pkgconfig_DATA = libpng10.pc
|
pkgconfig_DATA = libpng12.pc
|
||||||
|
|
||||||
#extra source distribution files.
|
#extra source distribution files.
|
||||||
EXTRA_DIST= \
|
EXTRA_DIST= \
|
||||||
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
|
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
|
||||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||||
CMakeLists.txt \
|
|
||||||
${srcdir}/projects/cbuilder5/* \
|
${srcdir}/projects/cbuilder5/* \
|
||||||
${srcdir}/projects/beos/* \
|
${srcdir}/projects/beos/* \
|
||||||
${srcdir}/projects/visualc6/* \
|
${srcdir}/projects/visualc6/* \
|
||||||
${srcdir}/projects/visualc71/* \
|
${srcdir}/projects/visualc71/* \
|
||||||
${srcdir}/projects/wince.txt \
|
${srcdir}/projects/wince.txt \
|
||||||
${srcdir}/projects/netware.txt \
|
${srcdir}/projects/netware.txt \
|
||||||
${srcdir}/projects/xcode/* \
|
|
||||||
${srcdir}/scripts/* \
|
${srcdir}/scripts/* \
|
||||||
${srcdir}/contrib/gregbook/* \
|
${srcdir}/contrib/gregbook/* \
|
||||||
${srcdir}/contrib/pngminim/* \
|
|
||||||
${srcdir}/contrib/pngminus/* \
|
${srcdir}/contrib/pngminus/* \
|
||||||
${srcdir}/contrib/pngsuite/* \
|
${srcdir}/contrib/pngsuite/* \
|
||||||
${srcdir}/contrib/visupng/* \
|
${srcdir}/contrib/visupng/* \
|
||||||
$(TESTS) \
|
$(TESTS) \
|
||||||
example.c libpng-1.0.65.txt pnggccrd.c pngvcrd.c
|
example.c libpng-1.2.41beta17.txt pngvcrd.c
|
||||||
|
|
||||||
CLEANFILES= pngout.png libpng10.pc libpng10-config libpng.vers \
|
CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \
|
||||||
libpng.sym
|
libpng.sym
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||||
@@ -129,7 +126,7 @@ install-data-hook:
|
|||||||
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
|
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
|
||||||
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
||||||
|
|
||||||
# do evil things to libpng to cause libpng10 to be used
|
# do evil things to libpng to cause libpng12 to be used
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
cd $(DESTDIR)$(bindir); rm -f libpng-config
|
cd $(DESTDIR)$(bindir); rm -f libpng-config
|
||||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||||
|
|||||||
1256
Makefile.in
1256
Makefile.in
File diff suppressed because it is too large
Load Diff
110
README
110
README
@@ -1,14 +1,14 @@
|
|||||||
README for libpng version 1.0.65 - December 3, 2015 (shared library 10.0)
|
README for libpng version 1.2.41beta17 - November 10, 2009 (shared library 12.0)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
|
|
||||||
Libpng comes in several distribution formats. Get libpng-*.tar.gz or
|
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
|
||||||
libpng-*.tar.xz if you want UNIX-style line
|
libpng-*.tar.lzma, or libpng-*.tar.bz2 if you want UNIX-style line
|
||||||
endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style
|
endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style
|
||||||
line endings. You can get UNIX-style line endings from the *.zip file
|
line endings. You can get UNIX-style line endings from the *.zip file
|
||||||
by using "unzip -a" but there seems to be no simple way to recover
|
by using "unzip -a" but there seems to be no simple way to recover
|
||||||
UNIX-style line endings from the *.7z file. The *.tar.xz file is
|
UNIX-style line endings from the *.7z file. The *.tar.lzma file is
|
||||||
recommended for *NIX users instead.
|
recommended for *NIX users instead.
|
||||||
|
|
||||||
Version 0.89 was the first official release of libpng. Don't let the
|
Version 0.89 was the first official release of libpng. Don't let the
|
||||||
@@ -58,9 +58,9 @@ to set different actions based on whether the CRC error occurred in a
|
|||||||
critical or an ancillary chunk.
|
critical or an ancillary chunk.
|
||||||
|
|
||||||
The changes made to the library, and bugs fixed are based on discussions
|
The changes made to the library, and bugs fixed are based on discussions
|
||||||
on the png-mng-implement mailing list and not on material submitted
|
on the png-mng-implement mailing list
|
||||||
privately to Guy, Andreas, or Glenn. They will forward any good
|
and not on material submitted privately to Guy, Andreas, or Glenn. They will
|
||||||
suggestions to the list.
|
forward any good suggestions to the list.
|
||||||
|
|
||||||
For a detailed description on using libpng, read libpng.txt. For
|
For a detailed description on using libpng, read libpng.txt. For
|
||||||
examples of libpng in a program, see example.c and pngtest.c. For usage
|
examples of libpng in a program, see example.c and pngtest.c. For usage
|
||||||
@@ -93,12 +93,6 @@ This code is currently being archived at libpng.sf.net in the
|
|||||||
at GO GRAPHSUP. If you can't find it in any of those places,
|
at GO GRAPHSUP. If you can't find it in any of those places,
|
||||||
e-mail me, and I'll help you find it.
|
e-mail me, and I'll help you find it.
|
||||||
|
|
||||||
I am not a lawyer, but I believe that the Export Control Classification
|
|
||||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
|
||||||
controls or International Traffic in Arms Regulations (ITAR) because it
|
|
||||||
is open source, publicly available software, that does not contain any
|
|
||||||
encryption software. See the EAR, paragraphs 734.3(b)(3) and 734.7(b).
|
|
||||||
|
|
||||||
If you have any code changes, requests, problems, etc., please e-mail
|
If you have any code changes, requests, problems, etc., please e-mail
|
||||||
them to me. Also, I'd appreciate any make files or project files,
|
them to me. Also, I'd appreciate any make files or project files,
|
||||||
and any modifications you needed to make to get libpng to compile,
|
and any modifications you needed to make to get libpng to compile,
|
||||||
@@ -111,8 +105,7 @@ Finally, if you get any warning messages when compiling libpng
|
|||||||
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
fix. Please mention "libpng" somewhere in the subject line. Thanks.
|
||||||
|
|
||||||
This release was created and will be supported by myself (of course
|
This release was created and will be supported by myself (of course
|
||||||
based in a large way on Guy's and Andreas' earlier work), and the PNG
|
based in a large way on Guy's and Andreas' earlier work), and the PNG group.
|
||||||
development group.
|
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
@@ -120,14 +113,15 @@ https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
|||||||
to subscribe) or to glennrp at users.sourceforge.net
|
to subscribe) or to glennrp at users.sourceforge.net
|
||||||
|
|
||||||
You can't reach Guy, the original libpng author, at the addresses
|
You can't reach Guy, the original libpng author, at the addresses
|
||||||
given in previous versions of this document. He and Andreas will
|
given in previous versions of this document. He and Andreas will read mail
|
||||||
read mail addressed to the png-mng-implement list, however.
|
addressed to the png-mng-implement list, however.
|
||||||
|
|
||||||
Please do not send general questions about PNG. Send them to
|
Please do not send general questions about PNG. Send them to
|
||||||
the (png-mng-misc at lists.sourceforge.net, subscription required, visit
|
the (png-mng-misc at lists.sourceforge.net, subscription required, visit
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe)
|
||||||
subscribe). On the other hand, please do not send libpng questions to
|
On the other hand,
|
||||||
that address, send them to me or to the png-mng-implement list. I'll
|
please do not send libpng questions to that address, send them to me
|
||||||
|
or to the png-mng-implement list. I'll
|
||||||
get them in the end anyway. If you have a question about something
|
get them in the end anyway. If you have a question about something
|
||||||
in the PNG specification that is related to using libpng, send it
|
in the PNG specification that is related to using libpng, send it
|
||||||
to me. Send me any questions that start with "I was using libpng,
|
to me. Send me any questions that start with "I was using libpng,
|
||||||
@@ -135,7 +129,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
|
|||||||
to others, if necessary.
|
to others, if necessary.
|
||||||
|
|
||||||
Please do not send suggestions on how to change PNG. We have
|
Please do not send suggestions on how to change PNG. We have
|
||||||
been discussing PNG for twenty years now, and it is official and
|
been discussing PNG for twelve years now, and it is official and
|
||||||
finished. If you have suggestions for libpng, however, I'll
|
finished. If you have suggestions for libpng, however, I'll
|
||||||
gladly listen. Even if your suggestion is not used immediately,
|
gladly listen. Even if your suggestion is not used immediately,
|
||||||
it may be used later.
|
it may be used later.
|
||||||
@@ -180,44 +174,35 @@ Files in this distribution:
|
|||||||
gregbook => source code for PNG reading and writing, from
|
gregbook => source code for PNG reading and writing, from
|
||||||
Greg Roelofs' "PNG: The Definitive Guide",
|
Greg Roelofs' "PNG: The Definitive Guide",
|
||||||
O'Reilly, 1999
|
O'Reilly, 1999
|
||||||
pngminim => Minimal pnm2pngm and png2pnmm programs
|
msvctest => Builds and runs pngtest using a MSVC workspace
|
||||||
pngminus => Simple pnm2png and png2pnm programs
|
pngminus => Simple pnm2png and png2pnm programs
|
||||||
pngsuite => Test images
|
pngsuite => Test images
|
||||||
visupng => Contains a MSVC workspace for VisualPng
|
visupng => Contains a MSVC workspace for VisualPng
|
||||||
projects => Contains project files and workspaces for
|
projects => Contains project files and workspaces for building DLL
|
||||||
building a DLL
|
|
||||||
beos => Contains a Beos workspace for building libpng
|
beos => Contains a Beos workspace for building libpng
|
||||||
c5builder => Contains a Borland workspace for building
|
c5builder => Contains a Borland workspace for building libpng
|
||||||
libpng and zlib
|
and zlib
|
||||||
MacOSX => Contains a MacOSX workspace for building libpng
|
visualc6 => Contains a Microsoft Visual C++ (MSVC) workspace
|
||||||
netware.txt => Contains instructions for downloading a set
|
for building libpng and zlib
|
||||||
of project files for building libpng and
|
netware.txt => Contains instructions for downloading a set of
|
||||||
zlib on Netware.
|
project files for building libpng and zlib on
|
||||||
visualc6 => Contains a Microsoft Visual C++ (MSVC)
|
Netware.
|
||||||
workspace for building libpng and zlib
|
wince.txt => Contains instructions for downloading a Microsoft
|
||||||
visualc71 => Contains a Microsoft Visual C++ (MSVC)
|
Visual C++ (Windows CD Toolkit) workspace for
|
||||||
workspace for building libpng and zlib
|
building libpng and zlib on WindowsCE
|
||||||
wince.txt => Contains instructions for downloading a
|
|
||||||
Microsoft Visual C++ (Windows CD Toolkit)
|
|
||||||
workspace for building libpng and zlib on
|
|
||||||
WindowsCE
|
|
||||||
xcode => Contains xcode project files
|
|
||||||
scripts => Directory containing scripts for building libpng:
|
scripts => Directory containing scripts for building libpng:
|
||||||
descrip.mms => VMS makefile for MMS or MMK
|
descrip.mms => VMS makefile for MMS or MMK
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
libpng.a)
|
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||||
makefile.elf => Linux/ELF gcc makefile symbol versioning,
|
gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
creates libpng10.so.0.1.0.65)
|
makefile.linux => Linux/ELF makefile
|
||||||
makefile.linux => Linux/ELF makefile (gcc, creates
|
(gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
libpng10.so.0.1.0.65)
|
makefile.gcmmx => Linux/ELF makefile
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
(gcc, creates libpng12.so.0.1.2.41beta17,
|
||||||
libpng10.so.0.1.0.65, previously
|
uses assembler code tuned for Intel MMX platform)
|
||||||
used assembler code tuned for Intel MMX
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
platform)
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
makefile.gcc => Generic makefile (gcc, creates static
|
ansi2knr (Requires ansi2knr.c from
|
||||||
libpng.a)
|
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files
|
|
||||||
with ansi2knr (Requires ansi2knr.c from
|
|
||||||
ftp://ftp.cs.wisc.edu/ghost)
|
ftp://ftp.cs.wisc.edu/ghost)
|
||||||
makefile.aix => AIX makefile
|
makefile.aix => AIX makefile
|
||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
@@ -227,21 +212,20 @@ Files in this distribution:
|
|||||||
makefile.hpgcc => HPUX makefile using gcc
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
||||||
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit
|
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2
|
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||||
(static)
|
|
||||||
makefile.intel => Intel C/C++ version 4.0 and later
|
makefile.intel => Intel C/C++ version 4.0 and later
|
||||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||||
makefile.netbsd => NetBSD/cc makefile, makes libpng.so.
|
makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
|
||||||
makefile.ne10bsd => NetBSD/cc makefile, makes libpng10.so
|
makefile.ne12bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng12.so
|
||||||
makefile.openbsd => OpenBSD makefile
|
makefile.openbsd => OpenBSD makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics
|
makefile.sggcc => Silicon Graphics
|
||||||
(gcc, creates libpng10.so.0.1.0.65)
|
(gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile
|
makefile.solaris => Solaris 2.X makefile
|
||||||
(gcc, creates libpng10.so.0.1.0.65)
|
(gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
makefile.so9 => Solaris 9 makefile
|
makefile.so9 => Solaris 9 makefile
|
||||||
(gcc, creates libpng10.so.0.1.0.65)
|
(gcc, creates libpng12.so.0.1.2.41beta17)
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
@@ -259,8 +243,8 @@ Files in this distribution:
|
|||||||
makefile.dj2 => DJGPP 2 makefile
|
makefile.dj2 => DJGPP 2 makefile
|
||||||
makefile.msc => Microsoft C makefile
|
makefile.msc => Microsoft C makefile
|
||||||
makefile.vcawin32=> makefile for Microsoft Visual C++ 5.0 and
|
makefile.vcawin32=> makefile for Microsoft Visual C++ 5.0 and
|
||||||
later (previously used assembler code tuned
|
later (uses assembler code tuned for Intel MMX
|
||||||
for Intel MMX platform)
|
platform)
|
||||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and
|
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and
|
||||||
later (does not use assembler code)
|
later (does not use assembler code)
|
||||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||||
@@ -271,7 +255,7 @@ Files in this distribution:
|
|||||||
|
|
||||||
Good luck, and happy coding.
|
Good luck, and happy coding.
|
||||||
|
|
||||||
-Glenn Randers-Pehrson (current maintainer, since 1998)
|
-Glenn Randers-Pehrson (current maintainer)
|
||||||
Internet: glennrp at users.sourceforge.net
|
Internet: glennrp at users.sourceforge.net
|
||||||
|
|
||||||
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||||
|
|||||||
4
Y2KINFO
4
Y2KINFO
@@ -1,13 +1,13 @@
|
|||||||
Y2K compliance in libpng:
|
Y2K compliance in libpng:
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
December 3, 2015
|
November 10, 2009
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.0.65 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.41beta17 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||||
|
|||||||
4762
aclocal.m4
vendored
4762
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
347
compile
347
compile
@@ -1,347 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
|
|
||||||
scriptversion=2012-10-14.11; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
|
||||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
|
|
||||||
# We need space, tab and new line, in precisely that order. Quoting is
|
|
||||||
# there to prevent tools from complaining about whitespace usage.
|
|
||||||
IFS=" "" $nl"
|
|
||||||
|
|
||||||
file_conv=
|
|
||||||
|
|
||||||
# func_file_conv build_file lazy
|
|
||||||
# Convert a $build file to $host form and store it in $file
|
|
||||||
# Currently only supports Windows hosts. If the determined conversion
|
|
||||||
# type is listed in (the comma separated) LAZY, no conversion will
|
|
||||||
# take place.
|
|
||||||
func_file_conv ()
|
|
||||||
{
|
|
||||||
file=$1
|
|
||||||
case $file in
|
|
||||||
/ | /[!/]*) # absolute file, and not a UNC file
|
|
||||||
if test -z "$file_conv"; then
|
|
||||||
# lazily determine how to convert abs files
|
|
||||||
case `uname -s` in
|
|
||||||
MINGW*)
|
|
||||||
file_conv=mingw
|
|
||||||
;;
|
|
||||||
CYGWIN*)
|
|
||||||
file_conv=cygwin
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
file_conv=wine
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
case $file_conv/,$2, in
|
|
||||||
*,$file_conv,*)
|
|
||||||
;;
|
|
||||||
mingw/*)
|
|
||||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
|
||||||
;;
|
|
||||||
cygwin/*)
|
|
||||||
file=`cygpath -m "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
wine/*)
|
|
||||||
file=`winepath -w "$file" || echo "$file"`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashL linkdir
|
|
||||||
# Make cl look for libraries in LINKDIR
|
|
||||||
func_cl_dashL ()
|
|
||||||
{
|
|
||||||
func_file_conv "$1"
|
|
||||||
if test -z "$lib_path"; then
|
|
||||||
lib_path=$file
|
|
||||||
else
|
|
||||||
lib_path="$lib_path;$file"
|
|
||||||
fi
|
|
||||||
linker_opts="$linker_opts -LIBPATH:$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_dashl library
|
|
||||||
# Do a library search-path lookup for cl
|
|
||||||
func_cl_dashl ()
|
|
||||||
{
|
|
||||||
lib=$1
|
|
||||||
found=no
|
|
||||||
save_IFS=$IFS
|
|
||||||
IFS=';'
|
|
||||||
for dir in $lib_path $LIB
|
|
||||||
do
|
|
||||||
IFS=$save_IFS
|
|
||||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.dll.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/$lib.lib"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/$lib.lib
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
if test -f "$dir/lib$lib.a"; then
|
|
||||||
found=yes
|
|
||||||
lib=$dir/lib$lib.a
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS=$save_IFS
|
|
||||||
|
|
||||||
if test "$found" != yes; then
|
|
||||||
lib=$lib.lib
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# func_cl_wrapper cl arg...
|
|
||||||
# Adjust compile command to suit cl
|
|
||||||
func_cl_wrapper ()
|
|
||||||
{
|
|
||||||
# Assume a capable shell
|
|
||||||
lib_path=
|
|
||||||
shared=:
|
|
||||||
linker_opts=
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.[oO][bB][jJ])
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fo"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
func_file_conv "$2"
|
|
||||||
set x "$@" -Fe"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
-I)
|
|
||||||
eat=1
|
|
||||||
func_file_conv "$2" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-I*)
|
|
||||||
func_file_conv "${1#-I}" mingw
|
|
||||||
set x "$@" -I"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashl "$2"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-l*)
|
|
||||||
func_cl_dashl "${1#-l}"
|
|
||||||
set x "$@" "$lib"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-L)
|
|
||||||
eat=1
|
|
||||||
func_cl_dashL "$2"
|
|
||||||
;;
|
|
||||||
-L*)
|
|
||||||
func_cl_dashL "${1#-L}"
|
|
||||||
;;
|
|
||||||
-static)
|
|
||||||
shared=false
|
|
||||||
;;
|
|
||||||
-Wl,*)
|
|
||||||
arg=${1#-Wl,}
|
|
||||||
save_ifs="$IFS"; IFS=','
|
|
||||||
for flag in $arg; do
|
|
||||||
IFS="$save_ifs"
|
|
||||||
linker_opts="$linker_opts $flag"
|
|
||||||
done
|
|
||||||
IFS="$save_ifs"
|
|
||||||
;;
|
|
||||||
-Xlinker)
|
|
||||||
eat=1
|
|
||||||
linker_opts="$linker_opts $2"
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
|
||||||
func_file_conv "$1"
|
|
||||||
set x "$@" -Tp"$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
|
||||||
func_file_conv "$1" mingw
|
|
||||||
set x "$@" "$file"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
if test -n "$linker_opts"; then
|
|
||||||
linker_opts="-link$linker_opts"
|
|
||||||
fi
|
|
||||||
exec "$@" $linker_opts
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
eat=
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
'')
|
|
||||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
|
||||||
exit 1;
|
|
||||||
;;
|
|
||||||
-h | --h*)
|
|
||||||
cat <<\EOF
|
|
||||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
|
||||||
|
|
||||||
Wrapper for compilers which do not understand '-c -o'.
|
|
||||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
|
||||||
arguments, and rename the output as expected.
|
|
||||||
|
|
||||||
If you are trying to build a whole package this is not the
|
|
||||||
right script to run: please start by reading the file 'INSTALL'.
|
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
|
||||||
EOF
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
-v | --v*)
|
|
||||||
echo "compile $scriptversion"
|
|
||||||
exit $?
|
|
||||||
;;
|
|
||||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
|
||||||
func_cl_wrapper "$@" # Doesn't return...
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
ofile=
|
|
||||||
cfile=
|
|
||||||
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$eat"; then
|
|
||||||
eat=
|
|
||||||
else
|
|
||||||
case $1 in
|
|
||||||
-o)
|
|
||||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
|
||||||
# So we strip '-o arg' only if arg is an object.
|
|
||||||
eat=1
|
|
||||||
case $2 in
|
|
||||||
*.o | *.obj)
|
|
||||||
ofile=$2
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" -o "$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*.c)
|
|
||||||
cfile=$1
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set x "$@" "$1"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -z "$ofile" || test -z "$cfile"; then
|
|
||||||
# If no '-o' option was seen then we might have been invoked from a
|
|
||||||
# pattern rule where we don't need one. That is ok -- this is a
|
|
||||||
# normal compilation that the losing compiler can handle. If no
|
|
||||||
# '.c' file was seen then we are probably linking. That is also
|
|
||||||
# ok.
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Name of file we expect compiler to create.
|
|
||||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
|
||||||
|
|
||||||
# Create the lock directory.
|
|
||||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
|
||||||
# that we are using for the .o file. Also, base the name on the expected
|
|
||||||
# object file name, since that is what matters with a parallel build.
|
|
||||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
|
||||||
while true; do
|
|
||||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
# FIXME: race condition here if user kills between mkdir and trap.
|
|
||||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
|
||||||
|
|
||||||
# Run the compile.
|
|
||||||
"$@"
|
|
||||||
ret=$?
|
|
||||||
|
|
||||||
if test -f "$cofile"; then
|
|
||||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
|
||||||
elif test -f "${cofile}bj"; then
|
|
||||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rmdir "$lockdir"
|
|
||||||
exit $ret
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
||||||
566
config.guess
vendored
566
config.guess
vendored
@@ -1,12 +1,14 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Attempt to guess a canonical system name.
|
# Attempt to guess a canonical system name.
|
||||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
|
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2014-11-04'
|
timestamp='2009-04-27'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation; either version 3 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful, but
|
||||||
@@ -15,23 +17,27 @@ timestamp='2014-11-04'
|
|||||||
# General Public License for more details.
|
# General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that
|
# the same distribution terms that you use for the rest of that program.
|
||||||
# program. This Exception is an additional permission under section 7
|
|
||||||
# of the GNU General Public License, version 3 ("GPLv3").
|
|
||||||
#
|
|
||||||
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
|
|
||||||
#
|
|
||||||
# You can get the latest version of this script from:
|
|
||||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
|
||||||
#
|
|
||||||
# Please send patches to <config-patches@gnu.org>.
|
|
||||||
|
|
||||||
|
|
||||||
|
# Originally written by Per Bothner <per@bothner.com>.
|
||||||
|
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||||
|
# diff and a properly formatted ChangeLog entry.
|
||||||
|
#
|
||||||
|
# This script attempts to guess a canonical system name similar to
|
||||||
|
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||||
|
# exits with 0. Otherwise, it exits with 1.
|
||||||
|
#
|
||||||
|
# The plan is that this can be called by configure scripts if you
|
||||||
|
# don't specify an explicit build system type.
|
||||||
|
|
||||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||||
|
|
||||||
usage="\
|
usage="\
|
||||||
@@ -50,7 +56,8 @@ version="\
|
|||||||
GNU config.guess ($timestamp)
|
GNU config.guess ($timestamp)
|
||||||
|
|
||||||
Originally written by Per Bothner.
|
Originally written by Per Bothner.
|
||||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||||
|
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
@@ -132,33 +139,12 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
|||||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||||
|
|
||||||
case "${UNAME_SYSTEM}" in
|
|
||||||
Linux|GNU|GNU/*)
|
|
||||||
# If the system lacks a compiler, then just pick glibc.
|
|
||||||
# We could probably try harder.
|
|
||||||
LIBC=gnu
|
|
||||||
|
|
||||||
eval $set_cc_for_build
|
|
||||||
cat <<-EOF > $dummy.c
|
|
||||||
#include <features.h>
|
|
||||||
#if defined(__UCLIBC__)
|
|
||||||
LIBC=uclibc
|
|
||||||
#elif defined(__dietlibc__)
|
|
||||||
LIBC=dietlibc
|
|
||||||
#else
|
|
||||||
LIBC=gnu
|
|
||||||
#endif
|
|
||||||
EOF
|
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Note: order is significant - the case branches are not exclusive.
|
# Note: order is significant - the case branches are not exclusive.
|
||||||
|
|
||||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||||
*:NetBSD:*:*)
|
*:NetBSD:*:*)
|
||||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||||
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
|
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||||
# switched to ELF, *-*-netbsd* would select the old
|
# switched to ELF, *-*-netbsd* would select the old
|
||||||
# object file format. This provides both forward
|
# object file format. This provides both forward
|
||||||
@@ -184,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||||
eval $set_cc_for_build
|
eval $set_cc_for_build
|
||||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||||
| grep -q __ELF__
|
| grep __ELF__ >/dev/null
|
||||||
then
|
then
|
||||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||||
# Return netbsd for either. FIX?
|
# Return netbsd for either. FIX?
|
||||||
@@ -215,10 +201,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||||
echo "${machine}-${os}${release}"
|
echo "${machine}-${os}${release}"
|
||||||
exit ;;
|
exit ;;
|
||||||
*:Bitrig:*:*)
|
|
||||||
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
|
|
||||||
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
|
|
||||||
exit ;;
|
|
||||||
*:OpenBSD:*:*)
|
*:OpenBSD:*:*)
|
||||||
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
|
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
|
||||||
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
|
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
|
||||||
@@ -287,10 +269,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
# A Xn.n version is an unreleased experimental baselevel.
|
# A Xn.n version is an unreleased experimental baselevel.
|
||||||
# 1.2 uses "1.2" for uname -r.
|
# 1.2 uses "1.2" for uname -r.
|
||||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||||
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
|
exit ;;
|
||||||
exitcode=$?
|
|
||||||
trap '' 0
|
|
||||||
exit $exitcode ;;
|
|
||||||
Alpha\ *:Windows_NT*:*)
|
Alpha\ *:Windows_NT*:*)
|
||||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||||
@@ -321,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
arm*:riscos:*:*|arm*:RISCOS:*:*)
|
arm:riscos:*:*|arm:RISCOS:*:*)
|
||||||
echo arm-unknown-riscos
|
echo arm-unknown-riscos
|
||||||
exit ;;
|
exit ;;
|
||||||
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
||||||
@@ -354,9 +333,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||||
exit ;;
|
exit ;;
|
||||||
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
|
|
||||||
echo i386-pc-auroraux${UNAME_RELEASE}
|
|
||||||
exit ;;
|
|
||||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||||
eval $set_cc_for_build
|
eval $set_cc_for_build
|
||||||
SUN_ARCH="i386"
|
SUN_ARCH="i386"
|
||||||
@@ -572,16 +548,15 @@ EOF
|
|||||||
echo rs6000-ibm-aix3.2
|
echo rs6000-ibm-aix3.2
|
||||||
fi
|
fi
|
||||||
exit ;;
|
exit ;;
|
||||||
*:AIX:*:[4567])
|
*:AIX:*:[456])
|
||||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||||
IBM_ARCH=rs6000
|
IBM_ARCH=rs6000
|
||||||
else
|
else
|
||||||
IBM_ARCH=powerpc
|
IBM_ARCH=powerpc
|
||||||
fi
|
fi
|
||||||
if [ -x /usr/bin/lslpp ] ; then
|
if [ -x /usr/bin/oslevel ] ; then
|
||||||
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
|
IBM_REV=`/usr/bin/oslevel`
|
||||||
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
|
|
||||||
else
|
else
|
||||||
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
|
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
|
||||||
fi
|
fi
|
||||||
@@ -681,7 +656,7 @@ EOF
|
|||||||
# => hppa64-hp-hpux11.23
|
# => hppa64-hp-hpux11.23
|
||||||
|
|
||||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
||||||
grep -q __LP64__
|
grep __LP64__ >/dev/null
|
||||||
then
|
then
|
||||||
HP_ARCH="hppa2.0w"
|
HP_ARCH="hppa2.0w"
|
||||||
else
|
else
|
||||||
@@ -810,26 +785,21 @@ EOF
|
|||||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
*:FreeBSD:*:*)
|
*:FreeBSD:*:*)
|
||||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
case ${UNAME_MACHINE} in
|
||||||
case ${UNAME_PROCESSOR} in
|
pc98)
|
||||||
|
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||||
amd64)
|
amd64)
|
||||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||||
*)
|
*)
|
||||||
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||||
esac
|
esac
|
||||||
exit ;;
|
exit ;;
|
||||||
i*:CYGWIN*:*)
|
i*:CYGWIN*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-cygwin
|
echo ${UNAME_MACHINE}-pc-cygwin
|
||||||
exit ;;
|
exit ;;
|
||||||
*:MINGW64*:*)
|
|
||||||
echo ${UNAME_MACHINE}-pc-mingw64
|
|
||||||
exit ;;
|
|
||||||
*:MINGW*:*)
|
*:MINGW*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-mingw32
|
echo ${UNAME_MACHINE}-pc-mingw32
|
||||||
exit ;;
|
exit ;;
|
||||||
*:MSYS*:*)
|
|
||||||
echo ${UNAME_MACHINE}-pc-msys
|
|
||||||
exit ;;
|
|
||||||
i*:windows32*:*)
|
i*:windows32*:*)
|
||||||
# uname -m includes "-pc" on this system.
|
# uname -m includes "-pc" on this system.
|
||||||
echo ${UNAME_MACHINE}-mingw32
|
echo ${UNAME_MACHINE}-mingw32
|
||||||
@@ -837,12 +807,12 @@ EOF
|
|||||||
i*:PW*:*)
|
i*:PW*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-pw32
|
echo ${UNAME_MACHINE}-pc-pw32
|
||||||
exit ;;
|
exit ;;
|
||||||
*:Interix*:*)
|
*:Interix*:[3456]*)
|
||||||
case ${UNAME_MACHINE} in
|
case ${UNAME_MACHINE} in
|
||||||
x86)
|
x86)
|
||||||
echo i586-pc-interix${UNAME_RELEASE}
|
echo i586-pc-interix${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
authenticamd | genuineintel | EM64T)
|
EM64T | authenticamd | genuineintel)
|
||||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
IA64)
|
IA64)
|
||||||
@@ -852,9 +822,6 @@ EOF
|
|||||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||||
echo i${UNAME_MACHINE}-pc-mks
|
echo i${UNAME_MACHINE}-pc-mks
|
||||||
exit ;;
|
exit ;;
|
||||||
8664:Windows_NT:*)
|
|
||||||
echo x86_64-pc-mks
|
|
||||||
exit ;;
|
|
||||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||||
@@ -875,21 +842,100 @@ EOF
|
|||||||
exit ;;
|
exit ;;
|
||||||
*:GNU:*:*)
|
*:GNU:*:*)
|
||||||
# the GNU system
|
# the GNU system
|
||||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||||
exit ;;
|
exit ;;
|
||||||
*:GNU/*:*:*)
|
*:GNU/*:*:*)
|
||||||
# other systems with GNU libc and userland
|
# other systems with GNU libc and userland
|
||||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
i*86:Minix:*:*)
|
i*86:Minix:*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-minix
|
echo ${UNAME_MACHINE}-pc-minix
|
||||||
exit ;;
|
exit ;;
|
||||||
aarch64:Linux:*:*)
|
arm*:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
eval $set_cc_for_build
|
||||||
|
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||||
|
| grep -q __ARM_EABI__
|
||||||
|
then
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
|
else
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||||
|
fi
|
||||||
exit ;;
|
exit ;;
|
||||||
aarch64_be:Linux:*:*)
|
avr32*:Linux:*:*)
|
||||||
UNAME_MACHINE=aarch64_be
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
exit ;;
|
||||||
|
cris:Linux:*:*)
|
||||||
|
echo cris-axis-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
crisv32:Linux:*:*)
|
||||||
|
echo crisv32-axis-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
frv:Linux:*:*)
|
||||||
|
echo frv-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
ia64:Linux:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
m32r*:Linux:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
m68*:Linux:*:*)
|
||||||
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
mips:Linux:*:*)
|
||||||
|
eval $set_cc_for_build
|
||||||
|
sed 's/^ //' << EOF >$dummy.c
|
||||||
|
#undef CPU
|
||||||
|
#undef mips
|
||||||
|
#undef mipsel
|
||||||
|
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||||
|
CPU=mipsel
|
||||||
|
#else
|
||||||
|
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||||
|
CPU=mips
|
||||||
|
#else
|
||||||
|
CPU=
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||||
|
/^CPU/{
|
||||||
|
s: ::g
|
||||||
|
p
|
||||||
|
}'`"
|
||||||
|
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||||
|
;;
|
||||||
|
mips64:Linux:*:*)
|
||||||
|
eval $set_cc_for_build
|
||||||
|
sed 's/^ //' << EOF >$dummy.c
|
||||||
|
#undef CPU
|
||||||
|
#undef mips64
|
||||||
|
#undef mips64el
|
||||||
|
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||||
|
CPU=mips64el
|
||||||
|
#else
|
||||||
|
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||||
|
CPU=mips64
|
||||||
|
#else
|
||||||
|
CPU=
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||||
|
/^CPU/{
|
||||||
|
s: ::g
|
||||||
|
p
|
||||||
|
}'`"
|
||||||
|
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||||
|
;;
|
||||||
|
or32:Linux:*:*)
|
||||||
|
echo or32-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
ppc:Linux:*:*)
|
||||||
|
echo powerpc-unknown-linux-gnu
|
||||||
|
exit ;;
|
||||||
|
ppc64:Linux:*:*)
|
||||||
|
echo powerpc64-unknown-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
alpha:Linux:*:*)
|
alpha:Linux:*:*)
|
||||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||||
@@ -901,131 +947,105 @@ EOF
|
|||||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||||
esac
|
esac
|
||||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||||
exit ;;
|
|
||||||
arc:Linux:*:* | arceb:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
arm*:Linux:*:*)
|
|
||||||
eval $set_cc_for_build
|
|
||||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
|
||||||
| grep -q __ARM_EABI__
|
|
||||||
then
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
else
|
|
||||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
|
||||||
| grep -q __ARM_PCS_VFP
|
|
||||||
then
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
|
|
||||||
else
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
exit ;;
|
|
||||||
avr32*:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
cris:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
crisv32:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
frv:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
hexagon:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
i*86:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
ia64:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
m32r*:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
m68*:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
mips:Linux:*:* | mips64:Linux:*:*)
|
|
||||||
eval $set_cc_for_build
|
|
||||||
sed 's/^ //' << EOF >$dummy.c
|
|
||||||
#undef CPU
|
|
||||||
#undef ${UNAME_MACHINE}
|
|
||||||
#undef ${UNAME_MACHINE}el
|
|
||||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
|
||||||
CPU=${UNAME_MACHINE}el
|
|
||||||
#else
|
|
||||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
|
||||||
CPU=${UNAME_MACHINE}
|
|
||||||
#else
|
|
||||||
CPU=
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
EOF
|
|
||||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
|
||||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
|
||||||
;;
|
|
||||||
openrisc*:Linux:*:*)
|
|
||||||
echo or1k-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
or32:Linux:*:* | or1k*:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
exit ;;
|
||||||
padre:Linux:*:*)
|
padre:Linux:*:*)
|
||||||
echo sparc-unknown-linux-${LIBC}
|
echo sparc-unknown-linux-gnu
|
||||||
exit ;;
|
|
||||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
|
||||||
echo hppa64-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
exit ;;
|
||||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||||
# Look for CPU level
|
# Look for CPU level
|
||||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
*) echo hppa-unknown-linux-gnu ;;
|
||||||
esac
|
esac
|
||||||
exit ;;
|
exit ;;
|
||||||
ppc64:Linux:*:*)
|
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||||
echo powerpc64-unknown-linux-${LIBC}
|
echo hppa64-unknown-linux-gnu
|
||||||
exit ;;
|
|
||||||
ppc:Linux:*:*)
|
|
||||||
echo powerpc-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
ppc64le:Linux:*:*)
|
|
||||||
echo powerpc64le-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
|
||||||
ppcle:Linux:*:*)
|
|
||||||
echo powerpcle-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
exit ;;
|
||||||
s390:Linux:*:* | s390x:Linux:*:*)
|
s390:Linux:*:* | s390x:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
echo ${UNAME_MACHINE}-ibm-linux
|
||||||
exit ;;
|
exit ;;
|
||||||
sh64*:Linux:*:*)
|
sh64*:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
sh*:Linux:*:*)
|
sh*:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit ;;
|
|
||||||
tile*:Linux:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
|
||||||
exit ;;
|
exit ;;
|
||||||
vax:Linux:*:*)
|
vax:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
x86_64:Linux:*:*)
|
x86_64:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo x86_64-unknown-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
xtensa*:Linux:*:*)
|
xtensa*:Linux:*:*)
|
||||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||||
exit ;;
|
exit ;;
|
||||||
|
i*86:Linux:*:*)
|
||||||
|
# The BFD linker knows what the default object file format is, so
|
||||||
|
# first see if it will tell us. cd to the root directory to prevent
|
||||||
|
# problems with other programs or directories called `ld' in the path.
|
||||||
|
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||||
|
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||||
|
| sed -ne '/supported targets:/!d
|
||||||
|
s/[ ][ ]*/ /g
|
||||||
|
s/.*supported targets: *//
|
||||||
|
s/ .*//
|
||||||
|
p'`
|
||||||
|
case "$ld_supported_targets" in
|
||||||
|
elf32-i386)
|
||||||
|
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||||
|
;;
|
||||||
|
a.out-i386-linux)
|
||||||
|
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||||
|
exit ;;
|
||||||
|
"")
|
||||||
|
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||||
|
# one that does not give us useful --help.
|
||||||
|
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||||
|
exit ;;
|
||||||
|
esac
|
||||||
|
# Determine whether the default compiler is a.out or elf
|
||||||
|
eval $set_cc_for_build
|
||||||
|
sed 's/^ //' << EOF >$dummy.c
|
||||||
|
#include <features.h>
|
||||||
|
#ifdef __ELF__
|
||||||
|
# ifdef __GLIBC__
|
||||||
|
# if __GLIBC__ >= 2
|
||||||
|
LIBC=gnu
|
||||||
|
# else
|
||||||
|
LIBC=gnulibc1
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
LIBC=gnulibc1
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||||
|
LIBC=gnu
|
||||||
|
#else
|
||||||
|
LIBC=gnuaout
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifdef __dietlibc__
|
||||||
|
LIBC=dietlibc
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||||
|
/^LIBC/{
|
||||||
|
s: ::g
|
||||||
|
p
|
||||||
|
}'`"
|
||||||
|
test x"${LIBC}" != x && {
|
||||||
|
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||||
|
;;
|
||||||
i*86:DYNIX/ptx:4*:*)
|
i*86:DYNIX/ptx:4*:*)
|
||||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||||
# earlier versions are messed up and put the nodename in both
|
# earlier versions are messed up and put the nodename in both
|
||||||
@@ -1054,7 +1074,7 @@ EOF
|
|||||||
i*86:syllable:*:*)
|
i*86:syllable:*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-syllable
|
echo ${UNAME_MACHINE}-pc-syllable
|
||||||
exit ;;
|
exit ;;
|
||||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
|
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
i*86:*DOS:*:*)
|
i*86:*DOS:*:*)
|
||||||
@@ -1162,7 +1182,7 @@ EOF
|
|||||||
rs6000:LynxOS:2.*:*)
|
rs6000:LynxOS:2.*:*)
|
||||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
|
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
|
||||||
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
SM[BE]S:UNIX_SV:*:*)
|
SM[BE]S:UNIX_SV:*:*)
|
||||||
@@ -1228,9 +1248,6 @@ EOF
|
|||||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||||
echo i586-pc-haiku
|
echo i586-pc-haiku
|
||||||
exit ;;
|
exit ;;
|
||||||
x86_64:Haiku:*:*)
|
|
||||||
echo x86_64-unknown-haiku
|
|
||||||
exit ;;
|
|
||||||
SX-4:SUPER-UX:*:*)
|
SX-4:SUPER-UX:*:*)
|
||||||
echo sx4-nec-superux${UNAME_RELEASE}
|
echo sx4-nec-superux${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
@@ -1257,31 +1274,9 @@ EOF
|
|||||||
exit ;;
|
exit ;;
|
||||||
*:Darwin:*:*)
|
*:Darwin:*:*)
|
||||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||||
eval $set_cc_for_build
|
|
||||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
|
||||||
UNAME_PROCESSOR=powerpc
|
|
||||||
fi
|
|
||||||
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
|
|
||||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
|
||||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
|
||||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
|
||||||
grep IS_64BIT_ARCH >/dev/null
|
|
||||||
then
|
|
||||||
case $UNAME_PROCESSOR in
|
case $UNAME_PROCESSOR in
|
||||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
fi
|
|
||||||
elif test "$UNAME_PROCESSOR" = i386 ; then
|
|
||||||
# Avoid executing cc on OS X 10.9, as it ships with a stub
|
|
||||||
# that puts up a graphical alert prompting to install
|
|
||||||
# developer tools. Any system running Mac OS X 10.7 or
|
|
||||||
# later (Darwin 11 and later) is required to have a 64-bit
|
|
||||||
# processor. This is not true of the ARM version of Darwin
|
|
||||||
# that Apple uses in portable devices.
|
|
||||||
UNAME_PROCESSOR=x86_64
|
|
||||||
fi
|
|
||||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||||
@@ -1295,10 +1290,7 @@ EOF
|
|||||||
*:QNX:*:4*)
|
*:QNX:*:4*)
|
||||||
echo i386-pc-qnx
|
echo i386-pc-qnx
|
||||||
exit ;;
|
exit ;;
|
||||||
NEO-?:NONSTOP_KERNEL:*:*)
|
NSE-?:NONSTOP_KERNEL:*:*)
|
||||||
echo neo-tandem-nsk${UNAME_RELEASE}
|
|
||||||
exit ;;
|
|
||||||
NSE-*:NONSTOP_KERNEL:*:*)
|
|
||||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||||
exit ;;
|
exit ;;
|
||||||
NSR-?:NONSTOP_KERNEL:*:*)
|
NSR-?:NONSTOP_KERNEL:*:*)
|
||||||
@@ -1367,11 +1359,159 @@ EOF
|
|||||||
i*86:AROS:*:*)
|
i*86:AROS:*:*)
|
||||||
echo ${UNAME_MACHINE}-pc-aros
|
echo ${UNAME_MACHINE}-pc-aros
|
||||||
exit ;;
|
exit ;;
|
||||||
x86_64:VMkernel:*:*)
|
|
||||||
echo ${UNAME_MACHINE}-unknown-esx
|
|
||||||
exit ;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||||
|
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||||
|
|
||||||
|
eval $set_cc_for_build
|
||||||
|
cat >$dummy.c <<EOF
|
||||||
|
#ifdef _SEQUENT_
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#if defined (sony)
|
||||||
|
#if defined (MIPSEB)
|
||||||
|
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||||
|
I don't know.... */
|
||||||
|
printf ("mips-sony-bsd\n"); exit (0);
|
||||||
|
#else
|
||||||
|
#include <sys/param.h>
|
||||||
|
printf ("m68k-sony-newsos%s\n",
|
||||||
|
#ifdef NEWSOS4
|
||||||
|
"4"
|
||||||
|
#else
|
||||||
|
""
|
||||||
|
#endif
|
||||||
|
); exit (0);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||||
|
printf ("arm-acorn-riscix\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (hp300) && !defined (hpux)
|
||||||
|
printf ("m68k-hp-bsd\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (NeXT)
|
||||||
|
#if !defined (__ARCHITECTURE__)
|
||||||
|
#define __ARCHITECTURE__ "m68k"
|
||||||
|
#endif
|
||||||
|
int version;
|
||||||
|
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||||
|
if (version < 4)
|
||||||
|
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||||
|
else
|
||||||
|
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||||
|
exit (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (MULTIMAX) || defined (n16)
|
||||||
|
#if defined (UMAXV)
|
||||||
|
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||||
|
#else
|
||||||
|
#if defined (CMU)
|
||||||
|
printf ("ns32k-encore-mach\n"); exit (0);
|
||||||
|
#else
|
||||||
|
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__386BSD__)
|
||||||
|
printf ("i386-pc-bsd\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (sequent)
|
||||||
|
#if defined (i386)
|
||||||
|
printf ("i386-sequent-dynix\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
#if defined (ns32000)
|
||||||
|
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (_SEQUENT_)
|
||||||
|
struct utsname un;
|
||||||
|
|
||||||
|
uname(&un);
|
||||||
|
|
||||||
|
if (strncmp(un.version, "V2", 2) == 0) {
|
||||||
|
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||||
|
}
|
||||||
|
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||||
|
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||||
|
}
|
||||||
|
printf ("i386-sequent-ptx\n"); exit (0);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (vax)
|
||||||
|
# if !defined (ultrix)
|
||||||
|
# include <sys/param.h>
|
||||||
|
# if defined (BSD)
|
||||||
|
# if BSD == 43
|
||||||
|
printf ("vax-dec-bsd4.3\n"); exit (0);
|
||||||
|
# else
|
||||||
|
# if BSD == 199006
|
||||||
|
printf ("vax-dec-bsd4.3reno\n"); exit (0);
|
||||||
|
# else
|
||||||
|
printf ("vax-dec-bsd\n"); exit (0);
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
printf ("vax-dec-bsd\n"); exit (0);
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
printf ("vax-dec-ultrix\n"); exit (0);
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (alliant) && defined (i860)
|
||||||
|
printf ("i860-alliant-bsd\n"); exit (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
|
||||||
|
{ echo "$SYSTEM_NAME"; exit; }
|
||||||
|
|
||||||
|
# Apollos put the system type in the environment.
|
||||||
|
|
||||||
|
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
|
||||||
|
|
||||||
|
# Convex versions that predate uname can use getsysinfo(1)
|
||||||
|
|
||||||
|
if [ -x /usr/convex/getsysinfo ]
|
||||||
|
then
|
||||||
|
case `getsysinfo -f cpu_type` in
|
||||||
|
c1*)
|
||||||
|
echo c1-convex-bsd
|
||||||
|
exit ;;
|
||||||
|
c2*)
|
||||||
|
if getsysinfo -f scalar_acc
|
||||||
|
then echo c32-convex-bsd
|
||||||
|
else echo c2-convex-bsd
|
||||||
|
fi
|
||||||
|
exit ;;
|
||||||
|
c34*)
|
||||||
|
echo c34-convex-bsd
|
||||||
|
exit ;;
|
||||||
|
c38*)
|
||||||
|
echo c38-convex-bsd
|
||||||
|
exit ;;
|
||||||
|
c4*)
|
||||||
|
echo c4-convex-bsd
|
||||||
|
exit ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
$0: unable to guess system type
|
$0: unable to guess system type
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,8 @@
|
|||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||||
|
*/
|
||||||
#undef LT_OBJDIR
|
#undef LT_OBJDIR
|
||||||
|
|
||||||
/* Name of package */
|
/* Name of package */
|
||||||
|
|||||||
287
config.sub
vendored
287
config.sub
vendored
@@ -1,40 +1,44 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
|
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
|
||||||
timestamp='2014-12-03'
|
timestamp='2009-04-17'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is (in principle) common to ALL GNU software.
|
||||||
# under the terms of the GNU General Public License as published by
|
# The presence of a machine in this file suggests that SOME GNU software
|
||||||
# the Free Software Foundation; either version 3 of the License, or
|
# can handle that machine. It does not imply ALL GNU software can.
|
||||||
|
#
|
||||||
|
# This file is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful, but
|
# This program is distributed in the hope that it will be useful,
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||||
|
# 02110-1301, USA.
|
||||||
#
|
#
|
||||||
# As a special exception to the GNU General Public License, if you
|
# As a special exception to the GNU General Public License, if you
|
||||||
# distribute this file as part of a program that contains a
|
# distribute this file as part of a program that contains a
|
||||||
# configuration script generated by Autoconf, you may include it under
|
# configuration script generated by Autoconf, you may include it under
|
||||||
# the same distribution terms that you use for the rest of that
|
# the same distribution terms that you use for the rest of that program.
|
||||||
# program. This Exception is an additional permission under section 7
|
|
||||||
# of the GNU General Public License, version 3 ("GPLv3").
|
|
||||||
|
|
||||||
|
|
||||||
# Please send patches to <config-patches@gnu.org>.
|
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||||
|
# diff and a properly formatted ChangeLog entry.
|
||||||
#
|
#
|
||||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||||
# Supply the specified configuration type as an argument.
|
# Supply the specified configuration type as an argument.
|
||||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||||
|
|
||||||
# You can get the latest version of this script from:
|
|
||||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
|
||||||
|
|
||||||
# This file is supposed to be the same for all GNU packages
|
# This file is supposed to be the same for all GNU packages
|
||||||
# and recognize all the CPU types, system types and aliases
|
# and recognize all the CPU types, system types and aliases
|
||||||
# that are meaningful with *any* GNU software.
|
# that are meaningful with *any* GNU software.
|
||||||
@@ -68,7 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||||
|
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
@@ -115,18 +120,13 @@ esac
|
|||||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||||
case $maybe_os in
|
case $maybe_os in
|
||||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
|
||||||
kopensolaris*-gnu* | \
|
kopensolaris*-gnu* | \
|
||||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||||
os=-$maybe_os
|
os=-$maybe_os
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||||
;;
|
;;
|
||||||
android-linux)
|
|
||||||
os=-linux-android
|
|
||||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||||
if [ $basic_machine != $1 ]
|
if [ $basic_machine != $1 ]
|
||||||
@@ -149,13 +149,10 @@ case $os in
|
|||||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
-apple | -axis | -knuth | -cray)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
-bluegene*)
|
|
||||||
os=-cnk
|
|
||||||
;;
|
|
||||||
-sim | -cisco | -oki | -wec | -winbond)
|
-sim | -cisco | -oki | -wec | -winbond)
|
||||||
os=
|
os=
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
@@ -218,12 +215,6 @@ case $os in
|
|||||||
-isc*)
|
-isc*)
|
||||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||||
;;
|
;;
|
||||||
-lynx*178)
|
|
||||||
os=-lynxos178
|
|
||||||
;;
|
|
||||||
-lynx*5)
|
|
||||||
os=-lynxos5
|
|
||||||
;;
|
|
||||||
-lynx*)
|
-lynx*)
|
||||||
os=-lynxos
|
os=-lynxos
|
||||||
;;
|
;;
|
||||||
@@ -248,28 +239,20 @@ case $basic_machine in
|
|||||||
# Some are omitted here because they have special meanings below.
|
# Some are omitted here because they have special meanings below.
|
||||||
1750a | 580 \
|
1750a | 580 \
|
||||||
| a29k \
|
| a29k \
|
||||||
| aarch64 | aarch64_be \
|
|
||||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||||
| am33_2.0 \
|
| am33_2.0 \
|
||||||
| arc | arceb \
|
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
|
||||||
| avr | avr32 \
|
|
||||||
| be32 | be64 \
|
|
||||||
| bfin \
|
| bfin \
|
||||||
| c4x | c8051 | clipper \
|
| c4x | clipper \
|
||||||
| d10v | d30v | dlx | dsp16xx \
|
| d10v | d30v | dlx | dsp16xx \
|
||||||
| epiphany \
|
|
||||||
| fido | fr30 | frv \
|
| fido | fr30 | frv \
|
||||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||||
| hexagon \
|
|
||||||
| i370 | i860 | i960 | ia64 \
|
| i370 | i860 | i960 | ia64 \
|
||||||
| ip2k | iq2000 \
|
| ip2k | iq2000 \
|
||||||
| k1om \
|
|
||||||
| le32 | le64 \
|
|
||||||
| lm32 \
|
| lm32 \
|
||||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
| maxq | mb | microblaze | mcore | mep | metag \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||||
| mips16 \
|
| mips16 \
|
||||||
| mips64 | mips64el \
|
| mips64 | mips64el \
|
||||||
@@ -283,55 +266,36 @@ case $basic_machine in
|
|||||||
| mips64vr5900 | mips64vr5900el \
|
| mips64vr5900 | mips64vr5900el \
|
||||||
| mipsisa32 | mipsisa32el \
|
| mipsisa32 | mipsisa32el \
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
| mipsisa32r2 | mipsisa32r2el \
|
||||||
| mipsisa32r6 | mipsisa32r6el \
|
|
||||||
| mipsisa64 | mipsisa64el \
|
| mipsisa64 | mipsisa64el \
|
||||||
| mipsisa64r2 | mipsisa64r2el \
|
| mipsisa64r2 | mipsisa64r2el \
|
||||||
| mipsisa64r6 | mipsisa64r6el \
|
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
| mipsisa64sb1 | mipsisa64sb1el \
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||||
| mipsr5900 | mipsr5900el \
|
|
||||||
| mipstx39 | mipstx39el \
|
| mipstx39 | mipstx39el \
|
||||||
| mn10200 | mn10300 \
|
| mn10200 | mn10300 \
|
||||||
| moxie \
|
| moxie \
|
||||||
| mt \
|
| mt \
|
||||||
| msp430 \
|
| msp430 \
|
||||||
| nds32 | nds32le | nds32be \
|
| nios | nios2 \
|
||||||
| nios | nios2 | nios2eb | nios2el \
|
|
||||||
| ns16k | ns32k \
|
| ns16k | ns32k \
|
||||||
| open8 | or1k | or1knd | or32 \
|
| or32 \
|
||||||
| pdp10 | pdp11 | pj | pjl \
|
| pdp10 | pdp11 | pj | pjl \
|
||||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||||
| pyramid \
|
| pyramid \
|
||||||
| riscv32 | riscv64 \
|
|
||||||
| rl78 | rx \
|
|
||||||
| score \
|
| score \
|
||||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||||
| sh64 | sh64le \
|
| sh64 | sh64le \
|
||||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||||
| spu \
|
| spu | strongarm \
|
||||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
| tahoe | thumb | tic4x | tic80 | tron \
|
||||||
| ubicom32 \
|
| v850 | v850e \
|
||||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
|
||||||
| visium \
|
|
||||||
| we32k \
|
| we32k \
|
||||||
| x86 | xc16x | xstormy16 | xtensa \
|
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||||
| z8k | z80)
|
| z8k | z80)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
;;
|
;;
|
||||||
c54x)
|
m6811 | m68hc11 | m6812 | m68hc12)
|
||||||
basic_machine=tic54x-unknown
|
# Motorola 68HC11/12.
|
||||||
;;
|
|
||||||
c55x)
|
|
||||||
basic_machine=tic55x-unknown
|
|
||||||
;;
|
|
||||||
c6x)
|
|
||||||
basic_machine=tic6x-unknown
|
|
||||||
;;
|
|
||||||
leon|leon[3-9])
|
|
||||||
basic_machine=sparc-$basic_machine
|
|
||||||
;;
|
|
||||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=$basic_machine-unknown
|
||||||
os=-none
|
os=-none
|
||||||
;;
|
;;
|
||||||
@@ -341,21 +305,6 @@ case $basic_machine in
|
|||||||
basic_machine=mt-unknown
|
basic_machine=mt-unknown
|
||||||
;;
|
;;
|
||||||
|
|
||||||
strongarm | thumb | xscale)
|
|
||||||
basic_machine=arm-unknown
|
|
||||||
;;
|
|
||||||
xgate)
|
|
||||||
basic_machine=$basic_machine-unknown
|
|
||||||
os=-none
|
|
||||||
;;
|
|
||||||
xscaleeb)
|
|
||||||
basic_machine=armeb-unknown
|
|
||||||
;;
|
|
||||||
|
|
||||||
xscaleel)
|
|
||||||
basic_machine=armel-unknown
|
|
||||||
;;
|
|
||||||
|
|
||||||
# We use `pc' rather than `unknown'
|
# We use `pc' rather than `unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
# (2) the word "unknown" tends to confuse beginning users.
|
# (2) the word "unknown" tends to confuse beginning users.
|
||||||
@@ -370,31 +319,25 @@ case $basic_machine in
|
|||||||
# Recognize the basic CPU types with company name.
|
# Recognize the basic CPU types with company name.
|
||||||
580-* \
|
580-* \
|
||||||
| a29k-* \
|
| a29k-* \
|
||||||
| aarch64-* | aarch64_be-* \
|
|
||||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||||
| avr-* | avr32-* \
|
| avr-* | avr32-* \
|
||||||
| be32-* | be64-* \
|
|
||||||
| bfin-* | bs2000-* \
|
| bfin-* | bs2000-* \
|
||||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
| clipper-* | craynv-* | cydra-* \
|
||||||
| d10v-* | d30v-* | dlx-* \
|
| d10v-* | d30v-* | dlx-* \
|
||||||
| elxsi-* \
|
| elxsi-* \
|
||||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||||
| h8300-* | h8500-* \
|
| h8300-* | h8500-* \
|
||||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||||
| hexagon-* \
|
|
||||||
| i*86-* | i860-* | i960-* | ia64-* \
|
| i*86-* | i860-* | i960-* | ia64-* \
|
||||||
| ip2k-* | iq2000-* \
|
| ip2k-* | iq2000-* \
|
||||||
| k1om-* \
|
|
||||||
| le32-* | le64-* \
|
|
||||||
| lm32-* \
|
| lm32-* \
|
||||||
| m32c-* | m32r-* | m32rle-* \
|
| m32c-* | m32r-* | m32rle-* \
|
||||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||||
| microblaze-* | microblazeel-* \
|
|
||||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||||
| mips16-* \
|
| mips16-* \
|
||||||
| mips64-* | mips64el-* \
|
| mips64-* | mips64el-* \
|
||||||
@@ -408,42 +351,32 @@ case $basic_machine in
|
|||||||
| mips64vr5900-* | mips64vr5900el-* \
|
| mips64vr5900-* | mips64vr5900el-* \
|
||||||
| mipsisa32-* | mipsisa32el-* \
|
| mipsisa32-* | mipsisa32el-* \
|
||||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
|
||||||
| mipsisa64-* | mipsisa64el-* \
|
| mipsisa64-* | mipsisa64el-* \
|
||||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
|
||||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||||
| mipsr5900-* | mipsr5900el-* \
|
|
||||||
| mipstx39-* | mipstx39el-* \
|
| mipstx39-* | mipstx39el-* \
|
||||||
| mmix-* \
|
| mmix-* \
|
||||||
| mt-* \
|
| mt-* \
|
||||||
| msp430-* \
|
| msp430-* \
|
||||||
| nds32-* | nds32le-* | nds32be-* \
|
| nios-* | nios2-* \
|
||||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
|
||||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||||
| open8-* \
|
|
||||||
| or1k*-* \
|
|
||||||
| orion-* \
|
| orion-* \
|
||||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||||
| pyramid-* \
|
| pyramid-* \
|
||||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
| romp-* | rs6000-* \
|
||||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||||
| sparclite-* \
|
| sparclite-* \
|
||||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||||
| tahoe-* \
|
| tahoe-* | thumb-* \
|
||||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||||
| tile*-* \
|
|
||||||
| tron-* \
|
| tron-* \
|
||||||
| ubicom32-* \
|
| v850-* | v850e-* | vax-* \
|
||||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
|
||||||
| vax-* \
|
|
||||||
| visium-* \
|
|
||||||
| we32k-* \
|
| we32k-* \
|
||||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||||
| xstormy16-* | xtensa*-* \
|
| xstormy16-* | xtensa*-* \
|
||||||
| ymp-* \
|
| ymp-* \
|
||||||
| z8k-* | z80-*)
|
| z8k-* | z80-*)
|
||||||
@@ -534,19 +467,6 @@ case $basic_machine in
|
|||||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
os=-linux
|
os=-linux
|
||||||
;;
|
;;
|
||||||
bluegene*)
|
|
||||||
basic_machine=powerpc-ibm
|
|
||||||
os=-cnk
|
|
||||||
;;
|
|
||||||
c54x-*)
|
|
||||||
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
c55x-*)
|
|
||||||
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
c6x-*)
|
|
||||||
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
c90)
|
c90)
|
||||||
basic_machine=c90-cray
|
basic_machine=c90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
@@ -583,7 +503,7 @@ case $basic_machine in
|
|||||||
basic_machine=craynv-cray
|
basic_machine=craynv-cray
|
||||||
os=-unicosmp
|
os=-unicosmp
|
||||||
;;
|
;;
|
||||||
cr16 | cr16-*)
|
cr16)
|
||||||
basic_machine=cr16-unknown
|
basic_machine=cr16-unknown
|
||||||
os=-elf
|
os=-elf
|
||||||
;;
|
;;
|
||||||
@@ -741,6 +661,7 @@ case $basic_machine in
|
|||||||
i370-ibm* | ibm*)
|
i370-ibm* | ibm*)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
;;
|
;;
|
||||||
|
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||||
i*86v32)
|
i*86v32)
|
||||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||||
os=-sysv32
|
os=-sysv32
|
||||||
@@ -779,9 +700,6 @@ case $basic_machine in
|
|||||||
basic_machine=m68k-isi
|
basic_machine=m68k-isi
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
leon-*|leon[3-9]-*)
|
|
||||||
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
|
|
||||||
;;
|
|
||||||
m68knommu)
|
m68knommu)
|
||||||
basic_machine=m68k-unknown
|
basic_machine=m68k-unknown
|
||||||
os=-linux
|
os=-linux
|
||||||
@@ -801,15 +719,8 @@ case $basic_machine in
|
|||||||
basic_machine=ns32k-utek
|
basic_machine=ns32k-utek
|
||||||
os=-sysv
|
os=-sysv
|
||||||
;;
|
;;
|
||||||
microblaze*)
|
|
||||||
basic_machine=microblaze-xilinx
|
|
||||||
;;
|
|
||||||
mingw64)
|
|
||||||
basic_machine=x86_64-pc
|
|
||||||
os=-mingw64
|
|
||||||
;;
|
|
||||||
mingw32)
|
mingw32)
|
||||||
basic_machine=i686-pc
|
basic_machine=i386-pc
|
||||||
os=-mingw32
|
os=-mingw32
|
||||||
;;
|
;;
|
||||||
mingw32ce)
|
mingw32ce)
|
||||||
@@ -837,10 +748,6 @@ case $basic_machine in
|
|||||||
basic_machine=powerpc-unknown
|
basic_machine=powerpc-unknown
|
||||||
os=-morphos
|
os=-morphos
|
||||||
;;
|
;;
|
||||||
moxiebox)
|
|
||||||
basic_machine=moxie-unknown
|
|
||||||
os=-moxiebox
|
|
||||||
;;
|
|
||||||
msdos)
|
msdos)
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-msdos
|
os=-msdos
|
||||||
@@ -848,18 +755,10 @@ case $basic_machine in
|
|||||||
ms1-*)
|
ms1-*)
|
||||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||||
;;
|
;;
|
||||||
msys)
|
|
||||||
basic_machine=i686-pc
|
|
||||||
os=-msys
|
|
||||||
;;
|
|
||||||
mvs)
|
mvs)
|
||||||
basic_machine=i370-ibm
|
basic_machine=i370-ibm
|
||||||
os=-mvs
|
os=-mvs
|
||||||
;;
|
;;
|
||||||
nacl)
|
|
||||||
basic_machine=le32-unknown
|
|
||||||
os=-nacl
|
|
||||||
;;
|
|
||||||
ncr3000)
|
ncr3000)
|
||||||
basic_machine=i486-ncr
|
basic_machine=i486-ncr
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
@@ -924,12 +823,6 @@ case $basic_machine in
|
|||||||
np1)
|
np1)
|
||||||
basic_machine=np1-gould
|
basic_machine=np1-gould
|
||||||
;;
|
;;
|
||||||
neo-tandem)
|
|
||||||
basic_machine=neo-tandem
|
|
||||||
;;
|
|
||||||
nse-tandem)
|
|
||||||
basic_machine=nse-tandem
|
|
||||||
;;
|
|
||||||
nsr-tandem)
|
nsr-tandem)
|
||||||
basic_machine=nsr-tandem
|
basic_machine=nsr-tandem
|
||||||
;;
|
;;
|
||||||
@@ -1012,10 +905,9 @@ case $basic_machine in
|
|||||||
;;
|
;;
|
||||||
power) basic_machine=power-ibm
|
power) basic_machine=power-ibm
|
||||||
;;
|
;;
|
||||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
ppc) basic_machine=powerpc-unknown
|
||||||
;;
|
;;
|
||||||
ppc-* | ppcbe-*)
|
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
;;
|
||||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||||
basic_machine=powerpcle-unknown
|
basic_machine=powerpcle-unknown
|
||||||
@@ -1040,11 +932,7 @@ case $basic_machine in
|
|||||||
basic_machine=i586-unknown
|
basic_machine=i586-unknown
|
||||||
os=-pw32
|
os=-pw32
|
||||||
;;
|
;;
|
||||||
rdos | rdos64)
|
rdos)
|
||||||
basic_machine=x86_64-pc
|
|
||||||
os=-rdos
|
|
||||||
;;
|
|
||||||
rdos32)
|
|
||||||
basic_machine=i386-pc
|
basic_machine=i386-pc
|
||||||
os=-rdos
|
os=-rdos
|
||||||
;;
|
;;
|
||||||
@@ -1113,9 +1001,6 @@ case $basic_machine in
|
|||||||
basic_machine=i860-stratus
|
basic_machine=i860-stratus
|
||||||
os=-sysv4
|
os=-sysv4
|
||||||
;;
|
;;
|
||||||
strongarm-* | thumb-*)
|
|
||||||
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
|
||||||
;;
|
|
||||||
sun2)
|
sun2)
|
||||||
basic_machine=m68000-sun
|
basic_machine=m68000-sun
|
||||||
;;
|
;;
|
||||||
@@ -1172,8 +1057,20 @@ case $basic_machine in
|
|||||||
basic_machine=t90-cray
|
basic_machine=t90-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
;;
|
;;
|
||||||
|
tic54x | c54x*)
|
||||||
|
basic_machine=tic54x-unknown
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
|
tic55x | c55x*)
|
||||||
|
basic_machine=tic55x-unknown
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
|
tic6x | c6x*)
|
||||||
|
basic_machine=tic6x-unknown
|
||||||
|
os=-coff
|
||||||
|
;;
|
||||||
tile*)
|
tile*)
|
||||||
basic_machine=$basic_machine-unknown
|
basic_machine=tile-unknown
|
||||||
os=-linux-gnu
|
os=-linux-gnu
|
||||||
;;
|
;;
|
||||||
tx39)
|
tx39)
|
||||||
@@ -1243,9 +1140,6 @@ case $basic_machine in
|
|||||||
xps | xps100)
|
xps | xps100)
|
||||||
basic_machine=xps100-honeywell
|
basic_machine=xps100-honeywell
|
||||||
;;
|
;;
|
||||||
xscale-* | xscalee[bl]-*)
|
|
||||||
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
|
||||||
;;
|
|
||||||
ymp)
|
ymp)
|
||||||
basic_machine=ymp-cray
|
basic_machine=ymp-cray
|
||||||
os=-unicos
|
os=-unicos
|
||||||
@@ -1346,9 +1240,6 @@ case $os in
|
|||||||
# First match some system type aliases
|
# First match some system type aliases
|
||||||
# that might get confused with valid system types.
|
# that might get confused with valid system types.
|
||||||
# -solaris* is a basic system type, with this one exception.
|
# -solaris* is a basic system type, with this one exception.
|
||||||
-auroraux)
|
|
||||||
os=-auroraux
|
|
||||||
;;
|
|
||||||
-solaris1 | -solaris1.*)
|
-solaris1 | -solaris1.*)
|
||||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||||
;;
|
;;
|
||||||
@@ -1369,31 +1260,30 @@ case $os in
|
|||||||
# Each alternative MUST END IN A *, to match a version number.
|
# Each alternative MUST END IN A *, to match a version number.
|
||||||
# -sysv* is not here because it comes later, after sysvr4.
|
# -sysv* is not here because it comes later, after sysvr4.
|
||||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||||
| -sym* | -kopensolaris* | -plan9* \
|
| -kopensolaris* \
|
||||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||||
| -aos* | -aros* \
|
| -aos* | -aros* \
|
||||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||||
| -bitrig* | -openbsd* | -solidbsd* \
|
| -openbsd* | -solidbsd* \
|
||||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||||
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||||
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
|
|
||||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
|
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||||
# Remember, each alternative MUST END IN *, to match a version number.
|
# Remember, each alternative MUST END IN *, to match a version number.
|
||||||
;;
|
;;
|
||||||
-qnx*)
|
-qnx*)
|
||||||
@@ -1517,14 +1407,15 @@ case $os in
|
|||||||
-aros*)
|
-aros*)
|
||||||
os=-aros
|
os=-aros
|
||||||
;;
|
;;
|
||||||
|
-kaos*)
|
||||||
|
os=-kaos
|
||||||
|
;;
|
||||||
-zvmoe)
|
-zvmoe)
|
||||||
os=-zvmoe
|
os=-zvmoe
|
||||||
;;
|
;;
|
||||||
-dicos*)
|
-dicos*)
|
||||||
os=-dicos
|
os=-dicos
|
||||||
;;
|
;;
|
||||||
-nacl*)
|
|
||||||
;;
|
|
||||||
-none)
|
-none)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -1565,21 +1456,6 @@ case $basic_machine in
|
|||||||
c4x-* | tic4x-*)
|
c4x-* | tic4x-*)
|
||||||
os=-coff
|
os=-coff
|
||||||
;;
|
;;
|
||||||
c8051-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
hexagon-*)
|
|
||||||
os=-elf
|
|
||||||
;;
|
|
||||||
tic54x-*)
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
tic55x-*)
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
tic6x-*)
|
|
||||||
os=-coff
|
|
||||||
;;
|
|
||||||
# This must come before the *-dec entry.
|
# This must come before the *-dec entry.
|
||||||
pdp10-*)
|
pdp10-*)
|
||||||
os=-tops20
|
os=-tops20
|
||||||
@@ -1598,6 +1474,9 @@ case $basic_machine in
|
|||||||
;;
|
;;
|
||||||
m68000-sun)
|
m68000-sun)
|
||||||
os=-sunos3
|
os=-sunos3
|
||||||
|
# This also exists in the configure program, but was not the
|
||||||
|
# default.
|
||||||
|
# os=-sunos4
|
||||||
;;
|
;;
|
||||||
m68*-cisco)
|
m68*-cisco)
|
||||||
os=-aout
|
os=-aout
|
||||||
@@ -1734,7 +1613,7 @@ case $basic_machine in
|
|||||||
-sunos*)
|
-sunos*)
|
||||||
vendor=sun
|
vendor=sun
|
||||||
;;
|
;;
|
||||||
-cnk*|-aix*)
|
-aix*)
|
||||||
vendor=ibm
|
vendor=ibm
|
||||||
;;
|
;;
|
||||||
-beos*)
|
-beos*)
|
||||||
|
|||||||
17
configure.ac
17
configure.ac
@@ -18,20 +18,20 @@ AC_PREREQ(2.59)
|
|||||||
|
|
||||||
dnl Version number stuff here:
|
dnl Version number stuff here:
|
||||||
|
|
||||||
AC_INIT([libpng], [1.0.65], [png-mng-implement@lists.sourceforge.net])
|
AC_INIT([libpng], [1.2.41beta17], [png-mng-implement@lists.sourceforge.net])
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
dnl stop configure from automagically running automake
|
dnl stop configure from automagically running automake
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
PNGLIB_VERSION=1.0.65
|
PNGLIB_VERSION=1.2.41beta17
|
||||||
PNGLIB_MAJOR=1
|
PNGLIB_MAJOR=1
|
||||||
PNGLIB_MINOR=0
|
PNGLIB_MINOR=2
|
||||||
PNGLIB_RELEASE=65
|
PNGLIB_RELEASE=41
|
||||||
|
|
||||||
dnl End of version number stuff
|
dnl End of version number stuff
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR([pngget.c])
|
AC_CONFIG_SRCDIR([pngget.c])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
@@ -59,12 +59,7 @@ AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
|
|||||||
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
||||||
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
|
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
|
||||||
|
|
||||||
case $host_os in
|
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||||
aix*)
|
|
||||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE;;
|
|
||||||
*)
|
|
||||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;;
|
|
||||||
esac
|
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
|
[if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
|
||||||
AC_TRY_COMPILE(
|
AC_TRY_COMPILE(
|
||||||
|
|||||||
@@ -214,10 +214,6 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
|||||||
* libpng function */
|
* libpng function */
|
||||||
|
|
||||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||||
free(image_data);
|
|
||||||
image_data = NULL;
|
|
||||||
free(row_pointers);
|
|
||||||
row_pointers = NULL;
|
|
||||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
9
contrib/pngminim/decoder/README
Normal file
9
contrib/pngminim/decoder/README
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||||
|
|
||||||
|
To build a minimal read-only decoder with embedded libpng and zlib, run
|
||||||
|
|
||||||
|
gather.sh # to collect needed files from pngminus, libpng, and zlib
|
||||||
|
make
|
||||||
|
|
||||||
|
If you prefer to use the shared libraries, go to contrib/pngminus
|
||||||
|
and build the png2pnm application there.
|
||||||
9
contrib/pngminim/decoder/gather.sh
Executable file
9
contrib/pngminim/decoder/gather.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
cp ../../pngminus/png2pnm.c pngm2pnm.c
|
||||||
|
cp ../../../*.h .
|
||||||
|
cp ../../../*.c .
|
||||||
|
rm pnggccrd.c pngvcrd.c
|
||||||
|
rm example.c pngtest.c pngpread.c pngw*.c
|
||||||
|
# change the following 2 lines if zlib is somewhere else
|
||||||
|
cp ../../../../zlib/*.h .
|
||||||
|
cp ../../../../zlib/*.c .
|
||||||
|
rm minigzip.c example.c compress.c deflate.c
|
||||||
44
contrib/pngminim/decoder/makefile
Normal file
44
contrib/pngminim/decoder/makefile
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# Makefile for PngMinus (pngm2pnm)
|
||||||
|
# Linux / Unix
|
||||||
|
|
||||||
|
#CC=cc
|
||||||
|
CC=gcc
|
||||||
|
LD=$(CC)
|
||||||
|
|
||||||
|
RM=rm -f
|
||||||
|
|
||||||
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
|
||||||
|
-DdeflateParams\(a,b,c\)=Z_OK -I. -O1
|
||||||
|
|
||||||
|
C=.c
|
||||||
|
O=.o
|
||||||
|
L=.a
|
||||||
|
E=
|
||||||
|
|
||||||
|
ZOBJS = adler32$(O) crc32$(O) gzio$(O) \
|
||||||
|
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
|
||||||
|
trees$(O) uncompr$(O) zutil$(O)
|
||||||
|
|
||||||
|
OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||||
|
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
|
||||||
|
pngset$(O) pngtrans$(O) $(ZOBJS)
|
||||||
|
|
||||||
|
# implicit make rules -------------------------------------------------------
|
||||||
|
|
||||||
|
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||||
|
$(CC) -c $(CFLAGS) $<
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
|
||||||
|
all: pngm2pnm$(E)
|
||||||
|
|
||||||
|
pngm2pnm$(E): $(OBJS)
|
||||||
|
$(LD) -o pngm2pnm$(E) $(OBJS)
|
||||||
|
strip pngm2pnm$(E)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) pngm2pnm$(O)
|
||||||
|
$(RM) pngm2pnm$(E)
|
||||||
|
$(RM) $(OBJS)
|
||||||
|
|
||||||
|
# End of makefile for pngm2pnm
|
||||||
78
contrib/pngminim/decoder/pngusr.h
Normal file
78
contrib/pngminim/decoder/pngusr.h
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
/* minrdpngconf.h: headers to make a minimal png-read-only library
|
||||||
|
*
|
||||||
|
* Copyright (c) 2007, 2009 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
|
||||||
|
*
|
||||||
|
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MINRDPNGCONF_H
|
||||||
|
#define MINRDPNGCONF_H
|
||||||
|
|
||||||
|
#ifdef NJET
|
||||||
|
/* No 16-bit support beyond reading with strip_16 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PNG_NO_GLOBAL_ARRAYS
|
||||||
|
|
||||||
|
#define PNG_NO_WARNINGS
|
||||||
|
#define png_warning(s1,s2) ""
|
||||||
|
#define png_chunk_warning(s1,s2) ""
|
||||||
|
#define PNG_NO_ERROR_TEXT
|
||||||
|
#define png_error(s1,s2) png_err(s1)
|
||||||
|
#define png_chunk_error(s1,s2) png_err(s1)
|
||||||
|
|
||||||
|
#define PNG_NO_ASSEMBLER_CODE
|
||||||
|
#define PNG_NO_OPTIMIZED_CODE
|
||||||
|
#define PNG_NO_READ_GAMMA
|
||||||
|
#define PNG_NO_READ_BACKGROUND
|
||||||
|
#define PNG_NO_READ_DITHER
|
||||||
|
#define PNG_NO_READ_INVERT
|
||||||
|
#define PNG_NO_READ_SHIFT
|
||||||
|
#define PNG_NO_READ_PACK
|
||||||
|
#define PNG_NO_READ_PACKSWAP
|
||||||
|
#define PNG_NO_READ_FILLER
|
||||||
|
#define PNG_NO_READ_SWAP
|
||||||
|
#define PNG_NO_READ_SWAP_ALPHA
|
||||||
|
#define PNG_NO_READ_INVERT_ALPHA
|
||||||
|
#define PNG_NO_READ_RGB_TO_GRAY
|
||||||
|
#define PNG_NO_READ_USER_TRANSFORM
|
||||||
|
#define PNG_NO_READ_bKGD
|
||||||
|
#define PNG_NO_READ_cHRM
|
||||||
|
#define PNG_NO_READ_gAMA
|
||||||
|
#define PNG_NO_READ_hIST
|
||||||
|
#define PNG_NO_READ_iCCP
|
||||||
|
#define PNG_NO_READ_pCAL
|
||||||
|
#define PNG_NO_READ_pHYs
|
||||||
|
#define PNG_NO_READ_sBIT
|
||||||
|
#define PNG_NO_READ_sCAL
|
||||||
|
#define PNG_NO_READ_sPLT
|
||||||
|
#define PNG_NO_READ_sRGB
|
||||||
|
#define PNG_NO_READ_TEXT
|
||||||
|
#define PNG_NO_READ_tIME
|
||||||
|
#define PNG_NO_READ_UNKNOWN_CHUNKS
|
||||||
|
#define PNG_NO_READ_USER_CHUNKS
|
||||||
|
#define PNG_NO_READ_EMPTY_PLTE
|
||||||
|
#define PNG_NO_READ_OPT_PLTE
|
||||||
|
#define PNG_NO_READ_STRIP_ALPHA
|
||||||
|
#define PNG_NO_READ_oFFs
|
||||||
|
#define PNG_NO_WARN_UNINITIALIZED_ROW
|
||||||
|
|
||||||
|
#define PNG_NO_WRITE_SUPPORTED
|
||||||
|
|
||||||
|
#define PNG_NO_INFO_IMAGE
|
||||||
|
#define PNG_NO_USER_MEM
|
||||||
|
#define PNG_NO_FIXED_POINT_SUPPORTED
|
||||||
|
#define PNG_NO_MNG_FEATURES
|
||||||
|
#define PNG_NO_USER_TRANSFORM_PTR
|
||||||
|
#define PNG_NO_HANDLE_AS_UNKNOWN
|
||||||
|
#define PNG_NO_CONSOLE_IO
|
||||||
|
#define PNG_NO_ZALLOC_ZERO
|
||||||
|
#define PNG_NO_ERROR_NUMBERS
|
||||||
|
#define PNG_NO_EASY_ACCESS
|
||||||
|
#define PNG_NO_PROGRESSIVE_READ
|
||||||
|
|
||||||
|
#endif /* MINRDPNGCONF_H */
|
||||||
9
contrib/pngminim/encoder/README
Normal file
9
contrib/pngminim/encoder/README
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||||
|
|
||||||
|
To build a minimal write-only decoder with embedded libpng and zlib, run
|
||||||
|
|
||||||
|
gather.sh # to collect needed files from pngminus, libpng, and zlib
|
||||||
|
make
|
||||||
|
|
||||||
|
If you prefer to use the shared libraries, go to contrib/pngminus
|
||||||
|
and build the pnm2png application there.
|
||||||
27
contrib/pngminim/encoder/dummy_inflate.c
Normal file
27
contrib/pngminim/encoder/dummy_inflate.c
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#include "zlib.h"
|
||||||
|
|
||||||
|
int ZEXPORT inflate(strm, flush)
|
||||||
|
z_streamp strm;
|
||||||
|
int flush;
|
||||||
|
{ return Z_OK ; }
|
||||||
|
|
||||||
|
int ZEXPORT inflateReset(strm)
|
||||||
|
z_streamp strm;
|
||||||
|
{ return Z_OK ; }
|
||||||
|
|
||||||
|
int ZEXPORT inflateEnd(strm)
|
||||||
|
z_streamp strm;
|
||||||
|
{ return Z_STREAM_ERROR ; }
|
||||||
|
|
||||||
|
int ZEXPORT inflateInit_(strm, version, stream_size)
|
||||||
|
z_streamp strm;
|
||||||
|
const char *version;
|
||||||
|
int stream_size;
|
||||||
|
{ return Z_OK ; }
|
||||||
|
|
||||||
|
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
|
||||||
|
z_streamp strm;
|
||||||
|
int windowBits;
|
||||||
|
const char *version;
|
||||||
|
int stream_size;
|
||||||
|
{ return Z_STREAM_ERROR ; }
|
||||||
10
contrib/pngminim/encoder/gather.sh
Executable file
10
contrib/pngminim/encoder/gather.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
||||||
|
cp ../../../*.h .
|
||||||
|
cp ../../../*.c .
|
||||||
|
rm pnggccrd.c pngvcrd.c
|
||||||
|
rm example.c pngtest.c pngr*.c pngpread.c
|
||||||
|
# Change the next 2 lines if zlib is somewhere else.
|
||||||
|
cp ../../../../zlib/*.h .
|
||||||
|
cp ../../../../zlib/*.c .
|
||||||
|
rm inf*.[ch]
|
||||||
|
rm minigzip.c example.c
|
||||||
43
contrib/pngminim/encoder/makefile
Normal file
43
contrib/pngminim/encoder/makefile
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# Makefile for PngMinus (pnm2pngm)
|
||||||
|
# Linux / Unix
|
||||||
|
|
||||||
|
#CC=cc
|
||||||
|
CC=gcc
|
||||||
|
LD=$(CC)
|
||||||
|
|
||||||
|
RM=rm -f
|
||||||
|
|
||||||
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZIP -I. -O1
|
||||||
|
|
||||||
|
C=.c
|
||||||
|
O=.o
|
||||||
|
L=.a
|
||||||
|
E=
|
||||||
|
|
||||||
|
ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) gzio$(O) \
|
||||||
|
dummy_inflate$(O) \
|
||||||
|
trees$(O) uncompr$(O) zutil$(O)
|
||||||
|
|
||||||
|
OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||||
|
pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \
|
||||||
|
pngwtran$(O) pngwutil$(O) $(ZOBJS)
|
||||||
|
|
||||||
|
# implicit make rules -------------------------------------------------------
|
||||||
|
|
||||||
|
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||||
|
$(CC) -c $(CFLAGS) $<
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
|
||||||
|
all: pnm2pngm$(E)
|
||||||
|
|
||||||
|
pnm2pngm$(E): $(OBJS)
|
||||||
|
$(LD) -o pnm2pngm$(E) $(OBJS)
|
||||||
|
strip pnm2pngm$(E)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) pnm2pngm$(O)
|
||||||
|
$(RM) pnm2pngm$(E)
|
||||||
|
$(RM) $(OBJS)
|
||||||
|
|
||||||
|
# End of makefile for pnm2pngm
|
||||||
73
contrib/pngminim/encoder/pngusr.h
Normal file
73
contrib/pngminim/encoder/pngusr.h
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/* minwrpngconf.h: headers to make a minimal png-write-only library
|
||||||
|
*
|
||||||
|
* Copyright (c) 2007, 2009 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
|
||||||
|
*
|
||||||
|
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MINWRPNGCONF_H
|
||||||
|
#define MINWRPNGCONF_H
|
||||||
|
|
||||||
|
#define PNG_NO_GLOBAL_ARRAYS
|
||||||
|
|
||||||
|
#define PNG_NO_READ_SUPPORTED
|
||||||
|
|
||||||
|
#define PNG_NO_WARNINGS
|
||||||
|
#define png_warning(s1,s2) ""
|
||||||
|
#define png_chunk_warning(s1,s2) ""
|
||||||
|
#define PNG_NO_ERROR_TEXT
|
||||||
|
#define png_error(s1,s2) png_err(s1)
|
||||||
|
#define png_chunk_error(s1,s2) png_err(s1)
|
||||||
|
|
||||||
|
#define PNG_NO_WRITE_BACKGROUND
|
||||||
|
#define PNG_NO_WRITE_GAMMA
|
||||||
|
#define PNG_NO_WRITE_DITHER
|
||||||
|
#define PNG_NO_WRITE_INVERT
|
||||||
|
#define PNG_NO_WRITE_SHIFT
|
||||||
|
#define PNG_NO_WRITE_PACK
|
||||||
|
#define PNG_NO_WRITE_PACKSWAP
|
||||||
|
#define PNG_NO_WRITE_FILLER
|
||||||
|
#define PNG_NO_WRITE_SWAP
|
||||||
|
#define PNG_NO_WRITE_SWAP_ALPHA
|
||||||
|
#define PNG_NO_WRITE_INVERT_ALPHA
|
||||||
|
#define PNG_NO_WRITE_RGB_TO_GRAY
|
||||||
|
#define PNG_NO_WRITE_USER_TRANSFORM
|
||||||
|
#define PNG_NO_WRITE_bKGD
|
||||||
|
#define PNG_NO_WRITE_cHRM
|
||||||
|
#define PNG_NO_WRITE_gAMA
|
||||||
|
#define PNG_NO_WRITE_hIST
|
||||||
|
#define PNG_NO_WRITE_iCCP
|
||||||
|
#define PNG_NO_WRITE_oFFs
|
||||||
|
#define PNG_NO_WRITE_pCAL
|
||||||
|
#define PNG_NO_WRITE_pHYs
|
||||||
|
#define PNG_NO_WRITE_sBIT
|
||||||
|
#define PNG_NO_WRITE_sCAL
|
||||||
|
#define PNG_NO_WRITE_sPLT
|
||||||
|
#define PNG_NO_WRITE_sRGB
|
||||||
|
#define PNG_NO_WRITE_TEXT
|
||||||
|
#define PNG_NO_WRITE_tIME
|
||||||
|
#define PNG_NO_WRITE_UNKNOWN_CHUNKS
|
||||||
|
#define PNG_NO_WRITE_USER_CHUNKS
|
||||||
|
#define PNG_NO_WRITE_EMPTY_PLTE
|
||||||
|
#define PNG_NO_WRITE_OPT_PLTE
|
||||||
|
#define PNG_NO_WRITE_FILTER
|
||||||
|
#define PNG_NO_WRITE_WEIGHTED_FILTER
|
||||||
|
#define PNG_NO_WRITE_INTERLACING_SUPPORTED
|
||||||
|
#define PNG_NO_WRITE_FLUSH
|
||||||
|
|
||||||
|
#define PNG_NO_INFO_IMAGE
|
||||||
|
#define PNG_NO_USER_MEM
|
||||||
|
#define PNG_NO_FIXED_POINT_SUPPORTED
|
||||||
|
#define PNG_NO_MNG_FEATURES
|
||||||
|
#define PNG_NO_USER_TRANSFORM_PTR
|
||||||
|
#define PNG_NO_HANDLE_AS_UNKNOWN
|
||||||
|
#define PNG_NO_CONSOLE_IO
|
||||||
|
#define PNG_NO_ZALLOC_ZERO
|
||||||
|
#define PNG_NO_ERROR_NUMBERS
|
||||||
|
#define PNG_NO_EASY_ACCESS
|
||||||
|
|
||||||
|
#endif /* MINWRPNGCONF_H */
|
||||||
14
contrib/pngminim/preader/README
Normal file
14
contrib/pngminim/preader/README
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||||
|
|
||||||
|
To build a minimal read-only progressive decoder embedded libpng and
|
||||||
|
zlib and with your system's X library, run
|
||||||
|
|
||||||
|
gather.sh # to collect needed files from gregbook, libpng, and zlib
|
||||||
|
|
||||||
|
Edit makefile if required, to find your X library and include files,
|
||||||
|
then
|
||||||
|
|
||||||
|
make
|
||||||
|
|
||||||
|
If you prefer to use the shared libraries, go to contrib/gregbook
|
||||||
|
and build the rpng2-x application there.
|
||||||
10
contrib/pngminim/preader/gather.sh
Executable file
10
contrib/pngminim/preader/gather.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] .
|
||||||
|
cp ../../gregbook/COPYING ../../gregbook/LICENSE .
|
||||||
|
cp ../../../*.h .
|
||||||
|
cp ../../../*.c .
|
||||||
|
rm pnggccrd.c pngvcrd.c
|
||||||
|
rm example.c pngtest.c pngw*.c
|
||||||
|
# change the following 2 lines if zlib is somewhere else
|
||||||
|
cp ../../../../zlib/*.h .
|
||||||
|
cp ../../../../zlib/*.c .
|
||||||
|
rm minigzip.c example.c compress.c deflate.c
|
||||||
60
contrib/pngminim/preader/makefile
Normal file
60
contrib/pngminim/preader/makefile
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# Makefile for PngMinus (rpng2)
|
||||||
|
# Linux / Unix
|
||||||
|
|
||||||
|
#CC=cc
|
||||||
|
CC=gcc
|
||||||
|
LD=$(CC)
|
||||||
|
|
||||||
|
RM=rm -f
|
||||||
|
|
||||||
|
#XINC = -I/usr/include # old-style, stock X distributions
|
||||||
|
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
|
||||||
|
|
||||||
|
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||||
|
#XLIB = -L/usr/openwin/lib -lX11
|
||||||
|
|
||||||
|
XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
|
||||||
|
XLIB = -L/usr/X11R6/lib -lX11
|
||||||
|
#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
|
||||||
|
|
||||||
|
#XINC = -I/usr/local/include # FreeBSD
|
||||||
|
#XLIB = -L/usr/local/lib -lX11
|
||||||
|
|
||||||
|
#LIBS = $(XLIB)
|
||||||
|
LIBS = $(XLIB) -lm #platforms that need libm
|
||||||
|
|
||||||
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
|
||||||
|
-DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1
|
||||||
|
|
||||||
|
C=.c
|
||||||
|
O=.o
|
||||||
|
L=.a
|
||||||
|
E=
|
||||||
|
|
||||||
|
ZOBJS = adler32$(O) crc32$(O) gzio$(O) \
|
||||||
|
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
|
||||||
|
trees$(O) uncompr$(O) zutil$(O)
|
||||||
|
|
||||||
|
OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||||
|
pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
|
||||||
|
pngset$(O) pngtrans$(O) $(ZOBJS)
|
||||||
|
|
||||||
|
# implicit make rules -------------------------------------------------------
|
||||||
|
|
||||||
|
.c$(O): png.h pngconf.h readpng2.h pngusr.h zlib.h
|
||||||
|
$(CC) -c $(CFLAGS) $<
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
|
||||||
|
all: rpng2-x$(E)
|
||||||
|
|
||||||
|
rpng2-x$(E): $(OBJS)
|
||||||
|
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
|
||||||
|
strip rpng2-x$(E)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) rpng2-x$(O)
|
||||||
|
$(RM) rpng2-x$(E)
|
||||||
|
$(RM) $(OBJS)
|
||||||
|
|
||||||
|
# End of makefile for rpng2-x
|
||||||
68
contrib/pngminim/preader/pngusr.h
Normal file
68
contrib/pngminim/preader/pngusr.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/* minrdpngconf.h: headers to make a minimal png-read-only library
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 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
|
||||||
|
*
|
||||||
|
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MINPRDPNGCONF_H
|
||||||
|
#define MINPRDPNGCONF_H
|
||||||
|
|
||||||
|
#define PNG_NO_GLOBAL_ARRAYS
|
||||||
|
|
||||||
|
#define PNG_NO_WARNINGS
|
||||||
|
#define png_warning(s1,s2) ""
|
||||||
|
#define png_chunk_warning(s1,s2) ""
|
||||||
|
#define PNG_NO_ERROR_TEXT
|
||||||
|
#define png_error(s1,s2) png_err(s1)
|
||||||
|
#define png_chunk_error(s1,s2) png_err(s1)
|
||||||
|
|
||||||
|
#define PNG_NO_ASSEMBLER_CODE
|
||||||
|
#define PNG_NO_OPTIMIZED_CODE
|
||||||
|
#define PNG_NO_READ_DITHER
|
||||||
|
#define PNG_NO_READ_INVERT
|
||||||
|
#define PNG_NO_READ_SHIFT
|
||||||
|
#define PNG_NO_READ_PACK
|
||||||
|
#define PNG_NO_READ_PACKSWAP
|
||||||
|
#define PNG_NO_READ_FILLER
|
||||||
|
#define PNG_NO_READ_SWAP
|
||||||
|
#define PNG_NO_READ_SWAP_ALPHA
|
||||||
|
#define PNG_NO_READ_INVERT_ALPHA
|
||||||
|
#define PNG_NO_READ_RGB_TO_GRAY
|
||||||
|
#define PNG_NO_READ_USER_TRANSFORM
|
||||||
|
#define PNG_NO_READ_cHRM
|
||||||
|
#define PNG_NO_READ_hIST
|
||||||
|
#define PNG_NO_READ_iCCP
|
||||||
|
#define PNG_NO_READ_pCAL
|
||||||
|
#define PNG_NO_READ_pHYs
|
||||||
|
#define PNG_NO_READ_sBIT
|
||||||
|
#define PNG_NO_READ_sCAL
|
||||||
|
#define PNG_NO_READ_sPLT
|
||||||
|
#define PNG_NO_READ_TEXT
|
||||||
|
#define PNG_NO_READ_tIME
|
||||||
|
#define PNG_NO_READ_UNKNOWN_CHUNKS
|
||||||
|
#define PNG_NO_READ_USER_CHUNKS
|
||||||
|
#define PNG_NO_READ_EMPTY_PLTE
|
||||||
|
#define PNG_NO_READ_OPT_PLTE
|
||||||
|
#define PNG_NO_READ_STRIP_ALPHA
|
||||||
|
#define PNG_NO_READ_oFFs
|
||||||
|
#define PNG_NO_WARN_UNINITIALIZED_ROW
|
||||||
|
|
||||||
|
#define PNG_NO_WRITE_SUPPORTED
|
||||||
|
|
||||||
|
#define PNG_NO_INFO_IMAGE
|
||||||
|
#define PNG_NO_USER_MEM
|
||||||
|
#define PNG_NO_FIXED_POINT_SUPPORTED
|
||||||
|
#define PNG_NO_MNG_FEATURES
|
||||||
|
#define PNG_NO_USER_TRANSFORM_PTR
|
||||||
|
#define PNG_NO_HANDLE_AS_UNKNOWN
|
||||||
|
#define PNG_NO_CONSOLE_IO
|
||||||
|
#define PNG_NO_ZALLOC_ZERO
|
||||||
|
#define PNG_NO_ERROR_NUMBERS
|
||||||
|
#define PNG_NO_EASY_ACCESS
|
||||||
|
|
||||||
|
#endif /* MINPRDPNGCONF_H */
|
||||||
@@ -8,9 +8,9 @@ LD=$(CC)
|
|||||||
RM=rm -f
|
RM=rm -f
|
||||||
|
|
||||||
#PNGPATH = /usr/local
|
#PNGPATH = /usr/local
|
||||||
#PNGINC = -I$(PNGPATH)/include/libpng10
|
#PNGINC = -I$(PNGPATH)/include/libpng12
|
||||||
#PNGLIB = -L$(PNGPATH)/lib -lpng10
|
#PNGLIB = -L$(PNGPATH)/lib -lpng12
|
||||||
#PNGLIBS = $(PNGPATH)/lib/libpng10.a
|
#PNGLIBS = $(PNGPATH)/lib/libpng12.a
|
||||||
PNGINC = -I../..
|
PNGINC = -I../..
|
||||||
PNGLIB = -L../.. -lpng
|
PNGLIB = -L../.. -lpng
|
||||||
PNGLIBS = ../../libpng.a
|
PNGLIBS = ../../libpng.a
|
||||||
@@ -23,9 +23,9 @@ ZINC = -I../../../zlib
|
|||||||
ZLIB = -L../../../zlib -lz
|
ZLIB = -L../../../zlib -lz
|
||||||
ZLIBS = ../../../zlib/libz.a
|
ZLIBS = ../../../zlib/libz.a
|
||||||
|
|
||||||
CFLAGS=$(PNGINC) $(ZINC)
|
CFLAGS=-O3 $(PNGINC) $(ZINC)
|
||||||
LDLIBS=$(PNGLIB) $(ZLIB)
|
LDFLAGS=$(PNGLIB) $(ZLIB)
|
||||||
LDLIBSS=$(PNGLIBS) $(ZLIBS)
|
LDFLAGSS=$(PNGLIBS) $(ZLIBS)
|
||||||
C=.c
|
C=.c
|
||||||
O=.o
|
O=.o
|
||||||
L=.a
|
L=.a
|
||||||
@@ -40,19 +40,19 @@ png2pnm$(O): png2pnm$(C)
|
|||||||
$(CC) -c $(CFLAGS) png2pnm$(C)
|
$(CC) -c $(CFLAGS) png2pnm$(C)
|
||||||
|
|
||||||
png2pnm$(E): png2pnm$(O)
|
png2pnm$(E): png2pnm$(O)
|
||||||
$(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm
|
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm
|
||||||
|
|
||||||
png2pnm-static$(E): png2pnm$(O)
|
png2pnm-static$(E): png2pnm$(O)
|
||||||
$(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm
|
$(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm
|
||||||
|
|
||||||
pnm2png$(O): pnm2png$(C)
|
pnm2png$(O): pnm2png$(C)
|
||||||
$(CC) -c $(CFLAGS) pnm2png$(C)
|
$(CC) -c $(CFLAGS) pnm2png$(C)
|
||||||
|
|
||||||
pnm2png$(E): pnm2png$(O)
|
pnm2png$(E): pnm2png$(O)
|
||||||
$(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm
|
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm
|
||||||
|
|
||||||
pnm2png-static$(E): pnm2png$(O)
|
pnm2png-static$(E): pnm2png$(O)
|
||||||
$(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm
|
$(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) png2pnm$(O)
|
$(RM) png2pnm$(O)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
* copyright (C) 1999 by Willem van Schaik <willem@schaik.com>
|
* copyright (C) 1999 by Willem van Schaik <willem@schaik.com>
|
||||||
*
|
*
|
||||||
* version 1.0 - 1999.10.15 - First version.
|
* version 1.0 - 1999.10.15 - First version.
|
||||||
* version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson)
|
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software and
|
* Permission to use, copy, modify, and distribute this software and
|
||||||
* its documentation for any purpose and without fee is hereby granted,
|
* its documentation for any purpose and without fee is hereby granted,
|
||||||
@@ -19,7 +18,6 @@
|
|||||||
#include <mem.h>
|
#include <mem.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <zlib.h>
|
|
||||||
|
|
||||||
#ifndef BOOL
|
#ifndef BOOL
|
||||||
#define BOOL unsigned char
|
#define BOOL unsigned char
|
||||||
@@ -51,8 +49,7 @@
|
|||||||
|
|
||||||
int main (int argc, char *argv[]);
|
int main (int argc, char *argv[]);
|
||||||
void usage ();
|
void usage ();
|
||||||
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, BOOL alpha);
|
||||||
BOOL alpha);
|
|
||||||
void get_token(FILE *pnm_file, char *token);
|
void get_token(FILE *pnm_file, char *token);
|
||||||
png_uint_32 get_data (FILE *pnm_file, int depth);
|
png_uint_32 get_data (FILE *pnm_file, int depth);
|
||||||
png_uint_32 get_value (FILE *pnm_file, int depth);
|
png_uint_32 get_value (FILE *pnm_file, int depth);
|
||||||
@@ -178,8 +175,7 @@ void usage()
|
|||||||
fprintf (stderr, " or: ... | pnm2png [options]\n");
|
fprintf (stderr, " or: ... | pnm2png [options]\n");
|
||||||
fprintf (stderr, "Options:\n");
|
fprintf (stderr, "Options:\n");
|
||||||
fprintf (stderr, " -i[nterlace] write png-file with interlacing on\n");
|
fprintf (stderr, " -i[nterlace] write png-file with interlacing on\n");
|
||||||
fprintf (stderr,
|
fprintf (stderr, " -a[lpha] <file>.pgm read PNG alpha channel as pgm-file\n");
|
||||||
" -a[lpha] <file>.pgm read PNG alpha channel as pgm-file\n");
|
|
||||||
fprintf (stderr, " -h | -? print this help-information\n");
|
fprintf (stderr, " -h | -? print this help-information\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,36 +183,29 @@ void usage()
|
|||||||
* pnm2png
|
* pnm2png
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, BOOL alpha)
|
||||||
BOOL alpha)
|
|
||||||
{
|
{
|
||||||
png_struct *png_ptr = NULL;
|
png_struct *png_ptr = NULL;
|
||||||
png_info *info_ptr = NULL;
|
png_info *info_ptr = NULL;
|
||||||
png_byte *png_pixels = NULL;
|
png_byte *png_pixels = NULL;
|
||||||
png_byte **row_pointers = NULL;
|
png_byte **row_pointers = NULL;
|
||||||
png_byte *pix_ptr = NULL;
|
png_byte *pix_ptr = NULL;
|
||||||
volatile png_uint_32 row_bytes;
|
png_uint_32 row_bytes;
|
||||||
|
|
||||||
char type_token[16];
|
char type_token[16];
|
||||||
char width_token[16];
|
char width_token[16];
|
||||||
char height_token[16];
|
char height_token[16];
|
||||||
char maxval_token[16];
|
char maxval_token[16];
|
||||||
volatile int color_type=1;
|
int color_type;
|
||||||
unsigned long ul_width=0, ul_alpha_width=0;
|
png_uint_32 width, alpha_width;
|
||||||
unsigned long ul_height=0, ul_alpha_height=0;
|
png_uint_32 height, alpha_height;
|
||||||
unsigned long ul_maxval=0;
|
|
||||||
volatile png_uint_32 width=0, height=0;
|
|
||||||
volatile png_uint_32 alpha_width=0, alpha_height=0;
|
|
||||||
png_uint_32 maxval;
|
png_uint_32 maxval;
|
||||||
volatile int bit_depth = 0;
|
int bit_depth = 0;
|
||||||
int channels=0;
|
int channels;
|
||||||
int alpha_depth = 0;
|
int alpha_depth = 0;
|
||||||
int alpha_present=0;
|
int alpha_present;
|
||||||
int row, col;
|
int row, col;
|
||||||
BOOL raw, alpha_raw = FALSE;
|
BOOL raw, alpha_raw = FALSE;
|
||||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
|
||||||
BOOL packed_bitmap = FALSE;
|
|
||||||
#endif
|
|
||||||
png_uint_32 tmp16;
|
png_uint_32 tmp16;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -229,36 +218,20 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
}
|
}
|
||||||
else if ((type_token[1] == '1') || (type_token[1] == '4'))
|
else if ((type_token[1] == '1') || (type_token[1] == '4'))
|
||||||
{
|
{
|
||||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
|
||||||
raw = (type_token[1] == '4');
|
raw = (type_token[1] == '4');
|
||||||
color_type = PNG_COLOR_TYPE_GRAY;
|
color_type = PNG_COLOR_TYPE_GRAY;
|
||||||
get_token(pnm_file, width_token);
|
|
||||||
sscanf (width_token, "%lu", &ul_width);
|
|
||||||
width = (png_uint_32) ul_width;
|
|
||||||
get_token(pnm_file, height_token);
|
|
||||||
sscanf (height_token, "%lu", &ul_height);
|
|
||||||
height = (png_uint_32) ul_height;
|
|
||||||
bit_depth = 1;
|
bit_depth = 1;
|
||||||
packed_bitmap = TRUE;
|
|
||||||
#else
|
|
||||||
fprintf (stderr, "PNM2PNG built without PNG_WRITE_INVERT_SUPPORTED and \n");
|
|
||||||
fprintf (stderr, "PNG_WRITE_PACK_SUPPORTED can't read PBM (P1,P4) files\n");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if ((type_token[1] == '2') || (type_token[1] == '5'))
|
else if ((type_token[1] == '2') || (type_token[1] == '5'))
|
||||||
{
|
{
|
||||||
raw = (type_token[1] == '5');
|
raw = (type_token[1] == '5');
|
||||||
color_type = PNG_COLOR_TYPE_GRAY;
|
color_type = PNG_COLOR_TYPE_GRAY;
|
||||||
get_token(pnm_file, width_token);
|
get_token(pnm_file, width_token);
|
||||||
sscanf (width_token, "%lu", &ul_width);
|
sscanf (width_token, "%lu", &width);
|
||||||
width = (png_uint_32) ul_width;
|
|
||||||
get_token(pnm_file, height_token);
|
get_token(pnm_file, height_token);
|
||||||
sscanf (height_token, "%lu", &ul_height);
|
sscanf (height_token, "%lu", &height);
|
||||||
height = (png_uint_32) ul_height;
|
|
||||||
get_token(pnm_file, maxval_token);
|
get_token(pnm_file, maxval_token);
|
||||||
sscanf (maxval_token, "%lu", &ul_maxval);
|
sscanf (maxval_token, "%lu", &maxval);
|
||||||
maxval = (png_uint_32) ul_maxval;
|
|
||||||
|
|
||||||
if (maxval <= 1)
|
if (maxval <= 1)
|
||||||
bit_depth = 1;
|
bit_depth = 1;
|
||||||
else if (maxval <= 3)
|
else if (maxval <= 3)
|
||||||
@@ -275,14 +248,11 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
raw = (type_token[1] == '6');
|
raw = (type_token[1] == '6');
|
||||||
color_type = PNG_COLOR_TYPE_RGB;
|
color_type = PNG_COLOR_TYPE_RGB;
|
||||||
get_token(pnm_file, width_token);
|
get_token(pnm_file, width_token);
|
||||||
sscanf (width_token, "%lu", &ul_width);
|
sscanf (width_token, "%lu", &width);
|
||||||
width = (png_uint_32) ul_width;
|
|
||||||
get_token(pnm_file, height_token);
|
get_token(pnm_file, height_token);
|
||||||
sscanf (height_token, "%lu", &ul_height);
|
sscanf (height_token, "%lu", &height);
|
||||||
height = (png_uint_32) ul_height;
|
|
||||||
get_token(pnm_file, maxval_token);
|
get_token(pnm_file, maxval_token);
|
||||||
sscanf (maxval_token, "%lu", &ul_maxval);
|
sscanf (maxval_token, "%lu", &maxval);
|
||||||
maxval = (png_uint_32) ul_maxval;
|
|
||||||
if (maxval <= 1)
|
if (maxval <= 1)
|
||||||
bit_depth = 1;
|
bit_depth = 1;
|
||||||
else if (maxval <= 3)
|
else if (maxval <= 3)
|
||||||
@@ -317,18 +287,15 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
{
|
{
|
||||||
alpha_raw = (type_token[1] == '5');
|
alpha_raw = (type_token[1] == '5');
|
||||||
get_token(alpha_file, width_token);
|
get_token(alpha_file, width_token);
|
||||||
sscanf (width_token, "%lu", &ul_alpha_width);
|
sscanf (width_token, "%lu", &alpha_width);
|
||||||
alpha_width=(png_uint_32) ul_alpha_width;
|
|
||||||
if (alpha_width != width)
|
if (alpha_width != width)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
get_token(alpha_file, height_token);
|
get_token(alpha_file, height_token);
|
||||||
sscanf (height_token, "%lu", &ul_alpha_height);
|
sscanf (height_token, "%lu", &alpha_height);
|
||||||
alpha_height = (png_uint_32) ul_alpha_height;
|
|
||||||
if (alpha_height != height)
|
if (alpha_height != height)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
get_token(alpha_file, maxval_token);
|
get_token(alpha_file, maxval_token);
|
||||||
sscanf (maxval_token, "%lu", &ul_maxval);
|
sscanf (maxval_token, "%lu", &maxval);
|
||||||
maxval = (png_uint_32) ul_maxval;
|
|
||||||
if (maxval <= 1)
|
if (maxval <= 1)
|
||||||
alpha_depth = 1;
|
alpha_depth = 1;
|
||||||
else if (maxval <= 3)
|
else if (maxval <= 3)
|
||||||
@@ -357,40 +324,23 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
channels = 3;
|
channels = 3;
|
||||||
else if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
else if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
channels = 4;
|
channels = 4;
|
||||||
#if 0
|
|
||||||
else
|
else
|
||||||
channels = 0; /* cannot happen */
|
channels = 0; /* should not happen */
|
||||||
#endif
|
|
||||||
|
|
||||||
alpha_present = (channels - 1) % 2;
|
alpha_present = (channels - 1) % 2;
|
||||||
|
|
||||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
|
||||||
if (packed_bitmap)
|
|
||||||
/* row data is as many bytes as can fit width x channels x bit_depth */
|
|
||||||
row_bytes = (width * channels * bit_depth + 7) / 8;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
/* row_bytes is the width x number of channels x (bit-depth / 8) */
|
/* row_bytes is the width x number of channels x (bit-depth / 8) */
|
||||||
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
|
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
|
||||||
|
|
||||||
if ((png_pixels = (png_byte *)
|
if ((png_pixels = (png_byte *) malloc (row_bytes * height * sizeof (png_byte))) == NULL)
|
||||||
malloc (row_bytes * height * sizeof (png_byte))) == NULL)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* read data from PNM file */
|
/* read data from PNM file */
|
||||||
pix_ptr = png_pixels;
|
pix_ptr = png_pixels;
|
||||||
|
|
||||||
for (row = 0; row < (int) height; row++)
|
for (row = 0; row < height; row++)
|
||||||
{
|
{
|
||||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
for (col = 0; col < width; col++)
|
||||||
if (packed_bitmap) {
|
|
||||||
for (i = 0; i < (int) row_bytes; i++)
|
|
||||||
/* png supports this format natively so no conversion is needed */
|
|
||||||
*pix_ptr++ = get_data (pnm_file, 8);
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
for (col = 0; col < (int) width; col++)
|
|
||||||
{
|
{
|
||||||
for (i = 0; i < (channels - alpha_present); i++)
|
for (i = 0; i < (channels - alpha_present); i++)
|
||||||
{
|
{
|
||||||
@@ -423,42 +373,27 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
*pix_ptr++ = (png_byte) (tmp16 & 0xFF);
|
*pix_ptr++ = (png_byte) (tmp16 & 0xFF);
|
||||||
}
|
}
|
||||||
} /* if alpha */
|
} /* if alpha */
|
||||||
} /* if packed_bitmap */
|
|
||||||
} /* end for col */
|
} /* end for col */
|
||||||
} /* end for row */
|
} /* end for row */
|
||||||
|
|
||||||
/* prepare the standard PNG structures */
|
/* prepare the standard PNG structures */
|
||||||
png_ptr = png_create_write_struct (png_get_libpng_ver(NULL), NULL, NULL,
|
png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||||
NULL);
|
|
||||||
if (!png_ptr)
|
if (!png_ptr)
|
||||||
{
|
{
|
||||||
free (png_pixels);
|
|
||||||
png_pixels = NULL;
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
info_ptr = png_create_info_struct (png_ptr);
|
info_ptr = png_create_info_struct (png_ptr);
|
||||||
if (!info_ptr)
|
if (!info_ptr)
|
||||||
{
|
{
|
||||||
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
||||||
free (png_pixels);
|
|
||||||
png_pixels = NULL;
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
|
||||||
if (packed_bitmap == TRUE)
|
|
||||||
{
|
|
||||||
png_set_packing (png_ptr);
|
|
||||||
png_set_invert_mono (png_ptr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* setjmp() must be called in every function that calls a PNG-reading libpng function */
|
/* setjmp() must be called in every function that calls a PNG-reading libpng function */
|
||||||
if (setjmp (png_jmpbuf(png_ptr)))
|
if (setjmp (png_jmpbuf(png_ptr)))
|
||||||
{
|
{
|
||||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
||||||
free (png_pixels);
|
|
||||||
png_pixels = NULL;
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,28 +411,25 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
/* if needed we will allocate memory for an new array of row-pointers */
|
/* if needed we will allocate memory for an new array of row-pointers */
|
||||||
if (row_pointers == (unsigned char**) NULL)
|
if (row_pointers == (unsigned char**) NULL)
|
||||||
{
|
{
|
||||||
if ((row_pointers = (png_byte **)
|
if ((row_pointers = (png_byte **) malloc (height * sizeof (png_bytep))) == NULL)
|
||||||
malloc (height * sizeof (png_bytep))) == NULL)
|
|
||||||
{
|
{
|
||||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
||||||
free (png_pixels);
|
|
||||||
png_pixels = NULL;
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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 < (int) height; i++)
|
for (i = 0; i < (height); i++)
|
||||||
row_pointers[i] = png_pixels + i * row_bytes;
|
row_pointers[i] = png_pixels + i * row_bytes;
|
||||||
|
|
||||||
/* write out the entire image data in one call */
|
/* write out the entire image data in one call */
|
||||||
png_write_image (png_ptr, row_pointers);
|
png_write_image (png_ptr, row_pointers);
|
||||||
|
|
||||||
/* write the additional chunks to the PNG file (not really needed) */
|
/* write the additional chuncks to the PNG file (not really needed) */
|
||||||
png_write_end (png_ptr, info_ptr);
|
png_write_end (png_ptr, info_ptr);
|
||||||
|
|
||||||
/* 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, &info_ptr);
|
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
|
||||||
|
|
||||||
if (row_pointers != (unsigned char**) NULL)
|
if (row_pointers != (unsigned char**) NULL)
|
||||||
free (row_pointers);
|
free (row_pointers);
|
||||||
@@ -514,32 +446,19 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
void get_token(FILE *pnm_file, char *token)
|
void get_token(FILE *pnm_file, char *token)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* remove white-space and comment lines */
|
/* remove white-space */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ret = fgetc(pnm_file);
|
token[i] = (unsigned char) fgetc (pnm_file);
|
||||||
if (ret == '#') {
|
|
||||||
/* the rest of this line is a comment */
|
|
||||||
do
|
|
||||||
{
|
|
||||||
ret = fgetc(pnm_file);
|
|
||||||
}
|
|
||||||
while ((ret != '\n') && (ret != '\r') && (ret != EOF));
|
|
||||||
}
|
|
||||||
if (ret == EOF) break;
|
|
||||||
token[i] = (unsigned char) ret;
|
|
||||||
}
|
}
|
||||||
while ((token[i] == '\n') || (token[i] == '\r') || (token[i] == ' '));
|
while ((token[i] == '\n') || (token[i] == '\r') || (token[i] == ' '));
|
||||||
|
|
||||||
/* read string */
|
/* read string */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ret = fgetc(pnm_file);
|
|
||||||
if (ret == EOF) break;
|
|
||||||
i++;
|
i++;
|
||||||
token[i] = (unsigned char) ret;
|
token[i] = (unsigned char) fgetc (pnm_file);
|
||||||
}
|
}
|
||||||
while ((token[i] != '\n') && (token[i] != '\r') && (token[i] != ' '));
|
while ((token[i] != '\n') && (token[i] != '\r') && (token[i] != ' '));
|
||||||
|
|
||||||
@@ -591,7 +510,6 @@ png_uint_32 get_value (FILE *pnm_file, int depth)
|
|||||||
{
|
{
|
||||||
static png_uint_32 mask = 0;
|
static png_uint_32 mask = 0;
|
||||||
png_byte token[16];
|
png_byte token[16];
|
||||||
unsigned long ul_ret_value;
|
|
||||||
png_uint_32 ret_value;
|
png_uint_32 ret_value;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -600,8 +518,7 @@ png_uint_32 get_value (FILE *pnm_file, int depth)
|
|||||||
mask = (mask << 1) | 0x01;
|
mask = (mask << 1) | 0x01;
|
||||||
|
|
||||||
get_token (pnm_file, (char *) token);
|
get_token (pnm_file, (char *) token);
|
||||||
sscanf ((const char *) token, "%lu", &ul_ret_value);
|
sscanf ((const char *) token, "%lu", &ret_value);
|
||||||
ret_value = (png_uint_32) ul_ret_value;
|
|
||||||
|
|
||||||
ret_value &= mask;
|
ret_value &= mask;
|
||||||
|
|
||||||
|
|||||||
423
depcomp
423
depcomp
@@ -1,9 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# depcomp - compile a program generating dependencies as side-effects
|
# depcomp - compile a program generating dependencies as side-effects
|
||||||
|
|
||||||
scriptversion=2013-05-30.07; # UTC
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
|
||||||
|
# Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,7 +28,7 @@ scriptversion=2013-05-30.07; # UTC
|
|||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
'')
|
'')
|
||||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||||
exit 1;
|
exit 1;
|
||||||
;;
|
;;
|
||||||
-h | --h*)
|
-h | --h*)
|
||||||
@@ -39,11 +40,11 @@ as side-effects.
|
|||||||
|
|
||||||
Environment variables:
|
Environment variables:
|
||||||
depmode Dependency tracking mode.
|
depmode Dependency tracking mode.
|
||||||
source Source file read by 'PROGRAMS ARGS'.
|
source Source file read by `PROGRAMS ARGS'.
|
||||||
object Object file output by 'PROGRAMS ARGS'.
|
object Object file output by `PROGRAMS ARGS'.
|
||||||
DEPDIR directory where to store dependencies.
|
DEPDIR directory where to store dependencies.
|
||||||
depfile Dependency file to output.
|
depfile Dependency file to output.
|
||||||
tmpdepfile Temporary file to use when outputting dependencies.
|
tmpdepfile Temporary file to use when outputing dependencies.
|
||||||
libtool Whether libtool is used (yes/no).
|
libtool Whether libtool is used (yes/no).
|
||||||
|
|
||||||
Report bugs to <bug-automake@gnu.org>.
|
Report bugs to <bug-automake@gnu.org>.
|
||||||
@@ -56,66 +57,6 @@ EOF
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Get the directory component of the given path, and save it in the
|
|
||||||
# global variables '$dir'. Note that this directory component will
|
|
||||||
# be either empty or ending with a '/' character. This is deliberate.
|
|
||||||
set_dir_from ()
|
|
||||||
{
|
|
||||||
case $1 in
|
|
||||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
|
||||||
*) dir=;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get the suffix-stripped basename of the given path, and save it the
|
|
||||||
# global variable '$base'.
|
|
||||||
set_base_from ()
|
|
||||||
{
|
|
||||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
|
||||||
}
|
|
||||||
|
|
||||||
# If no dependency file was actually created by the compiler invocation,
|
|
||||||
# we still have to create a dummy depfile, to avoid errors with the
|
|
||||||
# Makefile "include basename.Plo" scheme.
|
|
||||||
make_dummy_depfile ()
|
|
||||||
{
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Factor out some common post-processing of the generated depfile.
|
|
||||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
|
||||||
aix_post_process_depfile ()
|
|
||||||
{
|
|
||||||
# If the compiler actually managed to produce a dependency file,
|
|
||||||
# post-process it.
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
# Each line is of the form 'foo.o: dependency.h'.
|
|
||||||
# Do two passes, one to just change these to
|
|
||||||
# $object: dependency.h
|
|
||||||
# and one to simply output
|
|
||||||
# dependency.h:
|
|
||||||
# which is needed to avoid the deleted-header problem.
|
|
||||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
|
||||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
|
||||||
} > "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
else
|
|
||||||
make_dummy_depfile
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# A tabulation character.
|
|
||||||
tab=' '
|
|
||||||
# A newline character.
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
# Character ranges might be problematic outside the C locale.
|
|
||||||
# These definitions help.
|
|
||||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
||||||
lower=abcdefghijklmnopqrstuvwxyz
|
|
||||||
digits=0123456789
|
|
||||||
alpha=${upper}${lower}
|
|
||||||
|
|
||||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -128,9 +69,6 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|||||||
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
|
|
||||||
# Avoid interferences from the environment.
|
|
||||||
gccflag= dashmflag=
|
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
# Some modes work just like other modes, but use different flags. We
|
||||||
# parameterize here, but still list the modes in the big case below,
|
# parameterize here, but still list the modes in the big case below,
|
||||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||||
@@ -152,24 +90,10 @@ if test "$depmode" = msvcmsys; then
|
|||||||
# This is just like msvisualcpp but w/o cygpath translation.
|
# This is just like msvisualcpp but w/o cygpath translation.
|
||||||
# Just convert the backslash-escaped backslashes to single forward
|
# Just convert the backslash-escaped backslashes to single forward
|
||||||
# slashes to satisfy depend.m4
|
# slashes to satisfy depend.m4
|
||||||
cygpath_u='sed s,\\\\,/,g'
|
cygpath_u="sed s,\\\\\\\\,/,g"
|
||||||
depmode=msvisualcpp
|
depmode=msvisualcpp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$depmode" = msvc7msys; then
|
|
||||||
# This is just like msvc7 but w/o cygpath translation.
|
|
||||||
# Just convert the backslash-escaped backslashes to single forward
|
|
||||||
# slashes to satisfy depend.m4
|
|
||||||
cygpath_u='sed s,\\\\,/,g'
|
|
||||||
depmode=msvc7
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = xlc; then
|
|
||||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
|
||||||
gccflag=-qmakedep=gcc,-MF
|
|
||||||
depmode=gcc
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$depmode" in
|
case "$depmode" in
|
||||||
gcc3)
|
gcc3)
|
||||||
## gcc 3 implements dependency tracking that does exactly what
|
## gcc 3 implements dependency tracking that does exactly what
|
||||||
@@ -190,7 +114,8 @@ gcc3)
|
|||||||
done
|
done
|
||||||
"$@"
|
"$@"
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
@@ -198,17 +123,13 @@ gcc3)
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
gcc)
|
gcc)
|
||||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
|
||||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
|
||||||
## (see the conditional assignment to $gccflag above).
|
|
||||||
## There are various ways to get dependency output from gcc. Here's
|
## There are various ways to get dependency output from gcc. Here's
|
||||||
## why we pick this rather obscure method:
|
## why we pick this rather obscure method:
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
## - Don't want to use -MD because we'd like the dependencies to end
|
||||||
## up in a subdir. Having to rename by hand is ugly.
|
## up in a subdir. Having to rename by hand is ugly.
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
## (We might end up doing this anyway to support other compilers.)
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
## -MM, not -M (despite what the docs say).
|
||||||
## supported by the other compilers which use the 'gcc' depmode.
|
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
## - Using -M directly means running the compiler twice (even worse
|
||||||
## than renaming).
|
## than renaming).
|
||||||
if test -z "$gccflag"; then
|
if test -z "$gccflag"; then
|
||||||
@@ -216,31 +137,31 @@ gcc)
|
|||||||
fi
|
fi
|
||||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
# The second -e expression handles DOS-style file names with drive
|
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||||
# letters.
|
## The second -e expression handles DOS-style file names with drive letters.
|
||||||
sed -e 's/^[^:]*: / /' \
|
sed -e 's/^[^:]*: / /' \
|
||||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||||
## This next piece of magic avoids the "deleted header file" problem.
|
## This next piece of magic avoids the `deleted header file' problem.
|
||||||
## The problem is that when a header file which appears in a .P file
|
## The problem is that when a header file which appears in a .P file
|
||||||
## is deleted, the dependency causes make to die (because there is
|
## is deleted, the dependency causes make to die (because there is
|
||||||
## typically no way to rebuild the header). We avoid this by adding
|
## typically no way to rebuild the header). We avoid this by adding
|
||||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||||
## this for us directly.
|
## this for us directly.
|
||||||
## Some versions of gcc put a space before the ':'. On the theory
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" |
|
||||||
|
## Some versions of gcc put a space before the `:'. On the theory
|
||||||
## that the space means something, we add a space to the output as
|
## that the space means something, we add a space to the output as
|
||||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
## well.
|
||||||
## to the object. Take care to not repeat it in the output.
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -258,7 +179,8 @@ sgi)
|
|||||||
"$@" -MDupdate "$tmpdepfile"
|
"$@" -MDupdate "$tmpdepfile"
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
@@ -266,41 +188,43 @@ sgi)
|
|||||||
|
|
||||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
|
|
||||||
# Clip off the initial element (the dependent). Don't try to be
|
# Clip off the initial element (the dependent). Don't try to be
|
||||||
# clever and replace this with sed code, as IRIX sed won't handle
|
# clever and replace this with sed code, as IRIX sed won't handle
|
||||||
# lines with more than a fixed number of characters (4096 in
|
# lines with more than a fixed number of characters (4096 in
|
||||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||||
# dependency line.
|
# dependency line.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
tr ' ' '
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
' < "$tmpdepfile" \
|
||||||
| tr "$nl" ' ' >> "$depfile"
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||||
|
tr '
|
||||||
|
' ' ' >> "$depfile"
|
||||||
echo >> "$depfile"
|
echo >> "$depfile"
|
||||||
|
|
||||||
# The second pass generates a dummy entry for each header file.
|
# The second pass generates a dummy entry for each header file.
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
tr ' ' '
|
||||||
|
' < "$tmpdepfile" \
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||||
>> "$depfile"
|
>> "$depfile"
|
||||||
else
|
else
|
||||||
make_dummy_depfile
|
# The sourcefile does not contain any dependencies, so just
|
||||||
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
|
# "include basename.Plo" scheme.
|
||||||
|
echo "#dummy" > "$depfile"
|
||||||
fi
|
fi
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
xlc)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
aix)
|
aix)
|
||||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||||
# in a .u file. In older versions, this file always lives in the
|
# in a .u file. In older versions, this file always lives in the
|
||||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||||
# start of each line; $object doesn't have directory information.
|
# start of each line; $object doesn't have directory information.
|
||||||
# Version 6 uses the directory in both cases.
|
# Version 6 uses the directory in both cases.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
tmpdepfile1=$dir$base.u
|
tmpdepfile1=$dir$base.u
|
||||||
tmpdepfile2=$base.u
|
tmpdepfile2=$base.u
|
||||||
@@ -313,7 +237,9 @@ aix)
|
|||||||
"$@" -M
|
"$@" -M
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
|
||||||
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
@@ -322,100 +248,44 @@ aix)
|
|||||||
do
|
do
|
||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
aix_post_process_depfile
|
if test -f "$tmpdepfile"; then
|
||||||
;;
|
# Each line is of the form `foo.o: dependent.h'.
|
||||||
|
# Do two passes, one to just change these to
|
||||||
tcc)
|
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
# FIXME: That version still under development at the moment of writing.
|
# That's a tab and a space in the [].
|
||||||
# Make that this statement remains true also for stable, released
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
# versions.
|
else
|
||||||
# It will wrap lines (doesn't matter whether long or short) with a
|
# The sourcefile does not contain any dependencies, so just
|
||||||
# trailing '\', as in:
|
# store a dummy comment line, to avoid errors with the Makefile
|
||||||
#
|
# "include basename.Plo" scheme.
|
||||||
# foo.o : \
|
echo "#dummy" > "$depfile"
|
||||||
# foo.c \
|
|
||||||
# foo.h \
|
|
||||||
#
|
|
||||||
# It will put a trailing '\' even on the last line, and will use leading
|
|
||||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
|
||||||
# "Emit spaces for -MD").
|
|
||||||
"$@" -MD -MF "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
fi
|
||||||
rm -f "$depfile"
|
|
||||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
|
||||||
# We have to change lines of the first kind to '$object: \'.
|
|
||||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
|
||||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
|
||||||
# dummy dependency, to avoid the deleted-header problem.
|
|
||||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
## The order of this option in the case statement is important, since the
|
icc)
|
||||||
## shell code in configure will try each of these formats in the order
|
# Intel's C compiler understands `-MD -MF file'. However on
|
||||||
## listed in this file. A plain '-MD' option would be understood by many
|
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
# ICC 7.0 will fill foo.d with something like
|
||||||
pgcc)
|
# foo.o: sub/foo.c
|
||||||
# Portland's C compiler understands '-MD'.
|
# foo.o: sub/foo.h
|
||||||
# Will always output deps to 'file.d' where file is the root name of the
|
# which is wrong. We want:
|
||||||
# source file under compilation, even if file resides in a subdirectory.
|
# sub/foo.o: sub/foo.c
|
||||||
# The object file name does not affect the name of the '.d' file.
|
# sub/foo.o: sub/foo.h
|
||||||
# pgcc 10.2 will output
|
# sub/foo.c:
|
||||||
|
# sub/foo.h:
|
||||||
|
# ICC 7.1 will output
|
||||||
# foo.o: sub/foo.c sub/foo.h
|
# foo.o: sub/foo.c sub/foo.h
|
||||||
# and will wrap long lines using '\' :
|
# and will wrap long lines using \ :
|
||||||
# foo.o: sub/foo.c ... \
|
# foo.o: sub/foo.c ... \
|
||||||
# sub/foo.h ... \
|
# sub/foo.h ... \
|
||||||
# ...
|
# ...
|
||||||
set_dir_from "$object"
|
|
||||||
# Use the source, not the object, to determine the base name, since
|
|
||||||
# that's sadly what pgcc will do too.
|
|
||||||
set_base_from "$source"
|
|
||||||
tmpdepfile=$base.d
|
|
||||||
|
|
||||||
# For projects that build the same source file twice into different object
|
"$@" -MD -MF "$tmpdepfile"
|
||||||
# files, the pgcc approach of using the *source* file root name can cause
|
|
||||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
|
||||||
# the same $tmpdepfile.
|
|
||||||
lockdir=$base.d-lock
|
|
||||||
trap "
|
|
||||||
echo '$0: caught signal, cleaning up...' >&2
|
|
||||||
rmdir '$lockdir'
|
|
||||||
exit 1
|
|
||||||
" 1 2 13 15
|
|
||||||
numtries=100
|
|
||||||
i=$numtries
|
|
||||||
while test $i -gt 0; do
|
|
||||||
# mkdir is a portable test-and-set.
|
|
||||||
if mkdir "$lockdir" 2>/dev/null; then
|
|
||||||
# This process acquired the lock.
|
|
||||||
"$@" -MD
|
|
||||||
stat=$?
|
stat=$?
|
||||||
# Release the lock.
|
if test $stat -eq 0; then :
|
||||||
rmdir "$lockdir"
|
|
||||||
break
|
|
||||||
else
|
else
|
||||||
# If the lock is being held by a different process, wait
|
|
||||||
# until the winning process is done or we timeout.
|
|
||||||
while test -d "$lockdir" && test $i -gt 0; do
|
|
||||||
sleep 1
|
|
||||||
i=`expr $i - 1`
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
i=`expr $i - 1`
|
|
||||||
done
|
|
||||||
trap - 1 2 13 15
|
|
||||||
if test $i -le 0; then
|
|
||||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
|
||||||
echo "$0: check lockdir '$lockdir'" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
@@ -427,8 +297,8 @@ pgcc)
|
|||||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
# correctly. Breaking it into two sed invocations is a workaround.
|
||||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
sed -e 's/$/ :/' >> "$depfile"
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -439,8 +309,9 @@ hp2)
|
|||||||
# 'foo.d', which lands next to the object file, wherever that
|
# 'foo.d', which lands next to the object file, wherever that
|
||||||
# happens to be.
|
# happens to be.
|
||||||
# Much of this is similar to the tru64 case; see comments there.
|
# Much of this is similar to the tru64 case; see comments there.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
tmpdepfile1=$dir$base.d
|
tmpdepfile1=$dir$base.d
|
||||||
tmpdepfile2=$dir.libs/$base.d
|
tmpdepfile2=$dir.libs/$base.d
|
||||||
@@ -451,7 +322,8 @@ hp2)
|
|||||||
"$@" +Maked
|
"$@" +Maked
|
||||||
fi
|
fi
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
|
else
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
@@ -461,8 +333,8 @@ hp2)
|
|||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
if test -f "$tmpdepfile"; then
|
if test -f "$tmpdepfile"; then
|
||||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||||
# Add 'dependent.h:' lines.
|
# Add `dependent.h:' lines.
|
||||||
sed -ne '2,${
|
sed -ne '2,${
|
||||||
s/^ *//
|
s/^ *//
|
||||||
s/ \\*$//
|
s/ \\*$//
|
||||||
@@ -470,97 +342,67 @@ hp2)
|
|||||||
p
|
p
|
||||||
}' "$tmpdepfile" >> "$depfile"
|
}' "$tmpdepfile" >> "$depfile"
|
||||||
else
|
else
|
||||||
make_dummy_depfile
|
echo "#dummy" > "$depfile"
|
||||||
fi
|
fi
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
tru64)
|
tru64)
|
||||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||||
# dependencies in 'foo.d' instead, so we check for that too.
|
# dependencies in `foo.d' instead, so we check for that too.
|
||||||
# Subdirectories are respected.
|
# Subdirectories are respected.
|
||||||
set_dir_from "$object"
|
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||||
set_base_from "$object"
|
test "x$dir" = "x$object" && dir=
|
||||||
|
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||||
|
|
||||||
if test "$libtool" = yes; then
|
if test "$libtool" = yes; then
|
||||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
# With Tru64 cc, shared objects can also be used to make a
|
||||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
# static library. This mechanism is used in libtool 1.4 series to
|
||||||
|
# handle both shared and static libraries in a single compilation.
|
||||||
|
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||||
|
#
|
||||||
|
# With libtool 1.5 this exception was removed, and libtool now
|
||||||
|
# generates 2 separate objects for the 2 libraries. These two
|
||||||
|
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||||
# in $dir$base.o.d. We have to check for both files, because
|
# in $dir$base.o.d. We have to check for both files, because
|
||||||
# one of the two compilations can be disabled. We should prefer
|
# one of the two compilations can be disabled. We should prefer
|
||||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||||
# the former would cause a distcleancheck panic.
|
# the former would cause a distcleancheck panic.
|
||||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||||
|
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||||
"$@" -Wc,-MD
|
"$@" -Wc,-MD
|
||||||
else
|
else
|
||||||
tmpdepfile1=$dir$base.d
|
tmpdepfile1=$dir$base.o.d
|
||||||
tmpdepfile2=$dir$base.d
|
tmpdepfile2=$dir$base.d
|
||||||
tmpdepfile3=$dir$base.d
|
tmpdepfile3=$dir$base.d
|
||||||
|
tmpdepfile4=$dir$base.d
|
||||||
"$@" -MD
|
"$@" -MD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
stat=$?
|
stat=$?
|
||||||
if test $stat -ne 0; then
|
if test $stat -eq 0; then :
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
else
|
||||||
|
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
exit $stat
|
exit $stat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||||
do
|
do
|
||||||
test -f "$tmpdepfile" && break
|
test -f "$tmpdepfile" && break
|
||||||
done
|
done
|
||||||
# Same post-processing that is required for AIX mode.
|
if test -f "$tmpdepfile"; then
|
||||||
aix_post_process_depfile
|
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||||
;;
|
# That's a tab and a space in the [].
|
||||||
|
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||||
msvc7)
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
showIncludes=-Wc,-showIncludes
|
|
||||||
else
|
else
|
||||||
showIncludes=-showIncludes
|
echo "#dummy" > "$depfile"
|
||||||
fi
|
fi
|
||||||
"$@" $showIncludes > "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
|
||||||
if test $stat -ne 0; then
|
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
# The first sed program below extracts the file names and escapes
|
|
||||||
# backslashes for cygpath. The second sed program outputs the file
|
|
||||||
# name when reading, but also accumulates all include files in the
|
|
||||||
# hold buffer in order to output them again at the end. This only
|
|
||||||
# works with sed implementations that can handle large buffers.
|
|
||||||
sed < "$tmpdepfile" -n '
|
|
||||||
/^Note: including file: *\(.*\)/ {
|
|
||||||
s//\1/
|
|
||||||
s/\\/\\\\/g
|
|
||||||
p
|
|
||||||
}' | $cygpath_u | sort -u | sed -n '
|
|
||||||
s/ /\\ /g
|
|
||||||
s/\(.*\)/'"$tab"'\1 \\/p
|
|
||||||
s/.\(.*\) \\/\1:/
|
|
||||||
H
|
|
||||||
$ {
|
|
||||||
s/.*/'"$tab"'/
|
|
||||||
G
|
|
||||||
p
|
|
||||||
}' >> "$depfile"
|
|
||||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvc7msys)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
#nosideeffect)
|
#nosideeffect)
|
||||||
@@ -580,7 +422,7 @@ dashmstdout)
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove '-o $object'.
|
# Remove `-o $object'.
|
||||||
IFS=" "
|
IFS=" "
|
||||||
for arg
|
for arg
|
||||||
do
|
do
|
||||||
@@ -600,18 +442,18 @@ dashmstdout)
|
|||||||
done
|
done
|
||||||
|
|
||||||
test -z "$dashmflag" && dashmflag=-M
|
test -z "$dashmflag" && dashmflag=-M
|
||||||
# Require at least two characters before searching for ':'
|
# Require at least two characters before searching for `:'
|
||||||
# in the target name. This is to cope with DOS-style filenames:
|
# in the target name. This is to cope with DOS-style filenames:
|
||||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||||
"$@" $dashmflag |
|
"$@" $dashmflag |
|
||||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
tr ' ' '
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
' < "$tmpdepfile" | \
|
||||||
tr ' ' "$nl" < "$tmpdepfile" \
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -661,15 +503,12 @@ makedepend)
|
|||||||
touch "$tmpdepfile"
|
touch "$tmpdepfile"
|
||||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
# makedepend may prepend the VPATH from the source file name to the object.
|
cat < "$tmpdepfile" > "$depfile"
|
||||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
' | \
|
||||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||||
# correctly. Breaking it into two sed invocations is a workaround.
|
## correctly. Breaking it into two sed invocations is a workaround.
|
||||||
sed '1,2d' "$tmpdepfile" \
|
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||||
| tr ' ' "$nl" \
|
|
||||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
|
||||||
| sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -686,7 +525,7 @@ cpp)
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove '-o $object'.
|
# Remove `-o $object'.
|
||||||
IFS=" "
|
IFS=" "
|
||||||
for arg
|
for arg
|
||||||
do
|
do
|
||||||
@@ -705,10 +544,10 @@ cpp)
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
"$@" -E \
|
"$@" -E |
|
||||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
sed '$ s: \\$::' > "$tmpdepfile"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
cat < "$tmpdepfile" >> "$depfile"
|
cat < "$tmpdepfile" >> "$depfile"
|
||||||
@@ -755,8 +594,8 @@ msvisualcpp)
|
|||||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||||
rm -f "$depfile"
|
rm -f "$depfile"
|
||||||
echo "$object : \\" > "$depfile"
|
echo "$object : \\" > "$depfile"
|
||||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||||
echo "$tab" >> "$depfile"
|
echo " " >> "$depfile"
|
||||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||||
rm -f "$tmpdepfile"
|
rm -f "$tmpdepfile"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
/* example.c - an example of using libpng
|
/* example.c - an example of using libpng
|
||||||
* Last changed in libpng 1.2.37 [June 4, 2009]
|
* Last changed in libpng 1.2.37 [June 4, 2009]
|
||||||
* This file has been placed in the public domain by the authors.
|
* This file has been placed in the public domain by the authors.
|
||||||
* Maintained 1998-2010 Glenn Randers-Pehrson
|
* Maintained 1998-2009 Glenn Randers-Pehrson
|
||||||
* Maintained 1996, 1997 Andreas Dilger)
|
* Maintained 1996, 1997 Andreas Dilger)
|
||||||
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*/
|
*/
|
||||||
@@ -509,6 +509,9 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
|||||||
* shown below:
|
* shown below:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Check if row_num is in bounds. */
|
||||||
|
if ((row_num >= 0) && (row_num < height))
|
||||||
|
{
|
||||||
/* Get pointer to corresponding row in our
|
/* Get pointer to corresponding row in our
|
||||||
* PNG read buffer.
|
* PNG read buffer.
|
||||||
*/
|
*/
|
||||||
@@ -519,7 +522,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
|||||||
*/
|
*/
|
||||||
if ((old_row != NULL) && (new_row != NULL))
|
if ((old_row != NULL) && (new_row != NULL))
|
||||||
png_progressive_combine_row(png_ptr, old_row, new_row);
|
png_progressive_combine_row(png_ptr, old_row, new_row);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* The rows and passes are called in order, so you don't really
|
* The rows and passes are called in order, so you don't really
|
||||||
* need the row_num and pass, but I'm supplying them because it
|
* need the row_num and pass, but I'm supplying them because it
|
||||||
|
|||||||
131
install-sh
131
install-sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# install - install a program, script, or datafile
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
scriptversion=2013-12-25.23; # UTC
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
@@ -35,21 +35,25 @@ scriptversion=2013-12-25.23; # UTC
|
|||||||
# FSF changes to this file are in the public domain.
|
# FSF changes to this file are in the public domain.
|
||||||
#
|
#
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
# 'make' implicit rules from creating a file called install from it
|
# `make' implicit rules from creating a file called install from it
|
||||||
# when there is no Makefile.
|
# when there is no Makefile.
|
||||||
#
|
#
|
||||||
# This script is compatible with the BSD install script, but was written
|
# This script is compatible with the BSD install script, but was written
|
||||||
# from scratch.
|
# from scratch.
|
||||||
|
|
||||||
tab=' '
|
|
||||||
nl='
|
nl='
|
||||||
'
|
'
|
||||||
IFS=" $tab$nl"
|
IFS=" "" $nl"
|
||||||
|
|
||||||
# Set DOITPROG to "echo" to test this script.
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
doit=${DOITPROG-}
|
doit=${DOITPROG-}
|
||||||
doit_exec=${doit:-exec}
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
# Put in absolute file names if you don't have them in your path;
|
# Put in absolute file names if you don't have them in your path;
|
||||||
# or use environment vars.
|
# or use environment vars.
|
||||||
@@ -64,6 +68,17 @@ mvprog=${MVPROG-mv}
|
|||||||
rmprog=${RMPROG-rm}
|
rmprog=${RMPROG-rm}
|
||||||
stripprog=${STRIPPROG-strip}
|
stripprog=${STRIPPROG-strip}
|
||||||
|
|
||||||
|
posix_glob='?'
|
||||||
|
initialize_posix_glob='
|
||||||
|
test "$posix_glob" != "?" || {
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=
|
||||||
|
else
|
||||||
|
posix_glob=:
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
posix_mkdir=
|
posix_mkdir=
|
||||||
|
|
||||||
# Desired mode of installed file.
|
# Desired mode of installed file.
|
||||||
@@ -82,7 +97,7 @@ dir_arg=
|
|||||||
dst_arg=
|
dst_arg=
|
||||||
|
|
||||||
copy_on_change=false
|
copy_on_change=false
|
||||||
is_target_a_directory=possibly
|
no_target_directory=
|
||||||
|
|
||||||
usage="\
|
usage="\
|
||||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
@@ -128,7 +143,8 @@ while test $# -ne 0; do
|
|||||||
|
|
||||||
-m) mode=$2
|
-m) mode=$2
|
||||||
case $mode in
|
case $mode in
|
||||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
echo "$0: invalid mode: $mode" >&2
|
echo "$0: invalid mode: $mode" >&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
@@ -139,16 +155,10 @@ while test $# -ne 0; do
|
|||||||
|
|
||||||
-s) stripcmd=$stripprog;;
|
-s) stripcmd=$stripprog;;
|
||||||
|
|
||||||
-t)
|
-t) dst_arg=$2
|
||||||
is_target_a_directory=always
|
|
||||||
dst_arg=$2
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
shift;;
|
shift;;
|
||||||
|
|
||||||
-T) is_target_a_directory=never;;
|
-T) no_target_directory=true;;
|
||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit $?;;
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
@@ -163,16 +173,6 @@ while test $# -ne 0; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# We allow the use of options -d and -T together, by making -d
|
|
||||||
# take the precedence; this is for compatibility with GNU install.
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
echo "$0: target directory not allowed when installing a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
# When -d is used, all remaining arguments are directories to create.
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
# When -t is used, the destination is already specified.
|
# When -t is used, the destination is already specified.
|
||||||
@@ -186,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|||||||
fi
|
fi
|
||||||
shift # arg
|
shift # arg
|
||||||
dst_arg=$arg
|
dst_arg=$arg
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -198,26 +194,13 @@ if test $# -eq 0; then
|
|||||||
echo "$0: no input file specified." >&2
|
echo "$0: no input file specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# It's OK to call 'install-sh -d' without argument.
|
# It's OK to call `install-sh -d' without argument.
|
||||||
# This can happen when creating conditional directories.
|
# This can happen when creating conditional directories.
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
if test -z "$dir_arg"; then
|
||||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
if test ! -d "$dst_arg"; then
|
|
||||||
echo "$0: $dst_arg: Is not a directory." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
do_exit='(exit $ret); exit $ret'
|
|
||||||
trap "ret=129; $do_exit" 1
|
|
||||||
trap "ret=130; $do_exit" 2
|
|
||||||
trap "ret=141; $do_exit" 13
|
|
||||||
trap "ret=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Set umask so as not to create temps with too-generous modes.
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
# However, 'strip' requires both read and write access to temps.
|
# However, 'strip' requires both read and write access to temps.
|
||||||
@@ -245,9 +228,9 @@ fi
|
|||||||
|
|
||||||
for src
|
for src
|
||||||
do
|
do
|
||||||
# Protect names problematic for 'test' and other utilities.
|
# Protect names starting with `-'.
|
||||||
case $src in
|
case $src in
|
||||||
-* | [=\(\)!]) src=./$src;;
|
-*) src=./$src;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
if test -n "$dir_arg"; then
|
||||||
@@ -269,12 +252,17 @@ do
|
|||||||
echo "$0: no destination specified." >&2
|
echo "$0: no destination specified." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dst=$dst_arg
|
dst=$dst_arg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst;;
|
||||||
|
esac
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; won't work
|
# If destination is a directory, append the input filename; won't work
|
||||||
# if double slashes aren't ignored.
|
# if double slashes aren't ignored.
|
||||||
if test -d "$dst"; then
|
if test -d "$dst"; then
|
||||||
if test "$is_target_a_directory" = never; then
|
if test -n "$no_target_directory"; then
|
||||||
echo "$0: $dst_arg: Is a directory" >&2
|
echo "$0: $dst_arg: Is a directory" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -282,7 +270,33 @@ do
|
|||||||
dst=$dstdir/`basename "$src"`
|
dst=$dstdir/`basename "$src"`
|
||||||
dstdir_status=0
|
dstdir_status=0
|
||||||
else
|
else
|
||||||
dstdir=`dirname "$dst"`
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
test -d "$dstdir"
|
test -d "$dstdir"
|
||||||
dstdir_status=$?
|
dstdir_status=$?
|
||||||
fi
|
fi
|
||||||
@@ -333,7 +347,7 @@ do
|
|||||||
if test -z "$dir_arg" || {
|
if test -z "$dir_arg" || {
|
||||||
# Check for POSIX incompatibilities with -m.
|
# Check for POSIX incompatibilities with -m.
|
||||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
# other-writable bit of parent directory when it shouldn't.
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
case $ls_ld_tmpdir in
|
case $ls_ld_tmpdir in
|
||||||
@@ -371,23 +385,25 @@ do
|
|||||||
|
|
||||||
case $dstdir in
|
case $dstdir in
|
||||||
/*) prefix='/';;
|
/*) prefix='/';;
|
||||||
[-=\(\)!]*) prefix='./';;
|
-*) prefix='./';;
|
||||||
*) prefix='';;
|
*) prefix='';;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob"
|
||||||
|
|
||||||
oIFS=$IFS
|
oIFS=$IFS
|
||||||
IFS=/
|
IFS=/
|
||||||
set -f
|
$posix_glob set -f
|
||||||
set fnord $dstdir
|
set fnord $dstdir
|
||||||
shift
|
shift
|
||||||
set +f
|
$posix_glob set +f
|
||||||
IFS=$oIFS
|
IFS=$oIFS
|
||||||
|
|
||||||
prefixes=
|
prefixes=
|
||||||
|
|
||||||
for d
|
for d
|
||||||
do
|
do
|
||||||
test X"$d" = X && continue
|
test -z "$d" && continue
|
||||||
|
|
||||||
prefix=$prefix$d
|
prefix=$prefix$d
|
||||||
if test -d "$prefix"; then
|
if test -d "$prefix"; then
|
||||||
@@ -451,10 +467,13 @@ do
|
|||||||
if $copy_on_change &&
|
if $copy_on_change &&
|
||||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||||
set -f &&
|
|
||||||
|
eval "$initialize_posix_glob" &&
|
||||||
|
$posix_glob set -f &&
|
||||||
set X $old && old=:$2:$4:$5:$6 &&
|
set X $old && old=:$2:$4:$5:$6 &&
|
||||||
set X $new && new=:$2:$4:$5:$6 &&
|
set X $new && new=:$2:$4:$5:$6 &&
|
||||||
set +f &&
|
$posix_glob set +f &&
|
||||||
|
|
||||||
test "$old" = "$new" &&
|
test "$old" = "$new" &&
|
||||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.0.65 - December 3, 2015
|
libpng version 1.2.41beta17 - November 10, 2009
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp at users.sourceforge.net>
|
<glennrp at users.sourceforge.net>
|
||||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
|
|
||||||
This document is released under the libpng license.
|
This document is released under the libpng license.
|
||||||
For conditions of distribution and use, see the disclaimer
|
For conditions of distribution and use, see the disclaimer
|
||||||
@@ -11,9 +11,9 @@ libpng.txt - A description on how to use and modify libpng
|
|||||||
|
|
||||||
Based on:
|
Based on:
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.0.65 - December 3, 2015
|
libpng versions 0.97, January 1998, through 1.2.41beta17 - November 10, 2009
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
|
|
||||||
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
||||||
Updated and distributed by Andreas Dilger
|
Updated and distributed by Andreas Dilger
|
||||||
@@ -40,8 +40,8 @@ will need. We assume that libpng is already installed; see the
|
|||||||
INSTALL file for instructions on how to install libpng.
|
INSTALL file for instructions on how to install libpng.
|
||||||
|
|
||||||
For examples of libpng usage, see the files "example.c", "pngtest.c",
|
For examples of libpng usage, see the files "example.c", "pngtest.c",
|
||||||
and the files in the "contrib" directory, all of which are included in
|
and the files in the "contrib" directory, all of which are included in the
|
||||||
the libpng distribution.
|
libpng distribution.
|
||||||
|
|
||||||
Libpng was written as a companion to the PNG specification, as a way
|
Libpng was written as a companion to the PNG specification, as a way
|
||||||
of reducing the amount of time and effort it takes to support the PNG
|
of reducing the amount of time and effort it takes to support the PNG
|
||||||
@@ -53,16 +53,15 @@ a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at
|
|||||||
The W3C and ISO documents have identical technical content.
|
The W3C and ISO documents have identical technical content.
|
||||||
|
|
||||||
The PNG-1.2 specification is available at
|
The PNG-1.2 specification is available at
|
||||||
<http://png-mng.sourceforge.net/pub/png/spec/1.2/>.
|
<http://www.libpng.org/pub/png/documents/>. It is technically equivalent
|
||||||
It is technically equivalent
|
|
||||||
to the PNG specification (second edition) but has some additional material.
|
to the PNG specification (second edition) but has some additional material.
|
||||||
|
|
||||||
The PNG-1.0 specification is available as RFC 2083
|
The PNG-1.0 specification is available
|
||||||
<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a
|
as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a
|
||||||
W3C Recommendation <http://www.w3.org/TR/REC-png-961001>.
|
W3C Recommendation <http://www.w3.org/TR/REC.png.html>.
|
||||||
|
|
||||||
Some additional chunks are described in the special-purpose public chunks
|
Some additional chunks are described in the special-purpose public chunks
|
||||||
documents at <http://www.libpng.org/pub/png/spec/register/>
|
documents at <http://www.libpng.org/pub/png/documents/>.
|
||||||
|
|
||||||
Other information
|
Other information
|
||||||
about PNG, and the latest version of libpng, can be found at the PNG home
|
about PNG, and the latest version of libpng, can be found at the PNG home
|
||||||
@@ -84,7 +83,7 @@ majority of the needs of its users.
|
|||||||
|
|
||||||
Libpng uses zlib for its compression and decompression of PNG files.
|
Libpng uses zlib for its compression and decompression of PNG files.
|
||||||
Further information about zlib, and the latest version of zlib, can
|
Further information about zlib, and the latest version of zlib, can
|
||||||
be found at the zlib home page, <http://zlib.net/>.
|
be found at the zlib home page, <http://www.info-zip.org/pub/infozip/zlib/>.
|
||||||
The zlib compression utility is a general purpose utility that is
|
The zlib compression utility is a general purpose utility that is
|
||||||
useful for more than PNG files, and can be used without libpng.
|
useful for more than PNG files, and can be used without libpng.
|
||||||
See the documentation delivered with zlib for more details.
|
See the documentation delivered with zlib for more details.
|
||||||
@@ -151,7 +150,7 @@ prediction.
|
|||||||
|
|
||||||
If you are intending to keep the file pointer open for use in libpng,
|
If you are intending to keep the file pointer open for use in libpng,
|
||||||
you must ensure you don't read more than 8 bytes from the beginning
|
you must ensure you don't read more than 8 bytes from the beginning
|
||||||
of the file, and you also have to make a call to png_set_sig_bytes()
|
of the file, and you also have to make a call to png_set_sig_bytes_read()
|
||||||
with the number of bytes you read from the beginning. Libpng will
|
with the number of bytes you read from the beginning. Libpng will
|
||||||
then only check the bytes (if any) that your program didn't read.
|
then only check the bytes (if any) that your program didn't read.
|
||||||
|
|
||||||
@@ -459,8 +458,8 @@ dithering, and setting filler.) If this is the case, simply do this:
|
|||||||
|
|
||||||
png_read_png(png_ptr, info_ptr, png_transforms, NULL)
|
png_read_png(png_ptr, info_ptr, png_transforms, NULL)
|
||||||
|
|
||||||
where png_transforms is an integer containing the bitwise OR of some
|
where png_transforms is an integer containing the bitwise OR of
|
||||||
set of transformation flags. This call is equivalent to png_read_info(),
|
some set of transformation flags. This call is equivalent to png_read_info(),
|
||||||
followed the set of transformations indicated by the transform mask,
|
followed the set of transformations indicated by the transform mask,
|
||||||
then png_read_image(), and finally png_read_end().
|
then png_read_image(), and finally png_read_end().
|
||||||
|
|
||||||
@@ -611,8 +610,8 @@ These are also important, but their validity depends on whether the chunk
|
|||||||
has been read. The png_get_valid(png_ptr, info_ptr, PNG_INFO_<chunk>) and
|
has been read. The png_get_valid(png_ptr, info_ptr, PNG_INFO_<chunk>) and
|
||||||
png_get_<chunk>(png_ptr, info_ptr, ...) functions return non-zero if the
|
png_get_<chunk>(png_ptr, info_ptr, ...) functions return non-zero if the
|
||||||
data has been read, or zero if it is missing. The parameters to the
|
data has been read, or zero if it is missing. The parameters to the
|
||||||
png_get_<chunk> are set directly if they are simple data types, or a
|
png_get_<chunk> are set directly if they are simple data types, or a pointer
|
||||||
pointer into the info_ptr is returned for any complex types.
|
into the info_ptr is returned for any complex types.
|
||||||
|
|
||||||
png_get_PLTE(png_ptr, info_ptr, &palette,
|
png_get_PLTE(png_ptr, info_ptr, &palette,
|
||||||
&num_palette);
|
&num_palette);
|
||||||
@@ -846,7 +845,7 @@ unless the library has been told to transform it into another format.
|
|||||||
For example, 4 bit/pixel paletted or grayscale data will be returned
|
For example, 4 bit/pixel paletted or grayscale data will be returned
|
||||||
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
||||||
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
||||||
in RGB RGB RGB format unless png_set_filler()
|
in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha()
|
||||||
is called to insert filler bytes, either before or after each RGB triplet.
|
is called to insert filler bytes, either before or after each RGB triplet.
|
||||||
16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant
|
16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant
|
||||||
byte of the color value first, unless png_set_strip_16() is called to
|
byte of the color value first, unless png_set_strip_16() is called to
|
||||||
@@ -854,7 +853,7 @@ transform it to regular RGB RGB triplets, or png_set_filler() or
|
|||||||
png_set_add alpha() is called to insert filler bytes, either before or
|
png_set_add alpha() is called to insert filler bytes, either before or
|
||||||
after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can
|
after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can
|
||||||
be modified with
|
be modified with
|
||||||
png_set_filler() or png_set_strip_16().
|
png_set_filler(), png_set_add_alpha(), or png_set_strip_16().
|
||||||
|
|
||||||
The following code transforms grayscale images of less than 8 to 8 bits,
|
The following code transforms grayscale images of less than 8 to 8 bits,
|
||||||
changes paletted images to RGB, and adds a full alpha channel if there is
|
changes paletted images to RGB, and adds a full alpha channel if there is
|
||||||
@@ -866,7 +865,7 @@ viewing application that wishes to treat all images in the same way.
|
|||||||
png_set_palette_to_rgb(png_ptr);
|
png_set_palette_to_rgb(png_ptr);
|
||||||
|
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY &&
|
if (color_type == PNG_COLOR_TYPE_GRAY &&
|
||||||
bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||||
|
|
||||||
if (png_get_valid(png_ptr, info_ptr,
|
if (png_get_valid(png_ptr, info_ptr,
|
||||||
PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
||||||
@@ -879,7 +878,7 @@ things.
|
|||||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
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.
|
added. It expands the sample depth without changing tRNS to alpha.
|
||||||
|
|
||||||
As of libpng version 1.0.65, not all possible expansions are supported.
|
As of libpng version 1.2.41beta17, not all possible expansions are supported.
|
||||||
|
|
||||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||||
indexed with depth<8, other numerals represent the color type, "T" means
|
indexed with depth<8, other numerals represent the color type, "T" means
|
||||||
@@ -958,10 +957,10 @@ values of the pixels:
|
|||||||
|
|
||||||
PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels
|
PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels
|
||||||
stored in a PNG image have been "scaled" or "shifted" up to the next
|
stored in a PNG image have been "scaled" or "shifted" up to the next
|
||||||
higher possible bit depth (e.g. from 5 bits/sample in the range [0,31]
|
higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] to
|
||||||
to 8 bits/sample in the range [0, 255]). However, it is also possible
|
8 bits/sample in the range [0, 255]). However, it is also possible to
|
||||||
to convert the PNG pixel data back to the original bit depth of the
|
convert the PNG pixel data back to the original bit depth of the image.
|
||||||
image. This call reduces the pixels back down to the original bit depth:
|
This call reduces the pixels back down to the original bit depth:
|
||||||
|
|
||||||
png_color_8p sig_bit;
|
png_color_8p sig_bit;
|
||||||
|
|
||||||
@@ -988,7 +987,16 @@ does not affect images that already have full alpha channels. To add an
|
|||||||
opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which
|
opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which
|
||||||
will generate RGBA pixels.
|
will generate RGBA pixels.
|
||||||
|
|
||||||
|
Note that png_set_filler() does not change the color type. If you want
|
||||||
|
to do that, you can add a true alpha channel with
|
||||||
|
|
||||||
|
if (color_type == PNG_COLOR_TYPE_RGB ||
|
||||||
color_type == PNG_COLOR_TYPE_GRAY)
|
color_type == PNG_COLOR_TYPE_GRAY)
|
||||||
|
png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER);
|
||||||
|
|
||||||
|
where "filler" contains the alpha value to assign to each pixel.
|
||||||
|
This function was added in libpng-1.2.7.
|
||||||
|
|
||||||
If you are reading an image with an alpha channel, and you need the
|
If you are reading an image with an alpha channel, and you need the
|
||||||
data as ARGB instead of the normal PNG format RGBA:
|
data as ARGB instead of the normal PNG format RGBA:
|
||||||
|
|
||||||
@@ -1040,12 +1048,9 @@ the normalized graylevel is computed:
|
|||||||
int bw = 65536 - (rw + gw);
|
int bw = 65536 - (rw + gw);
|
||||||
gray = (rw*red + gw*green + bw*blue)/65536;
|
gray = (rw*red + gw*green + bw*blue)/65536;
|
||||||
|
|
||||||
The default values come from the PNG file cHRM chunk if present; otherwise, the
|
The default values approximate those recommended in the Charles
|
||||||
defaults correspond to the ITU-R recommendation 709, and also the sRGB color
|
Poynton's Color FAQ, <http://www.inforamp.net/~poynton/>
|
||||||
space, as recommended in the Charles Poynton's Colour FAQ,
|
Copyright (c) 1998-01-04 Charles Poynton <poynton at inforamp.net>
|
||||||
Copyright (c) 2006-11-28 Charles Poynton, in section 9:
|
|
||||||
|
|
||||||
<http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC9>
|
|
||||||
|
|
||||||
Y = 0.212671 * R + 0.715160 * G + 0.072169 * B
|
Y = 0.212671 * R + 0.715160 * G + 0.072169 * B
|
||||||
|
|
||||||
@@ -1402,11 +1407,12 @@ point to libpng-allocated storage with the following function:
|
|||||||
|
|
||||||
This function may be safely called when the relevant storage has
|
This function may be safely called when the relevant storage has
|
||||||
already been freed, or has not yet been allocated, or was allocated
|
already been freed, or has not yet been allocated, or was allocated
|
||||||
by the user and not by libpng, and will in those cases do nothing.
|
by the user and not by libpng, and will in those
|
||||||
The "seq" parameter is ignored if only one item of the selected data
|
cases do nothing. The "seq" parameter is ignored if only one item
|
||||||
type, such as PLTE, is allowed. If "seq" is not -1, and multiple items
|
of the selected data type, such as PLTE, is allowed. If "seq" is not
|
||||||
are allowed for the data type identified in the mask, such as text or
|
-1, and multiple items are allowed for the data type identified in
|
||||||
sPLT, only the n'th item in the structure is freed, where n is "seq".
|
the mask, such as text or sPLT, only the n'th item in the structure
|
||||||
|
is freed, where n is "seq".
|
||||||
|
|
||||||
The default behavior is only to free data that was allocated internally
|
The default behavior is only to free data that was allocated internally
|
||||||
by libpng. This can be changed, so that libpng will not free the data,
|
by libpng. This can be changed, so that libpng will not free the data,
|
||||||
@@ -1445,8 +1451,8 @@ if you transfer responsibility for free'ing text_ptr from libpng to your
|
|||||||
application, your application must not separately free those members.
|
application, your application must not separately free those members.
|
||||||
|
|
||||||
The png_free_data() function will turn off the "valid" flag for anything
|
The png_free_data() function will turn off the "valid" flag for anything
|
||||||
it frees. If you need to turn the flag off for a chunk that was freed by
|
it frees. If you need to turn the flag off for a chunk that was freed by your
|
||||||
your application instead of by libpng, you can use
|
application instead of by libpng, you can use
|
||||||
|
|
||||||
png_set_invalid(png_ptr, info_ptr, mask);
|
png_set_invalid(png_ptr, info_ptr, mask);
|
||||||
mask - identifies the chunks to be made invalid,
|
mask - identifies the chunks to be made invalid,
|
||||||
@@ -1756,8 +1762,8 @@ the filter method, for which the only valid values are 0 (as of the
|
|||||||
July 1999 PNG specification, version 1.2) or 64 (if you are writing
|
July 1999 PNG specification, version 1.2) or 64 (if you are writing
|
||||||
a PNG datastream that is to be embedded in a MNG datastream). The third
|
a PNG datastream that is to be embedded in a MNG datastream). The third
|
||||||
parameter is a flag that indicates which filter type(s) are to be tested
|
parameter is a flag that indicates which filter type(s) are to be tested
|
||||||
for each scanline. See the PNG specification for details on the specific
|
for each scanline. See the PNG specification for details on the specific filter
|
||||||
filter types.
|
types.
|
||||||
|
|
||||||
|
|
||||||
/* turn on or off filtering, and/or choose
|
/* turn on or off filtering, and/or choose
|
||||||
@@ -1872,7 +1878,6 @@ width, height, bit_depth, and color_type must be the same in each call.
|
|||||||
(array of png_color)
|
(array of png_color)
|
||||||
num_palette - number of entries in the palette
|
num_palette - number of entries in the palette
|
||||||
|
|
||||||
|
|
||||||
png_set_gAMA(png_ptr, info_ptr, gamma);
|
png_set_gAMA(png_ptr, info_ptr, gamma);
|
||||||
gamma - the gamma the image was created
|
gamma - the gamma the image was created
|
||||||
at (PNG_INFO_gAMA)
|
at (PNG_INFO_gAMA)
|
||||||
@@ -2176,10 +2181,10 @@ this with a call to png_write_info().
|
|||||||
|
|
||||||
Note that there is one transformation you may need to do before
|
Note that there is one transformation you may need to do before
|
||||||
png_write_info(). In PNG files, the alpha channel in an image is the
|
png_write_info(). In PNG files, the alpha channel in an image is the
|
||||||
level of opacity. If your data is supplied as a level of transparency,
|
level of opacity. If your data is supplied as a level of
|
||||||
you can invert the alpha channel before you write it, so that 0 is
|
transparency, you can invert the alpha channel before you write it, so
|
||||||
fully transparent and 255 (in 8-bit or paletted images) or 65535
|
that 0 is fully transparent and 255 (in 8-bit or paletted images) or
|
||||||
(in 16-bit images) is fully opaque, with
|
65535 (in 16-bit images) is fully opaque, with
|
||||||
|
|
||||||
png_set_invert_alpha(png_ptr);
|
png_set_invert_alpha(png_ptr);
|
||||||
|
|
||||||
@@ -2366,13 +2371,14 @@ a single row_pointer instead of an array of row_pointers:
|
|||||||
|
|
||||||
png_write_row(png_ptr, row_pointer);
|
png_write_row(png_ptr, row_pointer);
|
||||||
|
|
||||||
When the file is interlaced, things can get a good deal more complicated.
|
When the file is interlaced, things can get a good deal more
|
||||||
The only currently (as of the PNG Specification version 1.2, dated July
|
complicated. The only currently (as of the PNG Specification
|
||||||
1999) defined interlacing scheme for PNG files is the "Adam7" interlace
|
version 1.2, dated July 1999) defined interlacing scheme for PNG files
|
||||||
scheme, that breaks down an image into seven smaller images of varying
|
is the "Adam7" interlace scheme, that breaks down an
|
||||||
size. libpng will build these images for you, or you can do them
|
image into seven smaller images of varying size. libpng will build
|
||||||
yourself. If you want to build them yourself, see the PNG specification
|
these images for you, or you can do them yourself. If you want to
|
||||||
for details of which pixels to write when.
|
build them yourself, see the PNG specification for details of which
|
||||||
|
pixels to write when.
|
||||||
|
|
||||||
If you don't want libpng to handle the interlacing details, just
|
If you don't want libpng to handle the interlacing details, just
|
||||||
use png_set_interlace_handling() and call png_write_rows() the
|
use png_set_interlace_handling() and call png_write_rows() the
|
||||||
@@ -2384,17 +2390,17 @@ writing any rows:
|
|||||||
number_of_passes =
|
number_of_passes =
|
||||||
png_set_interlace_handling(png_ptr);
|
png_set_interlace_handling(png_ptr);
|
||||||
|
|
||||||
This will return the number of passes needed. Currently, this is seven,
|
This will return the number of passes needed. Currently, this
|
||||||
but may change if another interlace type is added.
|
is seven, but may change if another interlace type is added.
|
||||||
|
|
||||||
Then write the complete image number_of_passes times.
|
Then write the complete image number_of_passes times.
|
||||||
|
|
||||||
png_write_rows(png_ptr, row_pointers,
|
png_write_rows(png_ptr, row_pointers,
|
||||||
number_of_rows);
|
number_of_rows);
|
||||||
|
|
||||||
As some of these rows are not used, and thus return immediately, you may
|
As some of these rows are not used, and thus return immediately,
|
||||||
want to read about interlacing in the PNG specification, and only update
|
you may want to read about interlacing in the PNG specification,
|
||||||
the rows that are actually used.
|
and only update the rows that are actually used.
|
||||||
|
|
||||||
Finishing a sequential write
|
Finishing a sequential write
|
||||||
|
|
||||||
@@ -2427,14 +2433,15 @@ point to libpng-allocated storage with the following function:
|
|||||||
|
|
||||||
This function may be safely called when the relevant storage has
|
This function may be safely called when the relevant storage has
|
||||||
already been freed, or has not yet been allocated, or was allocated
|
already been freed, or has not yet been allocated, or was allocated
|
||||||
by the user and not by libpng, and will in those cases do nothing.
|
by the user and not by libpng, and will in those
|
||||||
The "seq" parameter is ignored if only one item of the selected data
|
cases do nothing. The "seq" parameter is ignored if only one item
|
||||||
type, such as PLTE, is allowed. If "seq" is not -1, and multiple items
|
of the selected data type, such as PLTE, is allowed. If "seq" is not
|
||||||
are allowed for the data type identified in the mask, such as text or
|
-1, and multiple items are allowed for the data type identified in
|
||||||
sPLT, only the n'th item in the structure is freed, where n is "seq".
|
the mask, such as text or sPLT, only the n'th item in the structure
|
||||||
|
is freed, where n is "seq".
|
||||||
|
|
||||||
If you allocated data such as a palette that you passed in to libpng
|
If you allocated data such as a palette that you passed
|
||||||
with png_set_*, you must not free it until just before the call to
|
in to libpng with png_set_*, you must not free it until just before the call to
|
||||||
png_destroy_write_struct().
|
png_destroy_write_struct().
|
||||||
|
|
||||||
The default behavior is only to free data that was allocated internally
|
The default behavior is only to free data that was allocated internally
|
||||||
@@ -2500,18 +2507,16 @@ goes through callbacks that are user-settable. The default routines are
|
|||||||
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change
|
||||||
these functions, call the appropriate png_set_*_fn() function.
|
these functions, call the appropriate png_set_*_fn() function.
|
||||||
|
|
||||||
Memory allocation is done through the functions png_malloc(), png_calloc(),
|
Memory allocation is done through the functions png_malloc()
|
||||||
and png_free(). These currently just call the standard C functions.
|
and png_free(). These currently just call the standard C functions. If
|
||||||
png_calloc() calls png_malloc() and then png_memset() to clear the newly
|
your pointers can't access more then 64K at a time, you will want to set
|
||||||
allocated memory to zero. If your pointers can't access more then 64K
|
MAXSEG_64K in zlib.h. Since it is unlikely that the method of handling
|
||||||
at a time, you will want to set MAXSEG_64K in zlib.h. Since it is
|
memory allocation on a platform will change between applications, these
|
||||||
unlikely that the method of handling memory allocation on a platform
|
functions must be modified in the library at compile time. If you prefer
|
||||||
will change between applications, these functions must be modified in
|
to use a different method of allocating and freeing data, you can use
|
||||||
the library at compile time. If you prefer to use a different method
|
png_create_read_struct_2() or png_create_write_struct_2() to register
|
||||||
of allocating and freeing data, you can use png_create_read_struct_2() or
|
your own functions as described above.
|
||||||
png_create_write_struct_2() to register your own functions as described
|
These functions also provide a void pointer that can be retrieved via
|
||||||
above. These functions also provide a void pointer that can be retrieved
|
|
||||||
via
|
|
||||||
|
|
||||||
mem_ptr=png_get_mem_ptr(png_ptr);
|
mem_ptr=png_get_mem_ptr(png_ptr);
|
||||||
|
|
||||||
@@ -2603,10 +2608,10 @@ The motivation behind using setjmp() and longjmp() is the C++ throw and
|
|||||||
catch exception handling methods. This makes the code much easier to write,
|
catch exception handling methods. This makes the code much easier to write,
|
||||||
as there is no need to check every return code of every function call.
|
as there is no need to check every return code of every function call.
|
||||||
However, there are some uncertainties about the status of local variables
|
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 a longjmp, so the user may want to be careful about doing anything after
|
||||||
after setjmp returns non-zero besides returning itself. Consult your
|
setjmp returns non-zero besides returning itself. Consult your compiler
|
||||||
compiler documentation for more details. For an alternative approach, you
|
documentation for more details. For an alternative approach, you may wish
|
||||||
may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net).
|
to use the "cexcept" facility (see http://cexcept.sourceforge.net).
|
||||||
|
|
||||||
Custom chunks
|
Custom chunks
|
||||||
|
|
||||||
@@ -2618,14 +2623,15 @@ library code itself needs to know about interactions between your
|
|||||||
chunk and existing `intrinsic' chunks.
|
chunk and existing `intrinsic' chunks.
|
||||||
|
|
||||||
If you need to write a new intrinsic chunk, first read the PNG
|
If you need to write a new intrinsic chunk, first read the PNG
|
||||||
specification. Acquire a first level of understanding of how it works.
|
specification. Acquire a first level of
|
||||||
Pay particular attention to the sections that describe chunk names,
|
understanding of how it works. Pay particular attention to the
|
||||||
and look at how other chunks were designed, so you can do things
|
sections that describe chunk names, and look at how other chunks were
|
||||||
similarly. Second, check out the sections of libpng that read and
|
designed, so you can do things similarly. Second, check out the
|
||||||
write chunks. Try to find a chunk that is similar to yours and use
|
sections of libpng that read and write chunks. Try to find a chunk
|
||||||
it as a template. More details can be found in the comments inside
|
that is similar to yours and use it as a template. More details can
|
||||||
the code. It is best to handle unknown chunks in a generic method,
|
be found in the comments inside the code. It is best to handle unknown
|
||||||
via callback functions, instead of by modifying libpng functions.
|
chunks in a generic method, via callback functions, instead of by
|
||||||
|
modifying libpng functions.
|
||||||
|
|
||||||
If you wish to write your own transformation for the data, look through
|
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
|
the part of the code that does the transformations, and check out some of
|
||||||
@@ -2753,6 +2759,41 @@ is called for the first time.)
|
|||||||
same as the value of filter_method used
|
same as the value of filter_method used
|
||||||
in png_set_IHDR().
|
in png_set_IHDR().
|
||||||
|
|
||||||
|
It is also possible to influence how libpng chooses from among the
|
||||||
|
available filters. This is done in one or both of two ways - by
|
||||||
|
telling it how important it is to keep the same filter for successive
|
||||||
|
rows, and by telling it the relative computational costs of the filters.
|
||||||
|
|
||||||
|
double weights[3] = {1.5, 1.3, 1.1},
|
||||||
|
costs[PNG_FILTER_VALUE_LAST] =
|
||||||
|
{1.0, 1.3, 1.3, 1.5, 1.7};
|
||||||
|
|
||||||
|
png_set_filter_heuristics(png_ptr,
|
||||||
|
PNG_FILTER_HEURISTIC_WEIGHTED, 3,
|
||||||
|
weights, costs);
|
||||||
|
|
||||||
|
The weights are multiplying factors that indicate to libpng that the
|
||||||
|
row filter should be the same for successive rows unless another row filter
|
||||||
|
is that many times better than the previous filter. In the above example,
|
||||||
|
if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a
|
||||||
|
"sum of absolute differences" 1.5 x 1.3 times higher than other filters
|
||||||
|
and still be chosen, while the NONE filter could have a sum 1.1 times
|
||||||
|
higher than other filters and still be chosen. Unspecified weights are
|
||||||
|
taken to be 1.0, and the specified weights should probably be declining
|
||||||
|
like those above in order to emphasize recent filters over older filters.
|
||||||
|
|
||||||
|
The filter costs specify for each filter type a relative decoding cost
|
||||||
|
to be considered when selecting row filters. This means that filters
|
||||||
|
with higher costs are less likely to be chosen over filters with lower
|
||||||
|
costs, unless their "sum of absolute differences" is that much smaller.
|
||||||
|
The costs do not necessarily reflect the exact computational speeds of
|
||||||
|
the various filters, since this would unduly influence the final image
|
||||||
|
size.
|
||||||
|
|
||||||
|
Note that the numbers above were invented purely for this example and
|
||||||
|
are given only to help explain the function usage. Little testing has
|
||||||
|
been done to find optimum values for either the costs or the weights.
|
||||||
|
|
||||||
Removing unwanted object code
|
Removing unwanted object code
|
||||||
|
|
||||||
There are a bunch of #define's in pngconf.h that control what parts of
|
There are a bunch of #define's in pngconf.h that control what parts of
|
||||||
@@ -2767,14 +2808,14 @@ off en masse with compiler directives that define
|
|||||||
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
|
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
|
||||||
or all four,
|
or all four,
|
||||||
along with directives to turn on any of the capabilities that you do
|
along with directives to turn on any of the capabilities that you do
|
||||||
want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the extra
|
want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable
|
||||||
transformations but still leave the library fully capable of reading
|
the extra transformations but still leave the library fully capable of reading
|
||||||
and writing PNG files with all known public chunks. Use of the
|
and writing PNG files with all known public chunks
|
||||||
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
|
Use of the PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive
|
||||||
that is incapable of reading or writing ancillary chunks. If you are
|
produces a library that is incapable of reading or writing ancillary chunks.
|
||||||
not using the progressive reading capability, you can turn that off
|
If you are not using the progressive reading capability, you can
|
||||||
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
|
turn that off with PNG_NO_PROGRESSIVE_READ (don't confuse
|
||||||
capability, which you'll still have).
|
this with the INTERLACING capability, which you'll still have).
|
||||||
|
|
||||||
All the reading and writing specific code are in separate files, so the
|
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
|
linker should only grab the files it needs. However, if you want to
|
||||||
@@ -2810,7 +2851,7 @@ the message, "message" is the formatted string to be printed,
|
|||||||
and p1 and p2 are parameters that are to be embedded in the string
|
and p1 and p2 are parameters that are to be embedded in the string
|
||||||
according to printf-style formatting directives. For example,
|
according to printf-style formatting directives. For example,
|
||||||
|
|
||||||
png_debug1(2, "foo=%d", foo);
|
png_debug1(2, "foo=%d\n", foo);
|
||||||
|
|
||||||
is expanded to
|
is expanded to
|
||||||
|
|
||||||
@@ -2888,9 +2929,6 @@ png_set_error_fn(), which is essentially the same function, but with a new
|
|||||||
name to force compilation errors with applications that try to use the old
|
name to force compilation errors with applications that try to use the old
|
||||||
method.
|
method.
|
||||||
|
|
||||||
Support for the sCAL, iCCP, iTXt, and sPLT chunks was added at libpng-1.0.6;
|
|
||||||
however, iTXt support was not enabled by default.
|
|
||||||
|
|
||||||
Starting with version 1.0.7, you can find out which version of the library
|
Starting with version 1.0.7, you can find out which version of the library
|
||||||
you are using at run-time:
|
you are using at run-time:
|
||||||
|
|
||||||
@@ -2905,17 +2943,103 @@ application:
|
|||||||
|
|
||||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||||
|
|
||||||
Starting with libpng-1.0.64, attempting to set an over-length
|
VIII. Changes to Libpng from version 1.0.x to 1.2.x
|
||||||
PLTE chunk is an error. Previously this requirement of the PNG specification
|
|
||||||
was not enforced, and the palette was always limited to 256 entries.
|
|
||||||
An over-length PLTE chunk found in an input PNG is silently truncated.
|
|
||||||
VIII. (Omitted).
|
|
||||||
|
|
||||||
|
Support for user memory management was enabled by default. To
|
||||||
|
accomplish this, the functions png_create_read_struct_2(),
|
||||||
|
png_create_write_struct_2(), png_set_mem_fn(), png_get_mem_ptr(),
|
||||||
|
png_malloc_default(), and png_free_default() were added.
|
||||||
|
|
||||||
|
Support for the iTXt chunk has been enabled by default as of
|
||||||
|
version 1.2.41.
|
||||||
|
|
||||||
|
Support for certain MNG features was enabled.
|
||||||
|
|
||||||
|
Support for numbered error messages was added. However, we never got
|
||||||
|
around to actually numbering the error messages. The function
|
||||||
|
png_set_strip_error_numbers() was added (Note: the prototype for this
|
||||||
|
function was inadvertently removed from png.h in PNG_NO_ASSEMBLER_CODE
|
||||||
|
builds of libpng-1.2.15. It was restored in libpng-1.2.36).
|
||||||
|
|
||||||
|
The png_malloc_warn() function was added at libpng-1.2.3. This issues
|
||||||
|
a png_warning and returns NULL instead of aborting when it fails to
|
||||||
|
acquire the requested memory allocation.
|
||||||
|
|
||||||
|
Support for setting user limits on image width and height was enabled
|
||||||
|
by default. The functions png_set_user_limits(), png_get_user_width_max(),
|
||||||
|
and png_get_user_height_max() were added at libpng-1.2.6.
|
||||||
|
|
||||||
|
The png_set_add_alpha() function was added at libpng-1.2.7.
|
||||||
|
|
||||||
|
The function png_set_expand_gray_1_2_4_to_8() was added at libpng-1.2.9.
|
||||||
|
Unlike png_set_gray_1_2_4_to_8(), the new function does not expand the
|
||||||
|
tRNS chunk to alpha. The png_set_gray_1_2_4_to_8() function is
|
||||||
|
deprecated.
|
||||||
|
|
||||||
|
A number of macro definitions in support of runtime selection of
|
||||||
|
assembler code features (especially Intel MMX code support) were
|
||||||
|
added at libpng-1.2.0:
|
||||||
|
|
||||||
|
PNG_ASM_FLAG_MMX_SUPPORT_COMPILED
|
||||||
|
PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU
|
||||||
|
PNG_ASM_FLAG_MMX_READ_COMBINE_ROW
|
||||||
|
PNG_ASM_FLAG_MMX_READ_INTERLACE
|
||||||
|
PNG_ASM_FLAG_MMX_READ_FILTER_SUB
|
||||||
|
PNG_ASM_FLAG_MMX_READ_FILTER_UP
|
||||||
|
PNG_ASM_FLAG_MMX_READ_FILTER_AVG
|
||||||
|
PNG_ASM_FLAG_MMX_READ_FILTER_PAETH
|
||||||
|
PNG_ASM_FLAGS_INITIALIZED
|
||||||
|
PNG_MMX_READ_FLAGS
|
||||||
|
PNG_MMX_FLAGS
|
||||||
|
PNG_MMX_WRITE_FLAGS
|
||||||
|
PNG_MMX_FLAGS
|
||||||
|
|
||||||
|
We added the following functions in support of runtime
|
||||||
|
selection of assembler code features:
|
||||||
|
|
||||||
|
png_get_mmx_flagmask()
|
||||||
|
png_set_mmx_thresholds()
|
||||||
|
png_get_asm_flags()
|
||||||
|
png_get_mmx_bitdepth_threshold()
|
||||||
|
png_get_mmx_rowbytes_threshold()
|
||||||
|
png_set_asm_flags()
|
||||||
|
|
||||||
|
We replaced all of these functions with simple stubs in libpng-1.2.20,
|
||||||
|
when the Intel assembler code was removed due to a licensing issue.
|
||||||
|
|
||||||
|
These macros are deprecated:
|
||||||
|
|
||||||
|
PNG_READ_TRANSFORMS_NOT_SUPPORTED
|
||||||
|
PNG_PROGRESSIVE_READ_NOT_SUPPORTED
|
||||||
|
PNG_NO_SEQUENTIAL_READ_SUPPORTED
|
||||||
|
PNG_WRITE_TRANSFORMS_NOT_SUPPORTED
|
||||||
|
PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED
|
||||||
|
PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED
|
||||||
|
|
||||||
|
They have been replaced, respectively, by:
|
||||||
|
|
||||||
|
PNG_NO_READ_TRANSFORMS
|
||||||
|
PNG_NO_PROGRESSIVE_READ
|
||||||
|
PNG_NO_SEQUENTIAL_READ
|
||||||
|
PNG_NO_WRITE_TRANSFORMS
|
||||||
|
PNG_NO_READ_ANCILLARY_CHUNKS
|
||||||
|
PNG_NO_WRITE_ANCILLARY_CHUNKS
|
||||||
|
|
||||||
|
PNG_MAX_UINT was replaced with PNG_UINT_31_MAX. It has been
|
||||||
|
deprecated since libpng-1.0.16 and libpng-1.2.6.
|
||||||
|
|
||||||
|
The deprecated function
|
||||||
|
png_check_sig(sig, num)
|
||||||
|
was replaced with
|
||||||
|
!png_sig_cmp(sig, 0, num)
|
||||||
|
It has been deprecated since libpng-0.90.
|
||||||
|
|
||||||
|
The deprecated function
|
||||||
|
png_set_gray_1_2_4_to_8()
|
||||||
|
which also expands tRNS to alpha was replaced with
|
||||||
|
png_set_expand_gray_1_2_4_to_8()
|
||||||
|
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
|
||||||
IX. (Omitted)
|
IX. (Omitted)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
X. Detecting libpng
|
X. Detecting libpng
|
||||||
|
|
||||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||||
@@ -2932,11 +3056,11 @@ control. The git repository was built from old libpng-x.y.z.tar.gz files
|
|||||||
going back to version 0.70. You can access the git repository (read only)
|
going back to version 0.70. You can access the git repository (read only)
|
||||||
at
|
at
|
||||||
|
|
||||||
git://git.code.sf.net/p/libpng/code
|
git://libpng.git.sourceforge.net/gitroot/libpng
|
||||||
|
|
||||||
or you can browse it with a web browser by selecting the "code" button at
|
or you can browse it via "gitweb" at
|
||||||
|
|
||||||
https://sourceforge.net/projects/libpng/
|
http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng
|
||||||
|
|
||||||
Patches can be sent to glennrp at users.sourceforge.net or to
|
Patches can be sent to glennrp at users.sourceforge.net or to
|
||||||
png-mng-implement at lists.sourceforge.net or you can upload them to
|
png-mng-implement at lists.sourceforge.net or you can upload them to
|
||||||
@@ -2946,8 +3070,7 @@ the libpng bug tracker at
|
|||||||
|
|
||||||
XII. Coding style
|
XII. Coding style
|
||||||
|
|
||||||
Our coding style is similar to the "Allman" style
|
Our coding style is similar to the "Allman" style, with curly
|
||||||
(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
|
|
||||||
braces on separate lines:
|
braces on separate lines:
|
||||||
|
|
||||||
if (condition)
|
if (condition)
|
||||||
@@ -3032,7 +3155,7 @@ above the comment that says
|
|||||||
|
|
||||||
The names of all exported functions and variables begin
|
The names of all exported functions and variables begin
|
||||||
with "png_", and all publicly visible C preprocessor
|
with "png_", and all publicly visible C preprocessor
|
||||||
macros begin with "PNG".
|
macros begin with "PNG_".
|
||||||
|
|
||||||
We put a space after each comma and after each semicolon
|
We put a space after each comma and after each semicolon
|
||||||
in "for" statments, and we put spaces before and after each
|
in "for" statments, and we put spaces before and after each
|
||||||
@@ -3049,17 +3172,18 @@ when there is only one macro being tested.
|
|||||||
|
|
||||||
We do not use the TAB character for indentation in the C sources.
|
We do not use the TAB character for indentation in the C sources.
|
||||||
|
|
||||||
Lines do not exceed 80 characters.
|
Other rules can be inferred by inspecting the libpng
|
||||||
|
source.
|
||||||
Other rules can be inferred by inspecting the libpng source.
|
|
||||||
|
|
||||||
XIII. Y2K Compliance in libpng
|
XIII. Y2K Compliance in libpng
|
||||||
|
|
||||||
|
November 10, 2009
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.0.65 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.41beta17 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||||
530
libpngpf.3
530
libpngpf.3
@@ -1,274 +1,798 @@
|
|||||||
.TH LIBPNGPF 3 "December 3, 2015"
|
.TH LIBPNGPF 3 "November 10, 2009"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.65
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta17
|
||||||
(private functions)
|
(private functions)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB#include <png.h>\fP
|
\fB#include <png.h>\fP
|
||||||
|
|
||||||
\fBvoid png_64bit_product (long \fP\fIv1\fP\fB, long \fP\fIv2\fP\fB, unsigned long \fP\fI*hi_product\fP\fB, unsigned long \fI*lo_product\fP\fB);\fP
|
\fI\fB
|
||||||
|
|
||||||
|
\fBvoid png_64bit_product (long \fP\fIv1\fP\fB, long \fP\fIv2\fP\fB, unsigned long \fI*hi_product,
|
||||||
|
|
||||||
|
\fBunsigned long \fI*lo_product\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP
|
\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_check_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_fixed_point \fP\fIint_white_x\fP\fB, png_fixed_point \fP\fIint_white_y\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_green_x\fP\fB, png_fixed_point \fP\fIint_green_y\fP\fB, png_fixed_point \fP\fIint_blue_x\fP\fB, png_fixed_point \fIint_blue_y\fP\fB);\fP
|
\fBint png_check_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_fixed_point \fP\fIint_white_x\fP\fB, png_fixed_point \fP\fIint_white_y\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_green_x\fP\fB, png_fixed_point \fP\fIint_green_y\fP\fB, png_fixed_point \fP\fIint_blue_x\fP\fB, png_fixed_point \fIint_blue_y\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP
|
\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP
|
\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP
|
\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP
|
\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP
|
\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP
|
\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP
|
\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP
|
\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP
|
\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP
|
\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP
|
\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP
|
\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP
|
\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP
|
\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP
|
\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP
|
\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_uint_32 png_read_chunk_header (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBpng_uint_32 png_read_chunk_header (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP
|
\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP
|
\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
|
\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP
|
\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
|
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP
|
\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP
|
\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP
|
\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP
|
\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP
|
\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP
|
\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP
|
\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP
|
\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP
|
\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP
|
\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP
|
\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP
|
\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
|
\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP
|
\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP
|
\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP
|
\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP
|
\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
|
\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP
|
\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP
|
\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The functions listed above are used privately by libpng
|
The functions listed above are used privately by libpng
|
||||||
and are not recommended for use by applications. They are
|
and are not recommended for use by applications. They are
|
||||||
|
|||||||
439
missing
439
missing
@@ -1,10 +1,11 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Common wrapper for a few potentially missing GNU programs.
|
# Common stub for a few missing GNU programs while installing.
|
||||||
|
|
||||||
scriptversion=2013-10-28.13; # UTC
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
# 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -25,40 +26,69 @@ scriptversion=2013-10-28.13; # UTC
|
|||||||
# the same distribution terms that you use for the rest of that program.
|
# the same distribution terms that you use for the rest of that program.
|
||||||
|
|
||||||
if test $# -eq 0; then
|
if test $# -eq 0; then
|
||||||
echo 1>&2 "Try '$0 --help' for more information"
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run=:
|
||||||
|
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||||
|
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||||
|
|
||||||
|
# In the cases where this matters, `missing' is being run in the
|
||||||
|
# srcdir already.
|
||||||
|
if test -f configure.ac; then
|
||||||
|
configure_ac=configure.ac
|
||||||
|
else
|
||||||
|
configure_ac=configure.in
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg="missing on your system"
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
--run)
|
||||||
--is-lightweight)
|
# Try to run requested program, and just exit if it succeeds.
|
||||||
# Used by our autoconf macros to check whether the available missing
|
run=
|
||||||
# script is modern enough.
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
--run)
|
|
||||||
# Back-compat with the calling convention used by older automake.
|
|
||||||
shift
|
shift
|
||||||
|
"$@" && exit 0
|
||||||
|
# Exit code 63 means version mismatch. This often happens
|
||||||
|
# when the user try to use an ancient version of a tool on
|
||||||
|
# a file that requires a minimum version. In this case we
|
||||||
|
# we should proceed has if the program had been absent, or
|
||||||
|
# if --run hadn't been passed.
|
||||||
|
if test $? = 63; then
|
||||||
|
run=:
|
||||||
|
msg="probably too old"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
-h|--h|--he|--hel|--help)
|
||||||
echo "\
|
echo "\
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||||
|
|
||||||
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
|
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||||
to PROGRAM being missing or too old.
|
error status if there is no known handling for PROGRAM.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help display this help and exit
|
-h, --help display this help and exit
|
||||||
-v, --version output version information and exit
|
-v, --version output version information and exit
|
||||||
|
--run try to run the given command, and emulate it if it fails
|
||||||
|
|
||||||
Supported PROGRAM values:
|
Supported PROGRAM values:
|
||||||
aclocal autoconf autoheader autom4te automake makeinfo
|
aclocal touch file \`aclocal.m4'
|
||||||
bison yacc flex lex help2man
|
autoconf touch file \`configure'
|
||||||
|
autoheader touch file \`config.h.in'
|
||||||
|
autom4te touch the output file, or create a stub one
|
||||||
|
automake touch all \`Makefile.in' files
|
||||||
|
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
flex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
help2man touch the output file
|
||||||
|
lex create \`lex.yy.c', if possible, from existing .c
|
||||||
|
makeinfo touch the output file
|
||||||
|
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||||
|
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||||
|
|
||||||
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
|
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||||
'g' are ignored when checking the name.
|
\`g' are ignored when checking the name.
|
||||||
|
|
||||||
Send bug reports to <bug-automake@gnu.org>."
|
Send bug reports to <bug-automake@gnu.org>."
|
||||||
exit $?
|
exit $?
|
||||||
@@ -70,141 +100,272 @@ Send bug reports to <bug-automake@gnu.org>."
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
echo 1>&2 "$0: unknown '$1' option"
|
echo 1>&2 "$0: Unknown \`$1' option"
|
||||||
echo 1>&2 "Try '$0 --help' for more information"
|
echo 1>&2 "Try \`$0 --help' for more information"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Run the given program, remember its exit status.
|
# normalize program name to check for.
|
||||||
"$@"; st=$?
|
program=`echo "$1" | sed '
|
||||||
|
|
||||||
# If it succeeded, we are done.
|
|
||||||
test $st -eq 0 && exit 0
|
|
||||||
|
|
||||||
# Also exit now if we it failed (or wasn't found), and '--version' was
|
|
||||||
# passed; such an option is passed most likely to detect whether the
|
|
||||||
# program is present and works.
|
|
||||||
case $2 in --version|--help) exit $st;; esac
|
|
||||||
|
|
||||||
# Exit code 63 means version mismatch. This often happens when the user
|
|
||||||
# tries to use an ancient version of a tool on a file that requires a
|
|
||||||
# minimum version.
|
|
||||||
if test $st -eq 63; then
|
|
||||||
msg="probably too old"
|
|
||||||
elif test $st -eq 127; then
|
|
||||||
# Program was missing.
|
|
||||||
msg="missing on your system"
|
|
||||||
else
|
|
||||||
# Program was found and executed, but failed. Give up.
|
|
||||||
exit $st
|
|
||||||
fi
|
|
||||||
|
|
||||||
perl_URL=http://www.perl.org/
|
|
||||||
flex_URL=http://flex.sourceforge.net/
|
|
||||||
gnu_software_URL=http://www.gnu.org/software
|
|
||||||
|
|
||||||
program_details ()
|
|
||||||
{
|
|
||||||
case $1 in
|
|
||||||
aclocal|automake)
|
|
||||||
echo "The '$1' program is part of the GNU Automake package:"
|
|
||||||
echo "<$gnu_software_URL/automake>"
|
|
||||||
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
|
|
||||||
echo "<$gnu_software_URL/autoconf>"
|
|
||||||
echo "<$gnu_software_URL/m4/>"
|
|
||||||
echo "<$perl_URL>"
|
|
||||||
;;
|
|
||||||
autoconf|autom4te|autoheader)
|
|
||||||
echo "The '$1' program is part of the GNU Autoconf package:"
|
|
||||||
echo "<$gnu_software_URL/autoconf/>"
|
|
||||||
echo "It also requires GNU m4 and Perl in order to run:"
|
|
||||||
echo "<$gnu_software_URL/m4/>"
|
|
||||||
echo "<$perl_URL>"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
give_advice ()
|
|
||||||
{
|
|
||||||
# Normalize program name to check for.
|
|
||||||
normalized_program=`echo "$1" | sed '
|
|
||||||
s/^gnu-//; t
|
s/^gnu-//; t
|
||||||
s/^gnu//; t
|
s/^gnu//; t
|
||||||
s/^g//; t'`
|
s/^g//; t'`
|
||||||
|
|
||||||
printf '%s\n' "'$1' is $msg."
|
# Now exit if we have it, but it failed. Also exit now if we
|
||||||
|
# don't have it and --version was passed (most likely to detect
|
||||||
|
# the program). This is about non-GNU programs, so use $1 not
|
||||||
|
# $program.
|
||||||
|
case $1 in
|
||||||
|
lex*|yacc*)
|
||||||
|
# Not GNU programs, they don't have --version.
|
||||||
|
;;
|
||||||
|
|
||||||
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
|
tar*)
|
||||||
case $normalized_program in
|
if test -n "$run"; then
|
||||||
autoconf*)
|
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||||
echo "You should only need it if you modified 'configure.ac',"
|
exit 1
|
||||||
echo "or m4 files included by it."
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
program_details 'autoconf'
|
exit 1
|
||||||
;;
|
fi
|
||||||
autoheader*)
|
|
||||||
echo "You should only need it if you modified 'acconfig.h' or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
program_details 'autoheader'
|
|
||||||
;;
|
|
||||||
automake*)
|
|
||||||
echo "You should only need it if you modified 'Makefile.am' or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
program_details 'automake'
|
|
||||||
;;
|
|
||||||
aclocal*)
|
|
||||||
echo "You should only need it if you modified 'acinclude.m4' or"
|
|
||||||
echo "$configure_deps."
|
|
||||||
program_details 'aclocal'
|
|
||||||
;;
|
|
||||||
autom4te*)
|
|
||||||
echo "You might have modified some maintainer files that require"
|
|
||||||
echo "the 'autom4te' program to be rebuilt."
|
|
||||||
program_details 'autom4te'
|
|
||||||
;;
|
|
||||||
bison*|yacc*)
|
|
||||||
echo "You should only need it if you modified a '.y' file."
|
|
||||||
echo "You may want to install the GNU Bison package:"
|
|
||||||
echo "<$gnu_software_URL/bison/>"
|
|
||||||
;;
|
|
||||||
lex*|flex*)
|
|
||||||
echo "You should only need it if you modified a '.l' file."
|
|
||||||
echo "You may want to install the Fast Lexical Analyzer package:"
|
|
||||||
echo "<$flex_URL>"
|
|
||||||
;;
|
|
||||||
help2man*)
|
|
||||||
echo "You should only need it if you modified a dependency" \
|
|
||||||
"of a man page."
|
|
||||||
echo "You may want to install the GNU Help2man package:"
|
|
||||||
echo "<$gnu_software_URL/help2man/>"
|
|
||||||
;;
|
|
||||||
makeinfo*)
|
|
||||||
echo "You should only need it if you modified a '.texi' file, or"
|
|
||||||
echo "any other file indirectly affecting the aspect of the manual."
|
|
||||||
echo "You might want to install the Texinfo package:"
|
|
||||||
echo "<$gnu_software_URL/texinfo/>"
|
|
||||||
echo "The spurious makeinfo call might also be the consequence of"
|
|
||||||
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
|
|
||||||
echo "want to install GNU make:"
|
|
||||||
echo "<$gnu_software_URL/make/>"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "You might have modified some files without having the proper"
|
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||||
echo "tools for further handling them. Check the 'README' file, it"
|
# We have it, but it failed.
|
||||||
echo "often tells you about the needed prerequisites for installing"
|
exit 1
|
||||||
echo "this package. You may also peek at any GNU archive site, in"
|
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||||
echo "case some other package contains this missing '$1' program."
|
# Could not run --version or --help. This is probably someone
|
||||||
|
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||||
|
# $TOOL exists and not knowing $TOOL uses missing.
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If it does not exist, or fails to run (possibly an outdated version),
|
||||||
|
# try to emulate it.
|
||||||
|
case $program in
|
||||||
|
aclocal*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||||
|
any GNU archive site."
|
||||||
|
touch aclocal.m4
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoconf*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`${configure_ac}'. You might want to install the
|
||||||
|
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||||
|
archive site."
|
||||||
|
touch configure
|
||||||
|
;;
|
||||||
|
|
||||||
|
autoheader*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||||
|
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||||
|
from any GNU archive site."
|
||||||
|
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||||
|
test -z "$files" && files="config.h"
|
||||||
|
touch_files=
|
||||||
|
for f in $files; do
|
||||||
|
case $f in
|
||||||
|
*:*) touch_files="$touch_files "`echo "$f" |
|
||||||
|
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||||
|
*) touch_files="$touch_files $f.in";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
touch $touch_files
|
||||||
|
;;
|
||||||
|
|
||||||
|
automake*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||||
|
You might want to install the \`Automake' and \`Perl' packages.
|
||||||
|
Grab them from any GNU archive site."
|
||||||
|
find . -type f -name Makefile.am -print |
|
||||||
|
sed 's/\.am$/.in/' |
|
||||||
|
while read f; do touch "$f"; done
|
||||||
|
;;
|
||||||
|
|
||||||
|
autom4te*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, but is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them.
|
||||||
|
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||||
|
archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo "#! /bin/sh"
|
||||||
|
echo "# Created by GNU Automake missing as a replacement of"
|
||||||
|
echo "# $ $@"
|
||||||
|
echo "exit 0"
|
||||||
|
chmod +x $file
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bison*|yacc*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' $msg. You should only need it if
|
||||||
|
you modified a \`.y' file. You may need the \`Bison' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Bison' from any GNU archive site."
|
||||||
|
rm -f y.tab.c y.tab.h
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.y)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.c
|
||||||
|
fi
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" y.tab.h
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
fi
|
||||||
|
if test ! -f y.tab.h; then
|
||||||
|
echo >y.tab.h
|
||||||
|
fi
|
||||||
|
if test ! -f y.tab.c; then
|
||||||
|
echo 'main() { return 0; }' >y.tab.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
lex*|flex*)
|
||||||
-e '2,$s/^/ /' >&2
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.l' file. You may need the \`Flex' package
|
||||||
|
in order for those modifications to take effect. You can get
|
||||||
|
\`Flex' from any GNU archive site."
|
||||||
|
rm -f lex.yy.c
|
||||||
|
if test $# -ne 1; then
|
||||||
|
eval LASTARG="\${$#}"
|
||||||
|
case $LASTARG in
|
||||||
|
*.l)
|
||||||
|
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||||
|
if test -f "$SRCFILE"; then
|
||||||
|
cp "$SRCFILE" lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
if test ! -f lex.yy.c; then
|
||||||
|
echo 'main() { return 0; }' >lex.yy.c
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
# Propagate the correct exit status (expected to be 127 for a program
|
help2man*)
|
||||||
# not found, 63 for a program that failed due to version mismatch).
|
echo 1>&2 "\
|
||||||
exit $st
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a dependency of a manual page. You may need the
|
||||||
|
\`Help2man' package in order for those modifications to take
|
||||||
|
effect. You can get \`Help2man' from any GNU archive site."
|
||||||
|
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -f "$file"; then
|
||||||
|
touch $file
|
||||||
|
else
|
||||||
|
test -z "$file" || exec >$file
|
||||||
|
echo ".ab help2man is required to generate this page"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
makeinfo*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is $msg. You should only need it if
|
||||||
|
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||||
|
indirectly affecting the aspect of the manual. The spurious
|
||||||
|
call might also be the consequence of using a buggy \`make' (AIX,
|
||||||
|
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||||
|
the \`GNU make' package. Grab either from any GNU archive site."
|
||||||
|
# The file to touch is that specified with -o ...
|
||||||
|
file=`echo "$*" | sed -n "$sed_output"`
|
||||||
|
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||||
|
if test -z "$file"; then
|
||||||
|
# ... or it is the one specified with @setfilename ...
|
||||||
|
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||||
|
file=`sed -n '
|
||||||
|
/^@setfilename/{
|
||||||
|
s/.* \([^ ]*\) *$/\1/
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}' $infile`
|
||||||
|
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||||
|
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||||
|
fi
|
||||||
|
# If the file does not exist, the user really needs makeinfo;
|
||||||
|
# let's fail without touching anything.
|
||||||
|
test -f $file || exit 1
|
||||||
|
touch $file
|
||||||
|
;;
|
||||||
|
|
||||||
|
tar*)
|
||||||
|
shift
|
||||||
|
|
||||||
|
# We have already tried tar in the generic part.
|
||||||
|
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||||
|
# messages.
|
||||||
|
if (gnutar --version > /dev/null 2>&1); then
|
||||||
|
gnutar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
if (gtar --version > /dev/null 2>&1); then
|
||||||
|
gtar "$@" && exit 0
|
||||||
|
fi
|
||||||
|
firstarg="$1"
|
||||||
|
if shift; then
|
||||||
|
case $firstarg in
|
||||||
|
*o*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/o//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case $firstarg in
|
||||||
|
*h*)
|
||||||
|
firstarg=`echo "$firstarg" | sed s/h//`
|
||||||
|
tar "$firstarg" "$@" && exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||||
|
You may want to install GNU tar or Free paxutils, or check the
|
||||||
|
command line arguments."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo 1>&2 "\
|
||||||
|
WARNING: \`$1' is needed, and is $msg.
|
||||||
|
You might have modified some files without having the
|
||||||
|
proper tools for further handling them. Check the \`README' file,
|
||||||
|
it often tells you about the needed prerequisites for installing
|
||||||
|
this package. You may also peek at any GNU archive site, in case
|
||||||
|
some other package would contain this missing \`$1' program."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ case $dirmode in
|
|||||||
echo "mkdir -p -- $*"
|
echo "mkdir -p -- $*"
|
||||||
exec mkdir -p -- "$@"
|
exec mkdir -p -- "$@"
|
||||||
else
|
else
|
||||||
# On NextStep and OpenStep, the 'mkdir' command does not
|
# On NextStep and OpenStep, the `mkdir' command does not
|
||||||
# recognize any option. It will interpret all options as
|
# recognize any option. It will interpret all options as
|
||||||
# directories to create, and then abort because '.' already
|
# directories to create, and then abort because `.' already
|
||||||
# exists.
|
# exists.
|
||||||
test -d ./-p && rmdir ./-p
|
test -d ./-p && rmdir ./-p
|
||||||
test -d ./--version && rmdir ./--version
|
test -d ./--version && rmdir ./--version
|
||||||
|
|||||||
6
png.5
6
png.5
@@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "December 3, 2015"
|
.TH PNG 5 "November 10, 2009"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@@ -27,7 +27,7 @@ PNG specification (second edition), November 2003:
|
|||||||
PNG 1.2 specification, July 1999:
|
PNG 1.2 specification, July 1999:
|
||||||
.IP
|
.IP
|
||||||
.br
|
.br
|
||||||
http://png-mng.sourceforge.net/pub/png/spec/1.2/
|
http://www.libpng.org/pub/png
|
||||||
.LP
|
.LP
|
||||||
PNG 1.0 specification, October 1996:
|
PNG 1.0 specification, October 1996:
|
||||||
.IP
|
.IP
|
||||||
@@ -39,7 +39,7 @@ ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt
|
|||||||
.br
|
.br
|
||||||
or (as a W3C Recommendation) at
|
or (as a W3C Recommendation) at
|
||||||
.br
|
.br
|
||||||
http://www.w3.org/TR/REC-png-961001
|
http://www.w3.org/TR/REC-png.html
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
This man page: Glenn Randers-Pehrson
|
This man page: Glenn Randers-Pehrson
|
||||||
.LP
|
.LP
|
||||||
|
|||||||
63
png.c
63
png.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.54 [November 12, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -13,11 +13,10 @@
|
|||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_EXTERN
|
#define PNG_NO_EXTERN
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_0_65 Your_png_h_is_not_version_1_0_65;
|
typedef version_1_2_41beta17 Your_png_h_is_not_version_1_2_41beta17;
|
||||||
|
|
||||||
/* Version information for C files. This had better match the version
|
/* Version information for C files. This had better match the version
|
||||||
* string defined in png.h.
|
* string defined in png.h.
|
||||||
@@ -78,8 +77,7 @@ PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Mask to determine which pixels are valid in a pass */
|
/* Mask to determine which pixels are valid in a pass */
|
||||||
PNG_CONST int FARDATA png_pass_mask[] =
|
PNG_CONST int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
||||||
{0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
|
||||||
|
|
||||||
/* Mask to determine which pixels to overwrite while displaying */
|
/* Mask to determine which pixels to overwrite while displaying */
|
||||||
PNG_CONST int FARDATA png_pass_dsp_mask[]
|
PNG_CONST int FARDATA png_pass_dsp_mask[]
|
||||||
@@ -158,16 +156,12 @@ voidpf /* PRIVATE */
|
|||||||
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||||
{
|
{
|
||||||
png_voidp ptr;
|
png_voidp ptr;
|
||||||
png_structp p;
|
png_structp p=(png_structp)png_ptr;
|
||||||
png_uint_32 save_flags;
|
png_uint_32 save_flags=p->flags;
|
||||||
png_uint_32 num_bytes;
|
png_uint_32 num_bytes;
|
||||||
|
|
||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
p=(png_structp)png_ptr;
|
|
||||||
save_flags=p->flags;
|
|
||||||
|
|
||||||
if (items > PNG_UINT_32_MAX/size)
|
if (items > PNG_UINT_32_MAX/size)
|
||||||
{
|
{
|
||||||
png_warning (p, "Potential overflow in png_zalloc()");
|
png_warning (p, "Potential overflow in png_zalloc()");
|
||||||
@@ -332,8 +326,6 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
|
|||||||
png_destroy_struct(info_ptr);
|
png_destroy_struct(info_ptr);
|
||||||
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
|
info_ptr = (png_infop)png_create_struct(PNG_STRUCT_INFO);
|
||||||
*ptr_ptr = info_ptr;
|
*ptr_ptr = info_ptr;
|
||||||
if (info_ptr == NULL)
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set everything to 0 */
|
/* Set everything to 0 */
|
||||||
@@ -450,7 +442,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
|||||||
for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
|
for (i = 0; i < (int)info_ptr->pcal_nparams; i++)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, info_ptr->pcal_params[i]);
|
png_free(png_ptr, info_ptr->pcal_params[i]);
|
||||||
info_ptr->pcal_params[i] = NULL;
|
info_ptr->pcal_params[i]=NULL;
|
||||||
}
|
}
|
||||||
png_free(png_ptr, info_ptr->pcal_params);
|
png_free(png_ptr, info_ptr->pcal_params);
|
||||||
info_ptr->pcal_params = NULL;
|
info_ptr->pcal_params = NULL;
|
||||||
@@ -595,10 +587,10 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
|||||||
for (row = 0; row < (int)info_ptr->height; row++)
|
for (row = 0; row < (int)info_ptr->height; row++)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, info_ptr->row_pointers[row]);
|
png_free(png_ptr, info_ptr->row_pointers[row]);
|
||||||
info_ptr->row_pointers[row] = NULL;
|
info_ptr->row_pointers[row]=NULL;
|
||||||
}
|
}
|
||||||
png_free(png_ptr, info_ptr->row_pointers);
|
png_free(png_ptr, info_ptr->row_pointers);
|
||||||
info_ptr->row_pointers = NULL;
|
info_ptr->row_pointers=NULL;
|
||||||
}
|
}
|
||||||
info_ptr->valid &= ~PNG_INFO_IDAT;
|
info_ptr->valid &= ~PNG_INFO_IDAT;
|
||||||
}
|
}
|
||||||
@@ -627,7 +619,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
|
|||||||
if (png_ptr->num_chunk_list)
|
if (png_ptr->num_chunk_list)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->chunk_list);
|
png_free(png_ptr, png_ptr->chunk_list);
|
||||||
png_ptr->chunk_list = NULL;
|
png_ptr->chunk_list=NULL;
|
||||||
png_ptr->num_chunk_list = 0;
|
png_ptr->num_chunk_list = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -681,7 +673,6 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
|||||||
|
|
||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if (png_ptr->time_buffer == NULL)
|
if (png_ptr->time_buffer == NULL)
|
||||||
{
|
{
|
||||||
png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29*
|
png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29*
|
||||||
@@ -692,18 +683,18 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
|||||||
{
|
{
|
||||||
wchar_t time_buf[29];
|
wchar_t time_buf[29];
|
||||||
wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
|
wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
|
||||||
ptime->day % 32, short_months[(ptime->month - 1U) % 12],
|
ptime->day % 32, short_months[(ptime->month - 1) % 12],
|
||||||
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
||||||
ptime->second % 61);
|
ptime->second % 61);
|
||||||
WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer,
|
WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29,
|
||||||
29, NULL, NULL);
|
NULL, NULL);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
{
|
{
|
||||||
char near_time_buf[29];
|
char near_time_buf[29];
|
||||||
png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000",
|
png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000",
|
||||||
ptime->day % 32, short_months[(ptime->month - 1U) % 12],
|
ptime->day % 32, short_months[(ptime->month - 1) % 12],
|
||||||
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
||||||
ptime->second % 61);
|
ptime->second % 61);
|
||||||
png_memcpy(png_ptr->time_buffer, near_time_buf,
|
png_memcpy(png_ptr->time_buffer, near_time_buf,
|
||||||
@@ -711,7 +702,7 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000",
|
png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000",
|
||||||
ptime->day % 32, short_months[(ptime->month - 1U) % 12],
|
ptime->day % 32, short_months[(ptime->month - 1) % 12],
|
||||||
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
||||||
ptime->second % 61);
|
ptime->second % 61);
|
||||||
#endif
|
#endif
|
||||||
@@ -725,20 +716,20 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
|||||||
png_charp PNGAPI
|
png_charp PNGAPI
|
||||||
png_get_copyright(png_structp png_ptr)
|
png_get_copyright(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||||
#ifdef PNG_STRING_COPYRIGHT
|
#ifdef PNG_STRING_COPYRIGHT
|
||||||
return PNG_STRING_COPYRIGHT
|
return PNG_STRING_COPYRIGHT
|
||||||
#else
|
#else
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
return ((png_charp) PNG_STRING_NEWLINE \
|
return ((png_charp) PNG_STRING_NEWLINE \
|
||||||
"libpng version 1.0.65 - December 3, 2015" PNG_STRING_NEWLINE \
|
"libpng version 1.2.41beta17 - November 10, 2009" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
"Copyright (c) 1998-2009 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE);
|
PNG_STRING_NEWLINE);
|
||||||
#else
|
#else
|
||||||
return ((png_charp) "libpng version 1.0.65 - December 3, 2015\
|
return ((png_charp) "libpng version 1.2.41beta17 - November 10, 2009\
|
||||||
Copyright (c) 1998-2015 Glenn Randers-Pehrson\
|
Copyright (c) 1998-2009 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
|
||||||
#endif
|
#endif
|
||||||
@@ -757,7 +748,7 @@ png_charp PNGAPI
|
|||||||
png_get_libpng_ver(png_structp png_ptr)
|
png_get_libpng_ver(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Version of *.c files used when building libpng */
|
/* Version of *.c files used when building libpng */
|
||||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||||
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -765,7 +756,7 @@ png_charp PNGAPI
|
|||||||
png_get_header_ver(png_structp png_ptr)
|
png_get_header_ver(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Version of *.h files used when building libpng */
|
/* Version of *.h files used when building libpng */
|
||||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||||
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,7 +764,7 @@ png_charp PNGAPI
|
|||||||
png_get_header_version(png_structp png_ptr)
|
png_get_header_version(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Returns longer string containing both version and date */
|
/* Returns longer string containing both version and date */
|
||||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
return ((png_charp) PNG_HEADER_VERSION_STRING
|
return ((png_charp) PNG_HEADER_VERSION_STRING
|
||||||
#ifndef PNG_READ_SUPPORTED
|
#ifndef PNG_READ_SUPPORTED
|
||||||
@@ -1016,6 +1007,14 @@ png_check_IHDR(png_structp png_ptr,
|
|||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( width > (PNG_UINT_32_MAX
|
||||||
|
>> 3) /* 8-byte RGBA pixels */
|
||||||
|
- 64 /* bigrowbuf hack */
|
||||||
|
- 1 /* filter byte */
|
||||||
|
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||||
|
- 8) /* extra max_pixel_depth pad */
|
||||||
|
png_warning(png_ptr, "Width is too large for libpng to process pixels");
|
||||||
|
|
||||||
/* Check other values */
|
/* Check other values */
|
||||||
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
||||||
bit_depth != 8 && bit_depth != 16)
|
bit_depth != 8 && bit_depth != 16)
|
||||||
|
|||||||
85
pngconf.h
85
pngconf.h
@@ -1,17 +1,17 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.0.65, December 3, 2015
|
* libpng version 1.2.41beta17 - November 10, 2009
|
||||||
*
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
* and license in png.h
|
* and license in png.h
|
||||||
*
|
*/
|
||||||
* Any machine specific code is near the front of this file, so if you
|
|
||||||
|
/* Any machine specific code is near the front of this file, so if you
|
||||||
* are configuring libpng for a machine, you may want to read the section
|
* are configuring libpng for a machine, you may want to read the section
|
||||||
* starting here down to where it starts to typedef png_color, png_text,
|
* starting here down to where it starts to typedef png_color, png_text,
|
||||||
* and png_info.
|
* and png_info.
|
||||||
@@ -20,12 +20,18 @@
|
|||||||
#ifndef PNGCONF_H
|
#ifndef PNGCONF_H
|
||||||
#define PNGCONF_H
|
#define PNGCONF_H
|
||||||
|
|
||||||
#define PNG_1_0_X
|
#define PNG_1_2_X
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PNG_USER_CONFIG has to be defined on the compiler command line. This
|
* PNG_USER_CONFIG has to be defined on the compiler command line. This
|
||||||
* includes the resource compiler for Windows DLL configurations.
|
* includes the resource compiler for Windows DLL configurations.
|
||||||
*/
|
*/
|
||||||
|
#ifdef PNG_USER_CONFIG
|
||||||
|
# ifndef PNG_USER_PRIVATEBUILD
|
||||||
|
# define PNG_USER_PRIVATEBUILD
|
||||||
|
# endif
|
||||||
|
#include "pngusr.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
|
/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
|
||||||
#ifdef PNG_CONFIGURE_LIBPNG
|
#ifdef PNG_CONFIGURE_LIBPNG
|
||||||
@@ -34,14 +40,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_1_0_X
|
|
||||||
# ifndef PNG_iTXt_SUPPORTED
|
|
||||||
# ifndef PNG_NO_iTXt
|
|
||||||
# define PNG_NO_iTXt
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Added at libpng-1.2.8
|
* Added at libpng-1.2.8
|
||||||
*
|
*
|
||||||
@@ -88,18 +86,6 @@
|
|||||||
#endif
|
#endif
|
||||||
/* End of material added at libpng-1.2.19/1.2.21 */
|
/* End of material added at libpng-1.2.19/1.2.21 */
|
||||||
|
|
||||||
/* Added at libpng-1.2.51 (ported from 1.4.6) */
|
|
||||||
#ifndef PNG_UNUSED
|
|
||||||
/* Unused formal parameter warnings are silenced using the following macro
|
|
||||||
* which is expected to have no bad effects on performance (optimizing
|
|
||||||
* compilers will probably remove it entirely). Note that if you replace
|
|
||||||
* it with something other than whitespace, you must include the terminating
|
|
||||||
* semicolon.
|
|
||||||
*/
|
|
||||||
# define PNG_UNUSED(param) (void)param;
|
|
||||||
#endif
|
|
||||||
/* End of material added to libpng-1.4.6 */
|
|
||||||
|
|
||||||
/* This is the size of the compression buffer, and thus the size of
|
/* This is the size of the compression buffer, and thus the size of
|
||||||
* an IDAT chunk. Make this whatever size you feel is best for your
|
* an IDAT chunk. Make this whatever size you feel is best for your
|
||||||
* machine. One of these will be allocated per png_struct. When this
|
* machine. One of these will be allocated per png_struct. When this
|
||||||
@@ -636,18 +622,22 @@
|
|||||||
# ifndef PNG_NO_READ_BACKGROUND
|
# ifndef PNG_NO_READ_BACKGROUND
|
||||||
# define PNG_READ_BACKGROUND_SUPPORTED
|
# define PNG_READ_BACKGROUND_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
|
#ifndef PNG_1_0_X
|
||||||
# ifndef PNG_NO_READ_16_TO_8
|
# ifndef PNG_NO_READ_16_TO_8
|
||||||
# define PNG_READ_16_TO_8_SUPPORTED
|
# define PNG_READ_16_TO_8_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
# ifndef PNG_NO_READ_FILLER
|
# ifndef PNG_NO_READ_FILLER
|
||||||
# define PNG_READ_FILLER_SUPPORTED
|
# define PNG_READ_FILLER_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
# ifndef PNG_NO_READ_GAMMA
|
# ifndef PNG_NO_READ_GAMMA
|
||||||
# define PNG_READ_GAMMA_SUPPORTED
|
# define PNG_READ_GAMMA_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
|
#ifndef PNG_1_0_X
|
||||||
# ifndef PNG_NO_READ_GRAY_TO_RGB
|
# ifndef PNG_NO_READ_GRAY_TO_RGB
|
||||||
# define PNG_READ_GRAY_TO_RGB_SUPPORTED
|
# define PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
# ifndef PNG_NO_READ_SWAP_ALPHA
|
# ifndef PNG_NO_READ_SWAP_ALPHA
|
||||||
# define PNG_READ_SWAP_ALPHA_SUPPORTED
|
# define PNG_READ_SWAP_ALPHA_SUPPORTED
|
||||||
# endif
|
# endif
|
||||||
@@ -766,6 +756,7 @@
|
|||||||
|
|
||||||
#endif /* PNG_WRITE_SUPPORTED */
|
#endif /* PNG_WRITE_SUPPORTED */
|
||||||
|
|
||||||
|
#define PNG_NO_ERROR_NUMBERS
|
||||||
#ifndef PNG_1_0_X
|
#ifndef PNG_1_0_X
|
||||||
# ifndef PNG_NO_ERROR_NUMBERS
|
# ifndef PNG_NO_ERROR_NUMBERS
|
||||||
# define PNG_ERROR_NUMBERS_SUPPORTED
|
# define PNG_ERROR_NUMBERS_SUPPORTED
|
||||||
@@ -861,13 +852,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* PNG_1_0_X */
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
/* Added at libpng-1.0.53 and 1.2.43 */
|
|
||||||
#ifndef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
# ifndef PNG_NO_USER_LIMITS
|
|
||||||
# define PNG_USER_LIMITS_SUPPORTED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
|
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
|
||||||
* how large, set these limits to 0x7fffffffL
|
* how large, set these limits to 0x7fffffffL
|
||||||
*/
|
*/
|
||||||
@@ -878,16 +862,11 @@
|
|||||||
# define PNG_USER_HEIGHT_MAX 1000000L
|
# define PNG_USER_HEIGHT_MAX 1000000L
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Added at libpng-1.2.43. To accept all valid PNGs no matter
|
#ifndef PNG_1_0_X
|
||||||
* how large, set these two limits to 0.
|
/* Added at libpng-1.2.41 */
|
||||||
*/
|
|
||||||
#ifndef PNG_USER_CHUNK_CACHE_MAX
|
#ifndef PNG_USER_CHUNK_CACHE_MAX
|
||||||
# define PNG_USER_CHUNK_CACHE_MAX 32765
|
# define PNG_USER_CHUNK_CACHE_MAX 0x7fffffffL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Added at libpng-1.2.43 */
|
|
||||||
#ifndef PNG_USER_CHUNK_MALLOC_MAX
|
|
||||||
# define PNG_USER_CHUNK_MALLOC_MAX 8000000
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PNG_LITERAL_SHARP
|
#ifndef PNG_LITERAL_SHARP
|
||||||
@@ -1543,19 +1522,12 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_PEDANTIC_WARNINGS
|
|
||||||
# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED
|
|
||||||
# define PNG_PEDANTIC_WARNINGS_SUPPORTED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED
|
|
||||||
/* Support for compiler specific function attributes. These are used
|
/* Support for compiler specific function attributes. These are used
|
||||||
* so that where compiler support is available incorrect use of API
|
* so that where compiler support is available incorrect use of API
|
||||||
* functions in png.h will generate compiler warnings. Added at libpng
|
* functions in png.h will generate compiler warnings. Added at libpng
|
||||||
* version 1.2.41.
|
* version 1.2.41.
|
||||||
*/
|
*/
|
||||||
# ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# ifndef PNG_USE_RESULT
|
# ifndef PNG_USE_RESULT
|
||||||
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
|
||||||
# endif
|
# endif
|
||||||
@@ -1566,6 +1538,7 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# define PNG_ALLOCATED __attribute__((__malloc__))
|
# define PNG_ALLOCATED __attribute__((__malloc__))
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifndef PNG_CONFIGURE_LIBPNG
|
||||||
/* This specifically protects structure members that should only be
|
/* This specifically protects structure members that should only be
|
||||||
* accessed from within the library, therefore should be empty during
|
* accessed from within the library, therefore should be empty during
|
||||||
* a library build.
|
* a library build.
|
||||||
@@ -1576,17 +1549,8 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
# ifndef PNG_DEPSTRUCT
|
# ifndef PNG_DEPSTRUCT
|
||||||
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
|
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
|
||||||
# endif
|
# 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
|
||||||
# endif /* PNG_PRIVATE */
|
#endif
|
||||||
# endif /* __GNUC__ */
|
|
||||||
#endif /* PNG_PEDANTIC_WARNINGS */
|
|
||||||
|
|
||||||
#ifndef PNG_DEPRECATED
|
#ifndef PNG_DEPRECATED
|
||||||
# define PNG_DEPRECATED /* Use of this function is deprecated */
|
# define PNG_DEPRECATED /* Use of this function is deprecated */
|
||||||
@@ -1603,9 +1567,6 @@ typedef z_stream FAR * png_zstreamp;
|
|||||||
#ifndef PNG_DEPSTRUCT
|
#ifndef PNG_DEPSTRUCT
|
||||||
# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */
|
# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */
|
||||||
#endif
|
#endif
|
||||||
#ifndef PNG_PRIVATE
|
|
||||||
# define PNG_PRIVATE /* This is a private libpng function */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* User may want to use these so they are not in PNG_INTERNAL. Any library
|
/* User may want to use these so they are not in PNG_INTERNAL. Any library
|
||||||
* functions that are passed far data must be model independent.
|
* functions that are passed far data must be model independent.
|
||||||
|
|||||||
43
pngerror.c
43
pngerror.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* pngerror.c - stub functions for i/o and memory allocation
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.51 [February 6, 2014]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||||
|
|
||||||
@@ -87,17 +86,12 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_err(png_structp png_ptr)
|
png_err(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Prior to 1.2.45 the error_fn received a NULL pointer, expressed
|
|
||||||
* erroneously as '\0', instead of the empty string "". This was
|
|
||||||
* apparently an error, introduced in libpng-1.2.20, and png_default_error
|
|
||||||
* will crash in this case.
|
|
||||||
*/
|
|
||||||
if (png_ptr != NULL && png_ptr->error_fn != NULL)
|
if (png_ptr != NULL && png_ptr->error_fn != NULL)
|
||||||
(*(png_ptr->error_fn))(png_ptr, "");
|
(*(png_ptr->error_fn))(png_ptr, '\0');
|
||||||
|
|
||||||
/* If the custom handler doesn't exist, or if it returns,
|
/* If the custom handler doesn't exist, or if it returns,
|
||||||
use the default handler, which will not return. */
|
use the default handler, which will not return. */
|
||||||
png_default_error(png_ptr, "");
|
png_default_error(png_ptr, '\0');
|
||||||
}
|
}
|
||||||
#endif /* PNG_ERROR_TEXT_SUPPORTED */
|
#endif /* PNG_ERROR_TEXT_SUPPORTED */
|
||||||
|
|
||||||
@@ -186,13 +180,8 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
|||||||
{
|
{
|
||||||
buffer[iout++] = ':';
|
buffer[iout++] = ':';
|
||||||
buffer[iout++] = ' ';
|
buffer[iout++] = ' ';
|
||||||
|
png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT);
|
||||||
iin = 0;
|
buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
|
||||||
while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0')
|
|
||||||
buffer[iout++] = error_message[iin++];
|
|
||||||
|
|
||||||
/* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */
|
|
||||||
buffer[iout] = '\0';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,20 +255,20 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
error_number[offset - 1] = '\0';
|
error_number[offset - 1] = '\0';
|
||||||
fprintf(stderr, "libpng error no. %s: %s",
|
fprintf(stderr, "libpng error no. %s: %s",
|
||||||
error_number, error_message + offset + 1);
|
error_number, error_message + offset + 1);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "libpng error: %s, offset=%d",
|
fprintf(stderr, "libpng error: %s, offset=%d",
|
||||||
error_message, offset);
|
error_message, offset);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
fprintf(stderr, "libpng error: %s", error_message);
|
fprintf(stderr, "libpng error: %s", error_message);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -290,7 +279,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
{
|
{
|
||||||
jmp_buf jmpbuf;
|
jmp_buf jmpbuf;
|
||||||
png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
||||||
longjmp(jmpbuf,1);
|
longjmp(jmpbuf, 1);
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
longjmp(png_ptr->jmpbuf, 1);
|
longjmp(png_ptr->jmpbuf, 1);
|
||||||
@@ -300,7 +289,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
/* Here if not setjmp support or if png_ptr is null. */
|
/* Here if not setjmp support or if png_ptr is null. */
|
||||||
PNG_ABORT();
|
PNG_ABORT();
|
||||||
#ifndef PNG_CONSOLE_IO_SUPPORTED
|
#ifndef PNG_CONSOLE_IO_SUPPORTED
|
||||||
PNG_UNUSED(error_message) /* Make compiler happy */
|
error_message = error_message; /* Make compiler happy */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,25 +319,25 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
|||||||
warning_number[offset + 1] = '\0';
|
warning_number[offset + 1] = '\0';
|
||||||
fprintf(stderr, "libpng warning no. %s: %s",
|
fprintf(stderr, "libpng warning no. %s: %s",
|
||||||
warning_number, warning_message + offset);
|
warning_number, warning_message + offset);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "libpng warning: %s",
|
fprintf(stderr, "libpng warning: %s",
|
||||||
warning_message);
|
warning_message);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
fprintf(stderr, "libpng warning: %s", warning_message);
|
fprintf(stderr, "libpng warning: %s", warning_message);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
PNG_UNUSED(warning_message) /* Make compiler happy */
|
warning_message = warning_message; /* Make compiler happy */
|
||||||
#endif
|
#endif
|
||||||
PNG_UNUSED(png_ptr) /* Make compiler happy */
|
png_ptr = png_ptr; /* Make compiler happy */
|
||||||
}
|
}
|
||||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||||
|
|
||||||
|
|||||||
109
pnggccrd.c
109
pnggccrd.c
@@ -1,16 +1,6 @@
|
|||||||
/* pnggccrd.c
|
/* pnggccrd.c was removed from libpng-1.2.20. */
|
||||||
*
|
|
||||||
* Last changed in libpng 1.2.48 [March 8, 2012]
|
/* This code snippet is for use by configure's compilation test. */
|
||||||
* Copyright (c) 1998-2012 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
|
|
||||||
*
|
|
||||||
* This code snippet is for use by configure's compilation test. Most of the
|
|
||||||
* remainder of the file was removed from libpng-1.2.20, and all of the
|
|
||||||
* assembler code was removed from libpng-1.2.48.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (!defined _MSC_VER) && \
|
#if (!defined _MSC_VER) && \
|
||||||
defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
||||||
@@ -18,9 +8,96 @@
|
|||||||
|
|
||||||
int PNGAPI png_dummy_mmx_support(void);
|
int PNGAPI png_dummy_mmx_support(void);
|
||||||
|
|
||||||
int PNGAPI png_dummy_mmx_support(void)
|
static int _mmx_supported = 2; // 0: no MMX; 1: MMX supported; 2: not tested
|
||||||
|
|
||||||
|
int PNGAPI
|
||||||
|
png_dummy_mmx_support(void) __attribute__((noinline));
|
||||||
|
|
||||||
|
int PNGAPI
|
||||||
|
png_dummy_mmx_support(void)
|
||||||
{
|
{
|
||||||
/* 0: no MMX; 1: MMX supported; 2: not tested */
|
int result;
|
||||||
return 2;
|
#ifdef PNG_MMX_CODE_SUPPORTED // superfluous, but what the heck
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
#ifdef __x86_64__
|
||||||
|
"pushq %%rbx \n\t" // rbx gets clobbered by CPUID instruction
|
||||||
|
"pushq %%rcx \n\t" // so does rcx...
|
||||||
|
"pushq %%rdx \n\t" // ...and rdx (but rcx & rdx safe on Linux)
|
||||||
|
"pushfq \n\t" // save Eflag to stack
|
||||||
|
"popq %%rax \n\t" // get Eflag from stack into rax
|
||||||
|
"movq %%rax, %%rcx \n\t" // make another copy of Eflag in rcx
|
||||||
|
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||||
|
"pushq %%rax \n\t" // save modified Eflag back to stack
|
||||||
|
"popfq \n\t" // restore modified value to Eflag reg
|
||||||
|
"pushfq \n\t" // save Eflag to stack
|
||||||
|
"popq %%rax \n\t" // get Eflag from stack
|
||||||
|
"pushq %%rcx \n\t" // save original Eflag to stack
|
||||||
|
"popfq \n\t" // restore original Eflag
|
||||||
|
#else
|
||||||
|
"pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction
|
||||||
|
"pushl %%ecx \n\t" // so does ecx...
|
||||||
|
"pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux)
|
||||||
|
"pushfl \n\t" // save Eflag to stack
|
||||||
|
"popl %%eax \n\t" // get Eflag from stack into eax
|
||||||
|
"movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
|
||||||
|
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||||
|
"pushl %%eax \n\t" // save modified Eflag back to stack
|
||||||
|
"popfl \n\t" // restore modified value to Eflag reg
|
||||||
|
"pushfl \n\t" // save Eflag to stack
|
||||||
|
"popl %%eax \n\t" // get Eflag from stack
|
||||||
|
"pushl %%ecx \n\t" // save original Eflag to stack
|
||||||
|
"popfl \n\t" // restore original Eflag
|
||||||
|
#endif
|
||||||
|
"xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag
|
||||||
|
"jz 0f \n\t" // if same, CPUID instr. is not supported
|
||||||
|
|
||||||
|
"xorl %%eax, %%eax \n\t" // set eax to zero
|
||||||
|
// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode)
|
||||||
|
"cpuid \n\t" // get the CPU identification info
|
||||||
|
"cmpl $1, %%eax \n\t" // make sure eax return non-zero value
|
||||||
|
"jl 0f \n\t" // if eax is zero, MMX is not supported
|
||||||
|
|
||||||
|
"xorl %%eax, %%eax \n\t" // set eax to zero and...
|
||||||
|
"incl %%eax \n\t" // ...increment eax to 1. This pair is
|
||||||
|
// faster than the instruction "mov eax, 1"
|
||||||
|
"cpuid \n\t" // get the CPU identification info again
|
||||||
|
"andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23)
|
||||||
|
"cmpl $0, %%edx \n\t" // 0 = MMX not supported
|
||||||
|
"jz 0f \n\t" // non-zero = yes, MMX IS supported
|
||||||
|
|
||||||
|
"movl $1, %%eax \n\t" // set return value to 1
|
||||||
|
"jmp 1f \n\t" // DONE: have MMX support
|
||||||
|
|
||||||
|
"0: \n\t" // .NOT_SUPPORTED: target label for jump instructions
|
||||||
|
"movl $0, %%eax \n\t" // set return value to 0
|
||||||
|
"1: \n\t" // .RETURN: target label for jump instructions
|
||||||
|
#ifdef __x86_64__
|
||||||
|
"popq %%rdx \n\t" // restore rdx
|
||||||
|
"popq %%rcx \n\t" // restore rcx
|
||||||
|
"popq %%rbx \n\t" // restore rbx
|
||||||
|
#else
|
||||||
|
"popl %%edx \n\t" // restore edx
|
||||||
|
"popl %%ecx \n\t" // restore ecx
|
||||||
|
"popl %%ebx \n\t" // restore ebx
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// "ret \n\t" // DONE: no MMX support
|
||||||
|
// (fall through to standard C "ret")
|
||||||
|
|
||||||
|
: "=a" (result) // output list
|
||||||
|
|
||||||
|
: // any variables used on input (none)
|
||||||
|
|
||||||
|
// no clobber list
|
||||||
|
// , "%ebx", "%ecx", "%edx" // GRR: we handle these manually
|
||||||
|
// , "memory" // if write to a variable gcc thought was in a reg
|
||||||
|
// , "cc" // "condition codes" (flag bits)
|
||||||
|
);
|
||||||
|
_mmx_supported = result;
|
||||||
|
#else
|
||||||
|
_mmx_supported = 0;
|
||||||
|
#endif /* PNG_MMX_CODE_SUPPORTED */
|
||||||
|
|
||||||
|
return _mmx_supported;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
23
pngget.c
23
pngget.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.53 [February 26, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||||
|
|
||||||
@@ -872,11 +871,13 @@ png_get_user_chunk_ptr(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_compression_buffer_size(png_structp png_ptr)
|
png_get_compression_buffer_size(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
|
return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
#ifndef PNG_1_0_X
|
#ifndef PNG_1_0_X
|
||||||
@@ -885,8 +886,7 @@ png_uint_32 PNGAPI
|
|||||||
png_get_asm_flags (png_structp png_ptr)
|
png_get_asm_flags (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||||
PNG_UNUSED(png_ptr)
|
return (png_ptr? 0L: 0L);
|
||||||
return 0L;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function was added to libpng 1.2.0 and should exist by default */
|
/* This function was added to libpng 1.2.0 and should exist by default */
|
||||||
@@ -894,7 +894,7 @@ png_uint_32 PNGAPI
|
|||||||
png_get_asm_flagmask (int flag_select)
|
png_get_asm_flagmask (int flag_select)
|
||||||
{
|
{
|
||||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||||
PNG_UNUSED(flag_select)
|
flag_select=flag_select;
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -904,7 +904,7 @@ png_uint_32 PNGAPI
|
|||||||
png_get_mmx_flagmask (int flag_select, int *compilerID)
|
png_get_mmx_flagmask (int flag_select, int *compilerID)
|
||||||
{
|
{
|
||||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||||
PNG_UNUSED(flag_select)
|
flag_select=flag_select;
|
||||||
*compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */
|
*compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
@@ -914,8 +914,7 @@ png_byte PNGAPI
|
|||||||
png_get_mmx_bitdepth_threshold (png_structp png_ptr)
|
png_get_mmx_bitdepth_threshold (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||||
PNG_UNUSED(png_ptr)
|
return (png_ptr? 0: 0);
|
||||||
return 0L;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function was added to libpng 1.2.0 */
|
/* This function was added to libpng 1.2.0 */
|
||||||
@@ -923,15 +922,13 @@ png_uint_32 PNGAPI
|
|||||||
png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||||
PNG_UNUSED(png_ptr)
|
return (png_ptr? 0L: 0L);
|
||||||
return 0L;
|
|
||||||
}
|
}
|
||||||
#endif /* ?PNG_1_0_X */
|
#endif /* ?PNG_1_0_X */
|
||||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
/* These functions were added to libpng 1.2.6 but not enabled
|
/* These functions were added to libpng 1.2.6 */
|
||||||
* by default. They will be enabled in libpng-1.4.0 */
|
|
||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_user_width_max (png_structp png_ptr)
|
png_get_user_width_max (png_structp png_ptr)
|
||||||
{
|
{
|
||||||
|
|||||||
13
pngmem.c
13
pngmem.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.41 [February 25, 2010]
|
* Last changed in libpng 1.2.37 [June 4, 2009]
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||||
|
|
||||||
@@ -115,7 +114,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
|||||||
* result, we would be truncating potentially larger memory requests
|
* result, we would be truncating potentially larger memory requests
|
||||||
* (which should cause a fatal error) and introducing major problems.
|
* (which should cause a fatal error) and introducing major problems.
|
||||||
*/
|
*/
|
||||||
png_voidp /* PRIVATE */
|
png_voidp PNGAPI
|
||||||
png_calloc(png_structp png_ptr, png_uint_32 size)
|
png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||||
{
|
{
|
||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
@@ -201,7 +200,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
|||||||
{
|
{
|
||||||
#ifndef PNG_USER_MEM_SUPPORTED
|
#ifndef PNG_USER_MEM_SUPPORTED
|
||||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||||
png_error(png_ptr, "Out Of Memory."); /* Note "O", "M" */
|
png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
|
||||||
else
|
else
|
||||||
png_warning(png_ptr, "Out Of Memory.");
|
png_warning(png_ptr, "Out Of Memory.");
|
||||||
#endif
|
#endif
|
||||||
@@ -229,7 +228,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
|||||||
{
|
{
|
||||||
#ifndef PNG_USER_MEM_SUPPORTED
|
#ifndef PNG_USER_MEM_SUPPORTED
|
||||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||||
png_error(png_ptr, "Out Of memory."); /* Note "O", "m" */
|
png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */
|
||||||
else
|
else
|
||||||
png_warning(png_ptr, "Out Of memory.");
|
png_warning(png_ptr, "Out Of memory.");
|
||||||
#endif
|
#endif
|
||||||
@@ -442,7 +441,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
|||||||
* have the ability to do that.
|
* have the ability to do that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
png_voidp /* PRIVATE */
|
png_voidp PNGAPI
|
||||||
png_calloc(png_structp png_ptr, png_uint_32 size)
|
png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||||
{
|
{
|
||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
|
|||||||
691
pngpread.c
691
pngpread.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.44 [June 26, 2010]
|
* Last changed in libpng 1.2.38 [July 16, 2009]
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||||
|
|
||||||
@@ -71,6 +70,30 @@ png_process_some_data(png_structp png_ptr, png_infop info_ptr)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||||
|
case PNG_READ_tEXt_MODE:
|
||||||
|
{
|
||||||
|
png_push_read_tEXt(png_ptr, info_ptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||||
|
case PNG_READ_zTXt_MODE:
|
||||||
|
{
|
||||||
|
png_push_read_zTXt(png_ptr, info_ptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||||
|
case PNG_READ_iTXt_MODE:
|
||||||
|
{
|
||||||
|
png_push_read_iTXt(png_ptr, info_ptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
case PNG_SKIP_MODE:
|
case PNG_SKIP_MODE:
|
||||||
{
|
{
|
||||||
png_push_crc_finish(png_ptr);
|
png_push_crc_finish(png_ptr);
|
||||||
@@ -307,9 +330,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_ptr->mode |= PNG_HAVE_IDAT;
|
png_ptr->mode |= PNG_HAVE_IDAT;
|
||||||
png_ptr->process_mode = PNG_READ_IDAT_MODE;
|
png_ptr->process_mode = PNG_READ_IDAT_MODE;
|
||||||
png_push_have_info(png_ptr, info_ptr);
|
png_push_have_info(png_ptr, info_ptr);
|
||||||
png_ptr->zstream.avail_out =
|
png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
|
||||||
(uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
|
|
||||||
png_ptr->iwidth) + 1;
|
|
||||||
png_ptr->zstream.next_out = png_ptr->row_buf;
|
png_ptr->zstream.next_out = png_ptr->row_buf;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -505,7 +526,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -518,7 +539,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -531,7 +552,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -542,7 +563,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
|||||||
png_push_save_buffer(png_ptr);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
|
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
|
||||||
@@ -678,20 +699,12 @@ png_push_save_buffer(png_structp png_ptr)
|
|||||||
|
|
||||||
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
||||||
old_buffer = png_ptr->save_buffer;
|
old_buffer = png_ptr->save_buffer;
|
||||||
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
|
png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)new_max);
|
(png_uint_32)new_max);
|
||||||
if (png_ptr->save_buffer == NULL)
|
|
||||||
{
|
|
||||||
png_free(png_ptr, old_buffer);
|
|
||||||
png_error(png_ptr, "Insufficient memory for save_buffer");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
|
png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
|
||||||
png_free(png_ptr, old_buffer);
|
png_free(png_ptr, old_buffer);
|
||||||
png_ptr->save_buffer_max = new_max;
|
png_ptr->save_buffer_max = new_max;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (png_ptr->current_buffer_size)
|
if (png_ptr->current_buffer_size)
|
||||||
{
|
{
|
||||||
png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size,
|
png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size,
|
||||||
@@ -762,6 +775,7 @@ png_push_read_IDAT(png_structp png_ptr)
|
|||||||
|
|
||||||
png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
|
png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size);
|
||||||
|
|
||||||
|
if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
||||||
png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size);
|
png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size);
|
||||||
|
|
||||||
png_ptr->idat_size -= save_size;
|
png_ptr->idat_size -= save_size;
|
||||||
@@ -785,7 +799,7 @@ png_push_read_IDAT(png_structp png_ptr)
|
|||||||
save_size = png_ptr->current_buffer_size;
|
save_size = png_ptr->current_buffer_size;
|
||||||
|
|
||||||
png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
|
png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);
|
||||||
|
if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
||||||
png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size);
|
png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size);
|
||||||
|
|
||||||
png_ptr->idat_size -= save_size;
|
png_ptr->idat_size -= save_size;
|
||||||
@@ -811,101 +825,60 @@ void /* PRIVATE */
|
|||||||
png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
||||||
png_size_t buffer_length)
|
png_size_t buffer_length)
|
||||||
{
|
{
|
||||||
/* The caller checks for a non-zero buffer length. */
|
|
||||||
if (!(buffer_length > 0) || buffer == NULL)
|
|
||||||
png_error(png_ptr, "No IDAT data (internal error)");
|
|
||||||
|
|
||||||
/* This routine must process all the data it has been given
|
|
||||||
* before returning, calling the row callback as required to
|
|
||||||
* handle the uncompressed results.
|
|
||||||
*/
|
|
||||||
png_ptr->zstream.next_in = buffer;
|
|
||||||
png_ptr->zstream.avail_in = (uInt)buffer_length;
|
|
||||||
|
|
||||||
/* Keep going until the decompressed data is all processed
|
|
||||||
* or the stream marked as finished.
|
|
||||||
*/
|
|
||||||
while (png_ptr->zstream.avail_in > 0 &&
|
|
||||||
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
|
||||||
{
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* We have data for zlib, but we must check that zlib
|
if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length)
|
||||||
* has somewhere to put the results. It doesn't matter
|
png_error(png_ptr, "Extra compression data");
|
||||||
* if we don't expect any results -- it may be the input
|
|
||||||
* data is just the LZ end code.
|
png_ptr->zstream.next_in = buffer;
|
||||||
*/
|
png_ptr->zstream.avail_in = (uInt)buffer_length;
|
||||||
if (!(png_ptr->zstream.avail_out > 0))
|
for (;;)
|
||||||
{
|
{
|
||||||
png_ptr->zstream.avail_out =
|
ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
|
||||||
(uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
|
if (ret != Z_OK)
|
||||||
png_ptr->iwidth) + 1;
|
|
||||||
png_ptr->zstream.next_out = png_ptr->row_buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Using Z_SYNC_FLUSH here means that an unterminated
|
|
||||||
* LZ stream can still be handled (a stream with a missing
|
|
||||||
* end code), otherwise (Z_NO_FLUSH) a future zlib
|
|
||||||
* implementation might defer output and, therefore,
|
|
||||||
* change the current behavior. (See comments in inflate.c
|
|
||||||
* for why this doesn't happen at present with zlib 1.2.5.)
|
|
||||||
*/
|
|
||||||
ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH);
|
|
||||||
|
|
||||||
/* Check for any failure before proceeding. */
|
|
||||||
if (ret != Z_OK && ret != Z_STREAM_END)
|
|
||||||
{
|
{
|
||||||
/* Terminate the decompression. */
|
if (ret == Z_STREAM_END)
|
||||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
|
||||||
|
|
||||||
/* This may be a truncated stream (missing or
|
|
||||||
* damaged end code). Treat that as a warning.
|
|
||||||
*/
|
|
||||||
if (png_ptr->row_number >= png_ptr->num_rows ||
|
|
||||||
png_ptr->pass > 6)
|
|
||||||
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
|
||||||
else
|
|
||||||
png_error(png_ptr, "Decompression error in IDAT");
|
|
||||||
|
|
||||||
/* Skip the check on unprocessed input */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Did inflate output any data? */
|
|
||||||
if (png_ptr->zstream.next_out != png_ptr->row_buf)
|
|
||||||
{
|
{
|
||||||
/* Is this unexpected data after the last row?
|
if (png_ptr->zstream.avail_in)
|
||||||
* If it is, artificially terminate the LZ output
|
png_error(png_ptr, "Extra compressed data");
|
||||||
* here.
|
|
||||||
*/
|
|
||||||
if (png_ptr->row_number >= png_ptr->num_rows ||
|
|
||||||
png_ptr->pass > 6)
|
|
||||||
{
|
|
||||||
/* Extra data. */
|
|
||||||
png_warning(png_ptr, "Extra compressed data in IDAT");
|
|
||||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
|
||||||
/* Do no more processing; skip the unprocessed
|
|
||||||
* input check below.
|
|
||||||
*/
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Do we have a complete row? */
|
if (!(png_ptr->zstream.avail_out))
|
||||||
if (png_ptr->zstream.avail_out == 0)
|
{
|
||||||
png_push_process_row(png_ptr);
|
png_push_process_row(png_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And check for the end of the stream. */
|
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||||
if (ret == Z_STREAM_END)
|
|
||||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (ret == Z_BUF_ERROR)
|
||||||
|
break;
|
||||||
|
|
||||||
|
else
|
||||||
|
png_error(png_ptr, "Decompression Error");
|
||||||
|
}
|
||||||
|
if (!(png_ptr->zstream.avail_out))
|
||||||
|
{
|
||||||
|
if ((
|
||||||
|
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||||
|
png_ptr->interlaced && png_ptr->pass > 6) ||
|
||||||
|
(!png_ptr->interlaced &&
|
||||||
|
#endif
|
||||||
|
png_ptr->row_number == png_ptr->num_rows))
|
||||||
|
{
|
||||||
|
if (png_ptr->zstream.avail_in)
|
||||||
|
png_warning(png_ptr, "Too much data in IDAT chunks");
|
||||||
|
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
png_push_process_row(png_ptr);
|
||||||
|
png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
|
||||||
|
png_ptr->zstream.next_out = png_ptr->row_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All the data should have been processed, if anything
|
else
|
||||||
* is left at this point we have bytes of IDAT data
|
break;
|
||||||
* after the zlib end code.
|
}
|
||||||
*/
|
|
||||||
if (png_ptr->zstream.avail_in > 0)
|
|
||||||
png_warning(png_ptr, "Extra compression data");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
@@ -1167,6 +1140,9 @@ png_read_push_finish_row(png_structp png_ptr)
|
|||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
|
|
||||||
|
png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
|
||||||
|
png_ptr->iwidth) + 1;
|
||||||
|
|
||||||
if (png_ptr->transformations & PNG_INTERLACE)
|
if (png_ptr->transformations & PNG_INTERLACE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1180,6 +1156,515 @@ png_read_push_finish_row(png_structp png_ptr)
|
|||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||||
|
length)
|
||||||
|
{
|
||||||
|
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||||
|
{
|
||||||
|
png_error(png_ptr, "Out of place tEXt");
|
||||||
|
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
png_ptr->skip_length = 0; /* This may not be necessary */
|
||||||
|
|
||||||
|
if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "tEXt chunk too large to fit in memory");
|
||||||
|
png_ptr->skip_length = length - (png_uint_32)65535L;
|
||||||
|
length = (png_uint_32)65535L;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(length + 1));
|
||||||
|
png_ptr->current_text[length] = '\0';
|
||||||
|
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||||
|
png_ptr->current_text_size = (png_size_t)length;
|
||||||
|
png_ptr->current_text_left = (png_size_t)length;
|
||||||
|
png_ptr->process_mode = PNG_READ_tEXt_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
||||||
|
{
|
||||||
|
if (png_ptr->buffer_size && png_ptr->current_text_left)
|
||||||
|
{
|
||||||
|
png_size_t text_size;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < png_ptr->current_text_left)
|
||||||
|
text_size = png_ptr->buffer_size;
|
||||||
|
|
||||||
|
else
|
||||||
|
text_size = png_ptr->current_text_left;
|
||||||
|
|
||||||
|
png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
|
||||||
|
png_ptr->current_text_left -= text_size;
|
||||||
|
png_ptr->current_text_ptr += text_size;
|
||||||
|
}
|
||||||
|
if (!(png_ptr->current_text_left))
|
||||||
|
{
|
||||||
|
png_textp text_ptr;
|
||||||
|
png_charp text;
|
||||||
|
png_charp key;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < 4)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_push_crc_finish(png_ptr);
|
||||||
|
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
if (png_ptr->skip_length)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
key = png_ptr->current_text;
|
||||||
|
|
||||||
|
for (text = key; *text; text++)
|
||||||
|
/* Empty loop */ ;
|
||||||
|
|
||||||
|
if (text < key + png_ptr->current_text_size)
|
||||||
|
text++;
|
||||||
|
|
||||||
|
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)png_sizeof(png_text));
|
||||||
|
text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
|
text_ptr->key = key;
|
||||||
|
#ifdef PNG_iTXt_SUPPORTED
|
||||||
|
text_ptr->lang = NULL;
|
||||||
|
text_ptr->lang_key = NULL;
|
||||||
|
#endif
|
||||||
|
text_ptr->text = text;
|
||||||
|
|
||||||
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
png_free(png_ptr, text_ptr);
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||||
|
length)
|
||||||
|
{
|
||||||
|
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||||
|
{
|
||||||
|
png_error(png_ptr, "Out of place zTXt");
|
||||||
|
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
/* We can't handle zTXt chunks > 64K, since we don't have enough space
|
||||||
|
* to be able to store the uncompressed data. Actually, the threshold
|
||||||
|
* is probably around 32K, but it isn't as definite as 64K is.
|
||||||
|
*/
|
||||||
|
if (length > (png_uint_32)65535L)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "zTXt chunk too large to fit in memory");
|
||||||
|
png_push_crc_skip(png_ptr, length);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(length + 1));
|
||||||
|
png_ptr->current_text[length] = '\0';
|
||||||
|
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||||
|
png_ptr->current_text_size = (png_size_t)length;
|
||||||
|
png_ptr->current_text_left = (png_size_t)length;
|
||||||
|
png_ptr->process_mode = PNG_READ_zTXt_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||||
|
{
|
||||||
|
if (png_ptr->buffer_size && png_ptr->current_text_left)
|
||||||
|
{
|
||||||
|
png_size_t text_size;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left)
|
||||||
|
text_size = png_ptr->buffer_size;
|
||||||
|
|
||||||
|
else
|
||||||
|
text_size = png_ptr->current_text_left;
|
||||||
|
|
||||||
|
png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
|
||||||
|
png_ptr->current_text_left -= text_size;
|
||||||
|
png_ptr->current_text_ptr += text_size;
|
||||||
|
}
|
||||||
|
if (!(png_ptr->current_text_left))
|
||||||
|
{
|
||||||
|
png_textp text_ptr;
|
||||||
|
png_charp text;
|
||||||
|
png_charp key;
|
||||||
|
int ret;
|
||||||
|
png_size_t text_size, key_size;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < 4)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_push_crc_finish(png_ptr);
|
||||||
|
|
||||||
|
key = png_ptr->current_text;
|
||||||
|
|
||||||
|
for (text = key; *text; text++)
|
||||||
|
/* Empty loop */ ;
|
||||||
|
|
||||||
|
/* zTXt can't have zero text */
|
||||||
|
if (text >= key + png_ptr->current_text_size)
|
||||||
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
text++;
|
||||||
|
|
||||||
|
if (*text != PNG_TEXT_COMPRESSION_zTXt) /* Check compression byte */
|
||||||
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
text++;
|
||||||
|
|
||||||
|
png_ptr->zstream.next_in = (png_bytep )text;
|
||||||
|
png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size -
|
||||||
|
(text - key));
|
||||||
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
|
|
||||||
|
key_size = text - key;
|
||||||
|
text_size = 0;
|
||||||
|
text = NULL;
|
||||||
|
ret = Z_STREAM_END;
|
||||||
|
|
||||||
|
while (png_ptr->zstream.avail_in)
|
||||||
|
{
|
||||||
|
ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
|
||||||
|
if (ret != Z_OK && ret != Z_STREAM_END)
|
||||||
|
{
|
||||||
|
inflateReset(&png_ptr->zstream);
|
||||||
|
png_ptr->zstream.avail_in = 0;
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
png_free(png_ptr, text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END)
|
||||||
|
{
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
text = (png_charp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_ptr->zbuf_size
|
||||||
|
- png_ptr->zstream.avail_out + key_size + 1));
|
||||||
|
|
||||||
|
png_memcpy(text + key_size, png_ptr->zbuf,
|
||||||
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out);
|
||||||
|
|
||||||
|
png_memcpy(text, key, key_size);
|
||||||
|
|
||||||
|
text_size = key_size + png_ptr->zbuf_size -
|
||||||
|
png_ptr->zstream.avail_out;
|
||||||
|
|
||||||
|
*(text + text_size) = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
png_charp tmp;
|
||||||
|
|
||||||
|
tmp = text;
|
||||||
|
text = (png_charp)png_malloc(png_ptr, text_size +
|
||||||
|
(png_uint_32)(png_ptr->zbuf_size
|
||||||
|
- png_ptr->zstream.avail_out + 1));
|
||||||
|
|
||||||
|
png_memcpy(text, tmp, text_size);
|
||||||
|
png_free(png_ptr, tmp);
|
||||||
|
|
||||||
|
png_memcpy(text + text_size, png_ptr->zbuf,
|
||||||
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out);
|
||||||
|
|
||||||
|
text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
||||||
|
*(text + text_size) = '\0';
|
||||||
|
}
|
||||||
|
if (ret != Z_STREAM_END)
|
||||||
|
{
|
||||||
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == Z_STREAM_END)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
inflateReset(&png_ptr->zstream);
|
||||||
|
png_ptr->zstream.avail_in = 0;
|
||||||
|
|
||||||
|
if (ret != Z_STREAM_END)
|
||||||
|
{
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
png_free(png_ptr, text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
key = text;
|
||||||
|
text += key_size;
|
||||||
|
|
||||||
|
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)png_sizeof(png_text));
|
||||||
|
text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt;
|
||||||
|
text_ptr->key = key;
|
||||||
|
#ifdef PNG_iTXt_SUPPORTED
|
||||||
|
text_ptr->lang = NULL;
|
||||||
|
text_ptr->lang_key = NULL;
|
||||||
|
#endif
|
||||||
|
text_ptr->text = text;
|
||||||
|
|
||||||
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
|
png_free(png_ptr, key);
|
||||||
|
png_free(png_ptr, text_ptr);
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||||
|
length)
|
||||||
|
{
|
||||||
|
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||||
|
{
|
||||||
|
png_error(png_ptr, "Out of place iTXt");
|
||||||
|
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
png_ptr->skip_length = 0; /* This may not be necessary */
|
||||||
|
|
||||||
|
if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "iTXt chunk too large to fit in memory");
|
||||||
|
png_ptr->skip_length = length - (png_uint_32)65535L;
|
||||||
|
length = (png_uint_32)65535L;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(length + 1));
|
||||||
|
png_ptr->current_text[length] = '\0';
|
||||||
|
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||||
|
png_ptr->current_text_size = (png_size_t)length;
|
||||||
|
png_ptr->current_text_left = (png_size_t)length;
|
||||||
|
png_ptr->process_mode = PNG_READ_iTXt_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size && png_ptr->current_text_left)
|
||||||
|
{
|
||||||
|
png_size_t text_size;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < png_ptr->current_text_left)
|
||||||
|
text_size = png_ptr->buffer_size;
|
||||||
|
|
||||||
|
else
|
||||||
|
text_size = png_ptr->current_text_left;
|
||||||
|
|
||||||
|
png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size);
|
||||||
|
png_ptr->current_text_left -= text_size;
|
||||||
|
png_ptr->current_text_ptr += text_size;
|
||||||
|
}
|
||||||
|
if (!(png_ptr->current_text_left))
|
||||||
|
{
|
||||||
|
png_textp text_ptr;
|
||||||
|
png_charp key;
|
||||||
|
int comp_flag;
|
||||||
|
png_charp lang;
|
||||||
|
png_charp lang_key;
|
||||||
|
png_charp text;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (png_ptr->buffer_size < 4)
|
||||||
|
{
|
||||||
|
png_push_save_buffer(png_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_push_crc_finish(png_ptr);
|
||||||
|
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
if (png_ptr->skip_length)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
key = png_ptr->current_text;
|
||||||
|
|
||||||
|
for (lang = key; *lang; lang++)
|
||||||
|
/* Empty loop */ ;
|
||||||
|
|
||||||
|
if (lang < key + png_ptr->current_text_size - 3)
|
||||||
|
lang++;
|
||||||
|
|
||||||
|
comp_flag = *lang++;
|
||||||
|
lang++; /* Skip comp_type, always zero */
|
||||||
|
|
||||||
|
for (lang_key = lang; *lang_key; lang_key++)
|
||||||
|
/* Empty loop */ ;
|
||||||
|
|
||||||
|
lang_key++; /* Skip NUL separator */
|
||||||
|
|
||||||
|
text=lang_key;
|
||||||
|
|
||||||
|
if (lang_key < key + png_ptr->current_text_size - 1)
|
||||||
|
{
|
||||||
|
for (; *text; text++)
|
||||||
|
/* Empty loop */ ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text < key + png_ptr->current_text_size)
|
||||||
|
text++;
|
||||||
|
|
||||||
|
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)png_sizeof(png_text));
|
||||||
|
|
||||||
|
text_ptr->compression = comp_flag + 2;
|
||||||
|
text_ptr->key = key;
|
||||||
|
text_ptr->lang = lang;
|
||||||
|
text_ptr->lang_key = lang_key;
|
||||||
|
text_ptr->text = text;
|
||||||
|
text_ptr->text_length = 0;
|
||||||
|
text_ptr->itxt_length = png_strlen(text);
|
||||||
|
|
||||||
|
ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1);
|
||||||
|
|
||||||
|
png_ptr->current_text = NULL;
|
||||||
|
|
||||||
|
png_free(png_ptr, text_ptr);
|
||||||
|
if (ret)
|
||||||
|
png_warning(png_ptr, "Insufficient memory to store iTXt chunk.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This function is called when we haven't found a handler for this
|
||||||
|
* chunk. If there isn't a problem with the chunk itself (ie a bad chunk
|
||||||
|
* name or a critical chunk), the chunk is (currently) silently ignored.
|
||||||
|
*/
|
||||||
|
void /* PRIVATE */
|
||||||
|
png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||||
|
length)
|
||||||
|
{
|
||||||
|
png_uint_32 skip = 0;
|
||||||
|
|
||||||
|
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||||
|
{
|
||||||
|
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
|
if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
|
||||||
|
PNG_HANDLE_CHUNK_ALWAYS
|
||||||
|
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||||
|
&& png_ptr->read_user_chunk_fn == NULL
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
#endif
|
||||||
|
png_chunk_error(png_ptr, "unknown critical chunk");
|
||||||
|
|
||||||
|
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
|
if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS)
|
||||||
|
{
|
||||||
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
|
if (length > (png_uint_32)65535L)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "unknown chunk too large to fit in memory");
|
||||||
|
skip = length - (png_uint_32)65535L;
|
||||||
|
length = (png_uint_32)65535L;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
||||||
|
(png_charp)png_ptr->chunk_name,
|
||||||
|
png_sizeof(png_ptr->unknown_chunk.name));
|
||||||
|
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1]
|
||||||
|
= '\0';
|
||||||
|
|
||||||
|
png_ptr->unknown_chunk.size = (png_size_t)length;
|
||||||
|
|
||||||
|
if (length == 0)
|
||||||
|
png_ptr->unknown_chunk.data = NULL;
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)length);
|
||||||
|
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||||
|
if (png_ptr->read_user_chunk_fn != NULL)
|
||||||
|
{
|
||||||
|
/* Callback to user unknown chunk handler */
|
||||||
|
int ret;
|
||||||
|
ret = (*(png_ptr->read_user_chunk_fn))
|
||||||
|
(png_ptr, &png_ptr->unknown_chunk);
|
||||||
|
|
||||||
|
if (ret < 0)
|
||||||
|
png_chunk_error(png_ptr, "error in user chunk");
|
||||||
|
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||||
|
if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name) !=
|
||||||
|
PNG_HANDLE_CHUNK_ALWAYS)
|
||||||
|
png_chunk_error(png_ptr, "unknown critical chunk");
|
||||||
|
png_set_unknown_chunks(png_ptr, info_ptr,
|
||||||
|
&png_ptr->unknown_chunk, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1);
|
||||||
|
png_free(png_ptr, png_ptr->unknown_chunk.data);
|
||||||
|
png_ptr->unknown_chunk.data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
skip=length;
|
||||||
|
png_push_crc_skip(png_ptr, skip);
|
||||||
|
}
|
||||||
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_push_have_info(png_structp png_ptr, png_infop info_ptr)
|
png_push_have_info(png_structp png_ptr, png_infop info_ptr)
|
||||||
{
|
{
|
||||||
|
|||||||
77
pngread.c
77
pngread.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.53 [February 26, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
|
|
||||||
|
|
||||||
/* Create a PNG structure for reading, and allocate any memory needed. */
|
/* Create a PNG structure for reading, and allocate any memory needed. */
|
||||||
png_structp PNGAPI
|
png_structp PNGAPI
|
||||||
png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||||
@@ -30,9 +30,7 @@ png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Alternate create PNG structure for reading, and allocate any memory
|
/* Alternate create PNG structure for reading, and allocate any memory needed. */
|
||||||
* needed.
|
|
||||||
*/
|
|
||||||
png_structp PNGAPI
|
png_structp PNGAPI
|
||||||
png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||||
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
|
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
|
||||||
@@ -65,11 +63,9 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
/* Added at libpng-1.2.6 */
|
/* Added at libpng-1.2.6 */
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
|
png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
|
||||||
png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
|
png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
|
||||||
/* Added at libpng-1.2.43 and 1.4.0 */
|
|
||||||
png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
@@ -100,20 +96,14 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
|
|
||||||
png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
|
png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
|
||||||
|
|
||||||
if (user_png_ver != NULL)
|
if (user_png_ver)
|
||||||
{
|
{
|
||||||
int found_dots = 0;
|
i = 0;
|
||||||
i = -1;
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
i++;
|
if (user_png_ver[i] != png_libpng_ver[i])
|
||||||
if (user_png_ver[i] != PNG_LIBPNG_VER_STRING[i])
|
|
||||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||||
if (user_png_ver[i] == '.')
|
} while (png_libpng_ver[i++]);
|
||||||
found_dots++;
|
|
||||||
} while (found_dots < 2 && user_png_ver[i] != 0 &&
|
|
||||||
PNG_LIBPNG_VER_STRING[i] != 0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||||
@@ -240,8 +230,7 @@ png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
|||||||
png_ptr->flags = 0;
|
png_ptr->flags = 0;
|
||||||
#endif
|
#endif
|
||||||
png_error(png_ptr,
|
png_error(png_ptr,
|
||||||
"The png struct allocated by the application for reading is"
|
"The png struct allocated by the application for reading is too small.");
|
||||||
" too small.");
|
|
||||||
}
|
}
|
||||||
if (png_sizeof(png_info) > png_info_size)
|
if (png_sizeof(png_info) > png_info_size)
|
||||||
{
|
{
|
||||||
@@ -250,8 +239,7 @@ png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
|||||||
png_ptr->flags = 0;
|
png_ptr->flags = 0;
|
||||||
#endif
|
#endif
|
||||||
png_error(png_ptr,
|
png_error(png_ptr,
|
||||||
"The info struct allocated by application for reading is"
|
"The info struct allocated by application for reading is too small.");
|
||||||
" too small.");
|
|
||||||
}
|
}
|
||||||
png_read_init_3(&png_ptr, user_png_ver, png_struct_size);
|
png_read_init_3(&png_ptr, user_png_ver, png_struct_size);
|
||||||
}
|
}
|
||||||
@@ -274,15 +262,14 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (user_png_ver == NULL || user_png_ver[i] != png_libpng_ver[i])
|
if (user_png_ver[i] != png_libpng_ver[i])
|
||||||
{
|
{
|
||||||
#ifdef PNG_LEGACY_SUPPORTED
|
#ifdef PNG_LEGACY_SUPPORTED
|
||||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||||
#else
|
#else
|
||||||
png_ptr->warning_fn = NULL;
|
png_ptr->warning_fn = NULL;
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Application uses deprecated png_read_init() and should be"
|
"Application uses deprecated png_read_init() and should be recompiled.");
|
||||||
" recompiled.");
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -329,8 +316,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
{
|
{
|
||||||
case Z_OK: /* Do nothing */ break;
|
case Z_OK: /* Do nothing */ break;
|
||||||
case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break;
|
case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break;
|
||||||
case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error");
|
case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break;
|
||||||
break;
|
|
||||||
default: png_error(png_ptr, "Unknown zlib error");
|
default: png_error(png_ptr, "Unknown zlib error");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,7 +557,6 @@ png_read_update_info(png_structp png_ptr, png_infop info_ptr)
|
|||||||
else
|
else
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Ignoring extra png_read_update_info() call; row buffer not reallocated");
|
"Ignoring extra png_read_update_info() call; row buffer not reallocated");
|
||||||
|
|
||||||
png_read_transform_info(png_ptr, info_ptr);
|
png_read_transform_info(png_ptr, info_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,12 +582,10 @@ png_start_read_image(png_structp png_ptr)
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||||
{
|
{
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
PNG_CONST PNG_IDAT;
|
PNG_CONST PNG_IDAT;
|
||||||
PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55,
|
PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55,
|
||||||
0xff};
|
0xff};
|
||||||
PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
||||||
#endif
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
@@ -624,8 +607,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
if (png_ptr->transformations & PNG_FILLER)
|
if (png_ptr->transformations & PNG_FILLER)
|
||||||
png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined.");
|
png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined.");
|
||||||
#endif
|
#endif
|
||||||
#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \
|
#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||||
!defined(PNG_READ_PACKSWAP_SUPPORTED)
|
|
||||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||||
png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined.");
|
png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined.");
|
||||||
#endif
|
#endif
|
||||||
@@ -728,9 +710,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
png_error(png_ptr, "Invalid attempt to read row data");
|
png_error(png_ptr, "Invalid attempt to read row data");
|
||||||
|
|
||||||
png_ptr->zstream.next_out = png_ptr->row_buf;
|
png_ptr->zstream.next_out = png_ptr->row_buf;
|
||||||
png_ptr->zstream.avail_out =
|
png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes;
|
||||||
(uInt)(PNG_ROWBYTES(png_ptr->pixel_depth,
|
|
||||||
png_ptr->iwidth) + 1);
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!(png_ptr->zstream.avail_in))
|
if (!(png_ptr->zstream.avail_in))
|
||||||
@@ -1197,8 +1177,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
|||||||
|
|
||||||
/* Free all memory used by the read (old method) */
|
/* Free all memory used by the read (old method) */
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_read_destroy(png_structp png_ptr, png_infop info_ptr,
|
png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr)
|
||||||
png_infop end_info_ptr)
|
|
||||||
{
|
{
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
jmp_buf tmp_jmp;
|
jmp_buf tmp_jmp;
|
||||||
@@ -1308,6 +1287,12 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
|
|||||||
png_free(png_ptr, png_ptr->save_buffer);
|
png_free(png_ptr, png_ptr->save_buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||||
|
#ifdef PNG_TEXT_SUPPORTED
|
||||||
|
png_free(png_ptr, png_ptr->current_text);
|
||||||
|
#endif /* PNG_TEXT_SUPPORTED */
|
||||||
|
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||||
|
|
||||||
/* Save the important info out of the png_struct, in case it is
|
/* Save the important info out of the png_struct, in case it is
|
||||||
* being used again.
|
* being used again.
|
||||||
*/
|
*/
|
||||||
@@ -1413,7 +1398,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
if (transforms & PNG_TRANSFORM_EXPAND)
|
if (transforms & PNG_TRANSFORM_EXPAND)
|
||||||
if ((png_ptr->bit_depth < 8) ||
|
if ((png_ptr->bit_depth < 8) ||
|
||||||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
|
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
|
||||||
(info_ptr->valid & PNG_INFO_tRNS))
|
(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
|
||||||
png_set_expand(png_ptr);
|
png_set_expand(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1432,8 +1417,14 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
* [0,65535] to the original [0,7] or [0,31], or whatever range the
|
* [0,65535] to the original [0,7] or [0,31], or whatever range the
|
||||||
* colors were originally in:
|
* colors were originally in:
|
||||||
*/
|
*/
|
||||||
if ((transforms & PNG_TRANSFORM_SHIFT) && (info_ptr->valid & PNG_INFO_sBIT))
|
if ((transforms & PNG_TRANSFORM_SHIFT)
|
||||||
png_set_shift(png_ptr, &info_ptr->sig_bit);
|
&& png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
|
||||||
|
{
|
||||||
|
png_color_8p sig_bit;
|
||||||
|
|
||||||
|
png_get_sBIT(png_ptr, info_ptr, &sig_bit);
|
||||||
|
png_set_shift(png_ptr, sig_bit);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_BGR_SUPPORTED
|
#ifdef PNG_READ_BGR_SUPPORTED
|
||||||
@@ -1508,8 +1499,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
|
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
|
||||||
png_read_end(png_ptr, info_ptr);
|
png_read_end(png_ptr, info_ptr);
|
||||||
|
|
||||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
transforms = transforms; /* Quiet compiler warnings */
|
||||||
PNG_UNUSED(params)
|
params = params;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* PNG_INFO_IMAGE_SUPPORTED */
|
#endif /* PNG_INFO_IMAGE_SUPPORTED */
|
||||||
|
|||||||
8
pngrio.c
8
pngrio.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.43 [February 25, 2010]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
|
|
||||||
@@ -92,8 +91,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
if ((png_bytep)n_data == data)
|
if ((png_bytep)n_data == data)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check,
|
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
|
||||||
NULL) )
|
|
||||||
check = 0;
|
check = 0;
|
||||||
#else
|
#else
|
||||||
check = fread(n_data, 1, length, io_ptr);
|
check = fread(n_data, 1, length, io_ptr);
|
||||||
|
|||||||
109
pngrtran.c
109
pngrtran.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.53 [February 26, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
|
|
||||||
@@ -432,10 +431,8 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
png_ptr->palette_to_index[png_ptr->index_to_palette[j]]
|
png_ptr->palette_to_index[png_ptr->index_to_palette[j]]
|
||||||
= png_ptr->palette_to_index[num_new_palette];
|
= png_ptr->palette_to_index[num_new_palette];
|
||||||
|
|
||||||
png_ptr->index_to_palette[j] =
|
png_ptr->index_to_palette[j] = (png_byte)num_new_palette;
|
||||||
(png_byte)num_new_palette;
|
png_ptr->palette_to_index[num_new_palette] = (png_byte)j;
|
||||||
png_ptr->palette_to_index[num_new_palette] =
|
|
||||||
(png_byte)j;
|
|
||||||
}
|
}
|
||||||
if (num_new_palette <= maximum_colors)
|
if (num_new_palette <= maximum_colors)
|
||||||
break;
|
break;
|
||||||
@@ -504,8 +501,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
|||||||
{
|
{
|
||||||
/* int dr = abs(ir - r); */
|
/* int dr = abs(ir - r); */
|
||||||
int dr = ((ir > r) ? ir - r : r - ir);
|
int dr = ((ir > r) ? ir - r : r - ir);
|
||||||
int index_r = (ir << (PNG_DITHER_BLUE_BITS +
|
int index_r = (ir << (PNG_DITHER_BLUE_BITS + PNG_DITHER_GREEN_BITS));
|
||||||
PNG_DITHER_GREEN_BITS));
|
|
||||||
|
|
||||||
for (ig = 0; ig < num_green; ig++)
|
for (ig = 0; ig < num_green; ig++)
|
||||||
{
|
{
|
||||||
@@ -676,21 +672,10 @@ void PNGAPI
|
|||||||
png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
|
png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
|
||||||
double green)
|
double green)
|
||||||
{
|
{
|
||||||
int red_fixed, green_fixed;
|
int red_fixed = (int)((float)red*100000.0 + 0.5);
|
||||||
|
int green_fixed = (int)((float)green*100000.0 + 0.5);
|
||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
if (red > 21474.83647 || red < -21474.83648 ||
|
|
||||||
green > 21474.83647 || green < -21474.83648)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients");
|
|
||||||
red_fixed = -1;
|
|
||||||
green_fixed = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
red_fixed = (int)((float)red*100000.0 + 0.5);
|
|
||||||
green_fixed = (int)((float)green*100000.0 + 0.5);
|
|
||||||
}
|
|
||||||
png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
|
png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -786,9 +771,8 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
if (png_ptr != NULL)
|
if (png_ptr != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||||
defined(PNG_READ_SHIFT_SUPPORTED) || \
|
|| defined(PNG_READ_GAMMA_SUPPORTED)
|
||||||
defined(PNG_READ_GAMMA_SUPPORTED)
|
|
||||||
int color_type = png_ptr->color_type;
|
int color_type = png_ptr->color_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -917,10 +901,7 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
for (i=0; i<png_ptr->num_trans; i++)
|
for (i=0; i<png_ptr->num_trans; i++)
|
||||||
{
|
{
|
||||||
if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
|
if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
|
||||||
{
|
|
||||||
k=1; /* Partial transparency is present */
|
k=1; /* Partial transparency is present */
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (k == 0)
|
if (k == 0)
|
||||||
png_ptr->transformations &= ~PNG_GAMMA;
|
png_ptr->transformations &= ~PNG_GAMMA;
|
||||||
@@ -930,7 +911,6 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
png_ptr->gamma != 0.0)
|
png_ptr->gamma != 0.0)
|
||||||
{
|
{
|
||||||
png_build_gamma_table(png_ptr);
|
png_build_gamma_table(png_ptr);
|
||||||
|
|
||||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||||
if (png_ptr->transformations & PNG_BACKGROUND)
|
if (png_ptr->transformations & PNG_BACKGROUND)
|
||||||
{
|
{
|
||||||
@@ -988,8 +968,7 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
back.red = (png_byte)(pow(
|
back.red = (png_byte)(pow(
|
||||||
(double)png_ptr->background.red/255, gs) * 255.0 + .5);
|
(double)png_ptr->background.red/255, gs) * 255.0 + .5);
|
||||||
back.green = (png_byte)(pow(
|
back.green = (png_byte)(pow(
|
||||||
(double)png_ptr->background.green/255, gs) * 255.0
|
(double)png_ptr->background.green/255, gs) * 255.0 + .5);
|
||||||
+ .5);
|
|
||||||
back.blue = (png_byte)(pow(
|
back.blue = (png_byte)(pow(
|
||||||
(double)png_ptr->background.blue/255, gs) * 255.0 + .5);
|
(double)png_ptr->background.blue/255, gs) * 255.0 + .5);
|
||||||
}
|
}
|
||||||
@@ -1166,7 +1145,6 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
|
|
||||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
#ifdef PNG_READ_SHIFT_SUPPORTED
|
||||||
if ((png_ptr->transformations & PNG_SHIFT) &&
|
if ((png_ptr->transformations & PNG_SHIFT) &&
|
||||||
!(png_ptr->transformations & PNG_EXPAND) &&
|
|
||||||
(color_type == PNG_COLOR_TYPE_PALETTE))
|
(color_type == PNG_COLOR_TYPE_PALETTE))
|
||||||
{
|
{
|
||||||
png_uint_16 i;
|
png_uint_16 i;
|
||||||
@@ -1187,8 +1165,6 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
png_ptr->palette[i].green >>= sg;
|
png_ptr->palette[i].green >>= sg;
|
||||||
png_ptr->palette[i].blue >>= sb;
|
png_ptr->palette[i].blue >>= sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_ptr->transformations &= ~PNG_SHIFT;
|
|
||||||
}
|
}
|
||||||
#endif /* PNG_READ_SHIFT_SUPPORTED */
|
#endif /* PNG_READ_SHIFT_SUPPORTED */
|
||||||
}
|
}
|
||||||
@@ -1213,7 +1189,8 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
|||||||
{
|
{
|
||||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
{
|
{
|
||||||
if (png_ptr->num_trans)
|
if (png_ptr->num_trans &&
|
||||||
|
(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||||
else
|
else
|
||||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
||||||
@@ -1379,9 +1356,6 @@ png_do_read_transformations(png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE)
|
if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
{
|
{
|
||||||
if (png_ptr->palette == NULL)
|
|
||||||
png_error (png_ptr, "Palette is NULL in indexed image");
|
|
||||||
|
|
||||||
png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||||
png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
|
png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
|
||||||
}
|
}
|
||||||
@@ -1408,8 +1382,7 @@ png_do_read_transformations(png_structp png_ptr)
|
|||||||
if (png_ptr->transformations & PNG_RGB_TO_GRAY)
|
if (png_ptr->transformations & PNG_RGB_TO_GRAY)
|
||||||
{
|
{
|
||||||
int rgb_error =
|
int rgb_error =
|
||||||
png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info),
|
png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1);
|
||||||
png_ptr->row_buf + 1);
|
|
||||||
if (rgb_error)
|
if (rgb_error)
|
||||||
{
|
{
|
||||||
png_ptr->rgb_to_gray_status=1;
|
png_ptr->rgb_to_gray_status=1;
|
||||||
@@ -1463,6 +1436,11 @@ png_do_read_transformations(png_structp png_ptr)
|
|||||||
png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_16_TO_8)
|
||||||
|
png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||||
if ((png_ptr->transformations & PNG_BACKGROUND) &&
|
if ((png_ptr->transformations & PNG_BACKGROUND) &&
|
||||||
((png_ptr->num_trans != 0 ) ||
|
((png_ptr->num_trans != 0 ) ||
|
||||||
@@ -1492,11 +1470,6 @@ png_do_read_transformations(png_structp png_ptr)
|
|||||||
png_ptr->gamma_shift);
|
png_ptr->gamma_shift);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_16_TO_8)
|
|
||||||
png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_DITHER_SUPPORTED
|
#ifdef PNG_READ_DITHER_SUPPORTED
|
||||||
if (png_ptr->transformations & PNG_DITHER)
|
if (png_ptr->transformations & PNG_DITHER)
|
||||||
{
|
{
|
||||||
@@ -2410,14 +2383,10 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
png_uint_16 red, green, blue, w;
|
png_uint_16 red, green, blue, w;
|
||||||
png_byte hi,lo;
|
|
||||||
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
red = (png_uint_16)((hi << 8) | (lo));
|
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
green = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
|
||||||
blue = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
|
|
||||||
if (red == green && red == blue)
|
if (red == green && red == blue)
|
||||||
w = red;
|
w = red;
|
||||||
@@ -2425,8 +2394,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >>
|
png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >>
|
||||||
png_ptr->gamma_shift][red>>8];
|
png_ptr->gamma_shift][red>>8];
|
||||||
png_uint_16 green_1 =
|
png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >>
|
||||||
png_ptr->gamma_16_to_1[(green&0xff) >>
|
|
||||||
png_ptr->gamma_shift][green>>8];
|
png_ptr->gamma_shift][green>>8];
|
||||||
png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >>
|
png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >>
|
||||||
png_ptr->gamma_shift][blue>>8];
|
png_ptr->gamma_shift][blue>>8];
|
||||||
@@ -2449,14 +2417,10 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
png_uint_16 red, green, blue, gray16;
|
png_uint_16 red, green, blue, gray16;
|
||||||
png_byte hi,lo;
|
|
||||||
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
red = (png_uint_16)((hi << 8) | (lo));
|
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
green = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
|
||||||
blue = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
|
|
||||||
if (red != green || red != blue)
|
if (red != green || red != blue)
|
||||||
rgb_error |= 1;
|
rgb_error |= 1;
|
||||||
@@ -2516,14 +2480,10 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
png_uint_16 red, green, blue, w;
|
png_uint_16 red, green, blue, w;
|
||||||
png_byte hi,lo;
|
|
||||||
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
red = (png_uint_16)((hi << 8) | (lo));
|
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||||
green = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
hi=*(sp)++; lo=*(sp)++;
|
|
||||||
blue = (png_uint_16)((hi << 8) | (lo));
|
|
||||||
|
|
||||||
if (red == green && red == blue)
|
if (red == green && red == blue)
|
||||||
w = red;
|
w = red;
|
||||||
@@ -2531,8 +2491,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >>
|
png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >>
|
||||||
png_ptr->gamma_shift][red>>8];
|
png_ptr->gamma_shift][red>>8];
|
||||||
png_uint_16 green_1 =
|
png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >>
|
||||||
png_ptr->gamma_16_to_1[(green&0xff) >>
|
|
||||||
png_ptr->gamma_shift][green>>8];
|
png_ptr->gamma_shift][green>>8];
|
||||||
png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >>
|
png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >>
|
||||||
png_ptr->gamma_shift][blue>>8];
|
png_ptr->gamma_shift][blue>>8];
|
||||||
@@ -2636,8 +2595,7 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This function is currently unused. Do we really need it? */
|
/* This function is currently unused. Do we really need it? */
|
||||||
#if defined(PNG_READ_DITHER_SUPPORTED) && \
|
#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED)
|
||||||
defined(PNG_CORRECT_PALETTE_SUPPORTED)
|
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_correct_palette(png_structp png_ptr, png_colorp palette,
|
png_correct_palette(png_structp png_ptr, png_colorp palette,
|
||||||
int num_palette)
|
int num_palette)
|
||||||
@@ -2645,8 +2603,7 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
|
|||||||
png_debug(1, "in png_correct_palette");
|
png_debug(1, "in png_correct_palette");
|
||||||
|
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
|
||||||
defined(PNG_READ_GAMMA_SUPPORTED) && \
|
defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||||
defined(PNG_FLOATING_POINT_SUPPORTED)
|
|
||||||
if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
|
if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
|
||||||
{
|
{
|
||||||
png_color back, back_1;
|
png_color back, back_1;
|
||||||
@@ -2667,8 +2624,8 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
||||||
|
|
||||||
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN
|
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN ||
|
||||||
|| fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
|
fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
|
||||||
{
|
{
|
||||||
back.red = png_ptr->background.red;
|
back.red = png_ptr->background.red;
|
||||||
back.green = png_ptr->background.green;
|
back.green = png_ptr->background.green;
|
||||||
|
|||||||
550
pngrutil.c
550
pngrutil.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.55 [%RDATE%]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
|
|
||||||
@@ -26,8 +25,7 @@
|
|||||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
# ifdef WIN32_WCE_OLD
|
# ifdef WIN32_WCE_OLD
|
||||||
/* The strtod() function is not supported on WindowsCE */
|
/* The strtod() function is not supported on WindowsCE */
|
||||||
__inline double png_strtod(png_structp png_ptr, PNG_CONST char *nptr,
|
__inline double png_strtod(png_structp png_ptr, PNG_CONST char *nptr, char **endptr)
|
||||||
char **endptr)
|
|
||||||
{
|
{
|
||||||
double result = 0;
|
double result = 0;
|
||||||
int len;
|
int len;
|
||||||
@@ -57,10 +55,10 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf)
|
|||||||
png_uint_32 i = png_get_uint_32(buf);
|
png_uint_32 i = png_get_uint_32(buf);
|
||||||
#else
|
#else
|
||||||
/* Avoid an extra function call by inlining the result. */
|
/* Avoid an extra function call by inlining the result. */
|
||||||
png_uint_32 i = ((png_uint_32)((*(buf )) & 0xff) << 24) +
|
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
|
||||||
((png_uint_32)((*(buf + 1)) & 0xff) << 16) +
|
((png_uint_32)(*(buf + 1)) << 16) +
|
||||||
((png_uint_32)((*(buf + 2)) & 0xff) << 8) +
|
((png_uint_32)(*(buf + 2)) << 8) +
|
||||||
((png_uint_32)((*(buf + 3)) & 0xff) );
|
(png_uint_32)(*(buf + 3));
|
||||||
#endif
|
#endif
|
||||||
if (i > PNG_UINT_31_MAX)
|
if (i > PNG_UINT_31_MAX)
|
||||||
png_error(png_ptr, "PNG unsigned integer out of range.");
|
png_error(png_ptr, "PNG unsigned integer out of range.");
|
||||||
@@ -71,10 +69,10 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf)
|
|||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_uint_32(png_bytep buf)
|
png_get_uint_32(png_bytep buf)
|
||||||
{
|
{
|
||||||
png_uint_32 i = ((png_uint_32)((*(buf )) & 0xff) << 24) +
|
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
|
||||||
((png_uint_32)((*(buf + 1)) & 0xff) << 16) +
|
((png_uint_32)(*(buf + 1)) << 16) +
|
||||||
((png_uint_32)((*(buf + 2)) & 0xff) << 8) +
|
((png_uint_32)(*(buf + 2)) << 8) +
|
||||||
((png_uint_32)((*(buf + 3)) & 0xff) );
|
(png_uint_32)(*(buf + 3));
|
||||||
|
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
@@ -86,10 +84,10 @@ png_get_uint_32(png_bytep buf)
|
|||||||
png_int_32 PNGAPI
|
png_int_32 PNGAPI
|
||||||
png_get_int_32(png_bytep buf)
|
png_get_int_32(png_bytep buf)
|
||||||
{
|
{
|
||||||
png_int_32 i = ((png_int_32)((*(buf )) & 0xff) << 24) +
|
png_int_32 i = ((png_int_32)(*buf) << 24) +
|
||||||
((png_int_32)((*(buf + 1)) & 0xff) << 16) +
|
((png_int_32)(*(buf + 1)) << 16) +
|
||||||
((png_int_32)((*(buf + 2)) & 0xff) << 8) +
|
((png_int_32)(*(buf + 2)) << 8) +
|
||||||
((png_int_32)((*(buf + 3)) & 0xff) );
|
(png_int_32)(*(buf + 3));
|
||||||
|
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
@@ -98,8 +96,8 @@ png_get_int_32(png_bytep buf)
|
|||||||
png_uint_16 PNGAPI
|
png_uint_16 PNGAPI
|
||||||
png_get_uint_16(png_bytep buf)
|
png_get_uint_16(png_bytep buf)
|
||||||
{
|
{
|
||||||
png_uint_16 i = ((png_uint_16)((*(buf )) & 0xff) << 8) +
|
png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) +
|
||||||
((png_uint_16)((*(buf + 1)) & 0xff) );
|
(png_uint_16)(*(buf + 1)));
|
||||||
|
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
@@ -218,100 +216,6 @@ png_crc_error(png_structp png_ptr)
|
|||||||
|
|
||||||
#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \
|
#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \
|
||||||
defined(PNG_READ_iCCP_SUPPORTED)
|
defined(PNG_READ_iCCP_SUPPORTED)
|
||||||
static png_size_t
|
|
||||||
png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
|
|
||||||
png_bytep output, png_size_t output_size)
|
|
||||||
{
|
|
||||||
png_size_t count = 0;
|
|
||||||
|
|
||||||
png_ptr->zstream.next_in = (png_bytep)data; /* const_cast: VALID */
|
|
||||||
png_ptr->zstream.avail_in = size;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
int ret, avail;
|
|
||||||
|
|
||||||
/* Reset the output buffer each time round - we empty it
|
|
||||||
* after every inflate call.
|
|
||||||
*/
|
|
||||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
|
||||||
png_ptr->zstream.avail_out = png_ptr->zbuf_size;
|
|
||||||
|
|
||||||
ret = inflate(&png_ptr->zstream, Z_NO_FLUSH);
|
|
||||||
avail = png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
|
||||||
|
|
||||||
/* First copy/count any new output - but only if we didn't
|
|
||||||
* get an error code.
|
|
||||||
*/
|
|
||||||
if ((ret == Z_OK || ret == Z_STREAM_END) && avail > 0)
|
|
||||||
{
|
|
||||||
if (output != 0 && output_size > count)
|
|
||||||
{
|
|
||||||
png_size_t copy = output_size - count;
|
|
||||||
if ((png_size_t) avail < copy) copy = (png_size_t) avail;
|
|
||||||
png_memcpy(output + count, png_ptr->zbuf, copy);
|
|
||||||
}
|
|
||||||
count += avail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret == Z_OK)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Termination conditions - always reset the zstream, it
|
|
||||||
* must be left in inflateInit state.
|
|
||||||
*/
|
|
||||||
png_ptr->zstream.avail_in = 0;
|
|
||||||
inflateReset(&png_ptr->zstream);
|
|
||||||
|
|
||||||
if (ret == Z_STREAM_END)
|
|
||||||
return count; /* NOTE: may be zero. */
|
|
||||||
|
|
||||||
/* Now handle the error codes - the API always returns 0
|
|
||||||
* and the error message is dumped into the uncompressed
|
|
||||||
* buffer if available.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
PNG_CONST char *msg;
|
|
||||||
if (png_ptr->zstream.msg != 0)
|
|
||||||
msg = png_ptr->zstream.msg;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
|
||||||
char umsg[52];
|
|
||||||
|
|
||||||
switch (ret)
|
|
||||||
{
|
|
||||||
case Z_BUF_ERROR:
|
|
||||||
msg = "Buffer error in compressed datastream in %s chunk";
|
|
||||||
break;
|
|
||||||
case Z_DATA_ERROR:
|
|
||||||
msg = "Data error in compressed datastream in %s chunk";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
msg = "Incomplete compressed datastream in %s chunk";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name);
|
|
||||||
msg = umsg;
|
|
||||||
png_warning(png_ptr, msg);
|
|
||||||
#else
|
|
||||||
msg = "Damaged compressed datastream in chunk other than IDAT";
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef PNG_STDIO_SUPPORTED
|
|
||||||
png_warning(png_ptr, msg);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 0 means an error - notice that this code simple ignores
|
|
||||||
* zero length compressed chunks as a result.
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Decompress trailing data in a chunk. The assumption is that chunkdata
|
* Decompress trailing data in a chunk. The assumption is that chunkdata
|
||||||
* points at an allocated area holding the contents of a chunk with a
|
* points at an allocated area holding the contents of a chunk with a
|
||||||
@@ -324,106 +228,168 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
|||||||
png_size_t chunklength,
|
png_size_t chunklength,
|
||||||
png_size_t prefix_size, png_size_t *newlength)
|
png_size_t prefix_size, png_size_t *newlength)
|
||||||
{
|
{
|
||||||
/* The caller should guarantee this */
|
static PNG_CONST char msg[] = "Error decoding compressed chunk";
|
||||||
if (prefix_size > chunklength)
|
png_charp text;
|
||||||
|
png_size_t text_size;
|
||||||
|
|
||||||
|
if (comp_type == PNG_COMPRESSION_TYPE_BASE)
|
||||||
{
|
{
|
||||||
/* The recovery is to delete the chunk. */
|
int ret = Z_OK;
|
||||||
png_warning(png_ptr, "invalid chunklength");
|
png_ptr->zstream.next_in = (png_bytep)(png_ptr->chunkdata + prefix_size);
|
||||||
prefix_size = 0; /* To delete everything */
|
png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size);
|
||||||
}
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
|
|
||||||
else if (comp_type == PNG_COMPRESSION_TYPE_BASE)
|
text_size = 0;
|
||||||
|
text = NULL;
|
||||||
|
|
||||||
|
while (png_ptr->zstream.avail_in)
|
||||||
{
|
{
|
||||||
png_size_t expanded_size = png_inflate(png_ptr,
|
ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
|
||||||
(png_bytep)(png_ptr->chunkdata + prefix_size),
|
if (ret != Z_OK && ret != Z_STREAM_END)
|
||||||
chunklength - prefix_size,
|
|
||||||
0/*output*/, 0/*output size*/);
|
|
||||||
|
|
||||||
/* Now check the limits on this chunk - if the limit fails the
|
|
||||||
* compressed data will be removed, the prefix will remain.
|
|
||||||
*/
|
|
||||||
if (prefix_size >= (~(png_size_t)0) - 1 ||
|
|
||||||
expanded_size >= (~(png_size_t)0) - 1 - prefix_size
|
|
||||||
#ifdef PNG_USER_CHUNK_MALLOC_MAX
|
|
||||||
|| ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
|
|
||||||
prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
png_warning(png_ptr, "Exceeded size limit while expanding chunk");
|
|
||||||
|
|
||||||
/* If the size is zero either there was an error and a message
|
|
||||||
* has already been output (warning) or the size really is zero
|
|
||||||
* and we have nothing to do - the code will exit through the
|
|
||||||
* error case below.
|
|
||||||
*/
|
|
||||||
else if (expanded_size > 0)
|
|
||||||
{
|
{
|
||||||
/* Success (maybe) - really uncompress the chunk. */
|
if (png_ptr->zstream.msg != NULL)
|
||||||
png_size_t new_size = 0;
|
png_warning(png_ptr, png_ptr->zstream.msg);
|
||||||
|
else
|
||||||
|
png_warning(png_ptr, msg);
|
||||||
|
inflateReset(&png_ptr->zstream);
|
||||||
|
png_ptr->zstream.avail_in = 0;
|
||||||
|
|
||||||
png_charp text = png_malloc_warn(png_ptr,
|
if (text == NULL)
|
||||||
prefix_size + expanded_size + 1);
|
|
||||||
|
|
||||||
if (text != NULL)
|
|
||||||
{
|
{
|
||||||
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
text_size = prefix_size + png_sizeof(msg) + 1;
|
||||||
new_size = png_inflate(png_ptr,
|
text = (png_charp)png_malloc_warn(png_ptr, text_size);
|
||||||
(png_bytep)(png_ptr->chunkdata + prefix_size),
|
if (text == NULL)
|
||||||
chunklength - prefix_size,
|
|
||||||
(png_bytep)(text + prefix_size), expanded_size);
|
|
||||||
text[prefix_size + expanded_size] = 0; /* just in case */
|
|
||||||
|
|
||||||
if (new_size == expanded_size)
|
|
||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
png_ptr->chunkdata = text;
|
png_ptr->chunkdata = NULL;
|
||||||
*newlength = prefix_size + expanded_size;
|
png_error(png_ptr, "Not enough memory to decompress chunk");
|
||||||
return; /* The success return! */
|
}
|
||||||
|
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
png_warning(png_ptr, "png_inflate logic error");
|
text[text_size - 1] = 0x00;
|
||||||
png_free(png_ptr, text);
|
|
||||||
|
/* Copy what we can of the error message into the text chunk */
|
||||||
|
text_size = (png_size_t)(chunklength -
|
||||||
|
(text - png_ptr->chunkdata) - 1);
|
||||||
|
if (text_size > png_sizeof(msg))
|
||||||
|
text_size = png_sizeof(msg);
|
||||||
|
png_memcpy(text + prefix_size, msg, text_size);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!png_ptr->zstream.avail_out || ret == Z_STREAM_END)
|
||||||
|
{
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
text_size = prefix_size +
|
||||||
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
||||||
|
text = (png_charp)png_malloc_warn(png_ptr, text_size + 1);
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
|
png_ptr->chunkdata = NULL;
|
||||||
|
png_error(png_ptr,
|
||||||
|
"Not enough memory to decompress chunk.");
|
||||||
|
}
|
||||||
|
png_memcpy(text + prefix_size, png_ptr->zbuf,
|
||||||
|
text_size - prefix_size);
|
||||||
|
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
||||||
|
*(text + text_size) = 0x00;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
png_warning(png_ptr, "Not enough memory to decompress chunk.");
|
{
|
||||||
|
png_charp tmp;
|
||||||
|
|
||||||
|
tmp = text;
|
||||||
|
text = (png_charp)png_malloc_warn(png_ptr,
|
||||||
|
(png_uint_32)(text_size +
|
||||||
|
png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1));
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, tmp);
|
||||||
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
|
png_ptr->chunkdata = NULL;
|
||||||
|
png_error(png_ptr,
|
||||||
|
"Not enough memory to decompress chunk..");
|
||||||
}
|
}
|
||||||
|
png_memcpy(text, tmp, text_size);
|
||||||
|
png_free(png_ptr, tmp);
|
||||||
|
png_memcpy(text + text_size, png_ptr->zbuf,
|
||||||
|
(png_ptr->zbuf_size - png_ptr->zstream.avail_out));
|
||||||
|
text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out;
|
||||||
|
*(text + text_size) = 0x00;
|
||||||
|
}
|
||||||
|
if (ret == Z_STREAM_END)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ret != Z_STREAM_END)
|
||||||
|
{
|
||||||
|
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||||
|
char umsg[52];
|
||||||
|
|
||||||
|
if (ret == Z_BUF_ERROR)
|
||||||
|
png_snprintf(umsg, 52,
|
||||||
|
"Buffer error in compressed datastream in %s chunk",
|
||||||
|
png_ptr->chunk_name);
|
||||||
|
|
||||||
|
else if (ret == Z_DATA_ERROR)
|
||||||
|
png_snprintf(umsg, 52,
|
||||||
|
"Data error in compressed datastream in %s chunk",
|
||||||
|
png_ptr->chunk_name);
|
||||||
|
|
||||||
|
else
|
||||||
|
png_snprintf(umsg, 52,
|
||||||
|
"Incomplete compressed datastream in %s chunk",
|
||||||
|
png_ptr->chunk_name);
|
||||||
|
|
||||||
|
png_warning(png_ptr, umsg);
|
||||||
|
#else
|
||||||
|
png_warning(png_ptr,
|
||||||
|
"Incomplete compressed datastream in chunk other than IDAT");
|
||||||
|
#endif
|
||||||
|
text_size = prefix_size;
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
text = (png_charp)png_malloc_warn(png_ptr, text_size+1);
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
|
png_ptr->chunkdata = NULL;
|
||||||
|
png_error(png_ptr, "Not enough memory for text.");
|
||||||
|
}
|
||||||
|
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
||||||
|
}
|
||||||
|
*(text + text_size) = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inflateReset(&png_ptr->zstream);
|
||||||
|
png_ptr->zstream.avail_in = 0;
|
||||||
|
|
||||||
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
|
png_ptr->chunkdata = text;
|
||||||
|
*newlength=text_size;
|
||||||
|
}
|
||||||
else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
|
else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
|
||||||
{
|
{
|
||||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||||
char umsg[50];
|
char umsg[50];
|
||||||
|
|
||||||
png_snprintf(umsg, sizeof umsg, "Unknown zTXt compression type %d",
|
png_snprintf(umsg, 50, "Unknown zTXt compression type %d", comp_type);
|
||||||
comp_type);
|
|
||||||
png_warning(png_ptr, umsg);
|
png_warning(png_ptr, umsg);
|
||||||
#else
|
#else
|
||||||
png_warning(png_ptr, "Unknown zTXt compression type");
|
png_warning(png_ptr, "Unknown zTXt compression type");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The recovery is to simply drop the data. */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Generic error return - leave the prefix, delete the compressed
|
|
||||||
* data, reallocate the chunkdata to remove the potentially large
|
|
||||||
* amount of compressed data.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
png_charp text = png_malloc_warn(png_ptr, prefix_size + 1);
|
|
||||||
if (text != NULL)
|
|
||||||
{
|
|
||||||
if (prefix_size > 0)
|
|
||||||
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
|
||||||
png_ptr->chunkdata = text;
|
|
||||||
|
|
||||||
/* This is an extra zero in the 'uncompressed' part. */
|
|
||||||
*(png_ptr->chunkdata + prefix_size) = 0x00;
|
*(png_ptr->chunkdata + prefix_size) = 0x00;
|
||||||
}
|
|
||||||
/* Ignore a malloc error here - it is safe. */
|
|
||||||
}
|
|
||||||
|
|
||||||
*newlength = prefix_size;
|
*newlength = prefix_size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -506,7 +472,7 @@ void /* PRIVATE */
|
|||||||
png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
{
|
{
|
||||||
png_color palette[PNG_MAX_PALETTE_LENGTH];
|
png_color palette[PNG_MAX_PALETTE_LENGTH];
|
||||||
int max_palette_length, num, i;
|
int num, i;
|
||||||
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
||||||
png_colorp pal_ptr;
|
png_colorp pal_ptr;
|
||||||
#endif
|
#endif
|
||||||
@@ -558,22 +524,8 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The cast is safe because 'length' is less than 3*PNG_MAX_PALETTE_LENGTH */
|
|
||||||
num = (int)length / 3;
|
num = (int)length / 3;
|
||||||
|
|
||||||
/* If the palette has 256 or fewer entries but is too large for the bit
|
|
||||||
* depth, we don't issue an error, to preserve the behavior of previous
|
|
||||||
* libpng versions. We silently truncate the unused extra palette entries
|
|
||||||
* here.
|
|
||||||
*/
|
|
||||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
|
||||||
max_palette_length = (1 << png_ptr->bit_depth);
|
|
||||||
else
|
|
||||||
max_palette_length = PNG_MAX_PALETTE_LENGTH;
|
|
||||||
|
|
||||||
if (num > max_palette_length)
|
|
||||||
num = max_palette_length;
|
|
||||||
|
|
||||||
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
||||||
for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
|
for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++)
|
||||||
{
|
{
|
||||||
@@ -606,7 +558,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
png_crc_finish(png_ptr, (int) length - num * 3);
|
png_crc_finish(png_ptr, 0);
|
||||||
}
|
}
|
||||||
#ifndef PNG_READ_OPT_PLTE_SUPPORTED
|
#ifndef PNG_READ_OPT_PLTE_SUPPORTED
|
||||||
else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */
|
else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */
|
||||||
@@ -676,7 +628,7 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
|
|
||||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||||
@@ -928,11 +880,9 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
green_x, green_y, blue_x, blue_y);
|
green_x, green_y, blue_x, blue_y);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "wx=%ld, wy=%ld, rx=%ld, ry=%ld\n",
|
fprintf(stderr, "wx=%ld, wy=%ld, rx=%ld, ry=%ld\n",
|
||||||
(long)int_x_white, (long)int_y_white,
|
int_x_white, int_y_white, int_x_red, int_y_red);
|
||||||
(long)int_x_red, (long)int_y_red);
|
|
||||||
fprintf(stderr, "gx=%ld, gy=%ld, bx=%ld, by=%ld\n",
|
fprintf(stderr, "gx=%ld, gy=%ld, bx=%ld, by=%ld\n",
|
||||||
(long)int_x_green, (long)int_y_green,
|
int_x_green, int_y_green, int_x_blue, int_y_blue);
|
||||||
(long)int_x_blue, (long)int_y_blue);
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* PNG_CONSOLE_IO_SUPPORTED */
|
#endif /* PNG_CONSOLE_IO_SUPPORTED */
|
||||||
}
|
}
|
||||||
@@ -1114,7 +1064,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* There should be at least one zero (the compression type byte)
|
/* There should be at least one zero (the compression type byte)
|
||||||
* following the separator, and we should be on it
|
* following the separator, and we should be on it
|
||||||
*/
|
*/
|
||||||
if (slength < 1U || profile >= png_ptr->chunkdata + slength - 1U)
|
if ( profile >= png_ptr->chunkdata + slength - 1)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
png_ptr->chunkdata = NULL;
|
png_ptr->chunkdata = NULL;
|
||||||
@@ -1147,10 +1097,10 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
/* Check the profile_size recorded in the first 32 bits of the ICC profile */
|
/* Check the profile_size recorded in the first 32 bits of the ICC profile */
|
||||||
pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
|
pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
|
||||||
profile_size = ((png_uint_32) (*(pC )<<24)) |
|
profile_size = ((*(pC ))<<24) |
|
||||||
((png_uint_32) (*(pC + 1)<<16)) |
|
((*(pC + 1))<<16) |
|
||||||
((png_uint_32) (*(pC + 2)<< 8)) |
|
((*(pC + 2))<< 8) |
|
||||||
((png_uint_32) (*(pC + 3) ));
|
((*(pC + 3)) );
|
||||||
|
|
||||||
if (profile_size < profile_length)
|
if (profile_size < profile_length)
|
||||||
profile_length = profile_size;
|
profile_length = profile_size;
|
||||||
@@ -1186,24 +1136,6 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug(1, "in png_handle_sPLT");
|
png_debug(1, "in png_handle_sPLT");
|
||||||
|
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
|
|
||||||
if (png_ptr->user_chunk_cache_max != 0)
|
|
||||||
{
|
|
||||||
if (png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (--png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "No space in chunk cache for sPLT");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
png_error(png_ptr, "Missing IHDR before sPLT");
|
png_error(png_ptr, "Missing IHDR before sPLT");
|
||||||
else if (png_ptr->mode & PNG_HAVE_IDAT)
|
else if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||||
@@ -1236,14 +1168,12 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_ptr->chunkdata[slength] = 0x00;
|
png_ptr->chunkdata[slength] = 0x00;
|
||||||
|
|
||||||
for (entry_start = (png_bytep)png_ptr->chunkdata; *entry_start;
|
for (entry_start = (png_bytep)png_ptr->chunkdata; *entry_start; entry_start++)
|
||||||
entry_start++)
|
|
||||||
/* Empty loop to find end of name */ ;
|
/* Empty loop to find end of name */ ;
|
||||||
++entry_start;
|
++entry_start;
|
||||||
|
|
||||||
/* A sample depth should follow the separator, and we should be on it */
|
/* A sample depth should follow the separator, and we should be on it */
|
||||||
if (slength < 2U ||
|
if (entry_start > (png_bytep)png_ptr->chunkdata + slength - 2)
|
||||||
entry_start > (png_bytep)png_ptr->chunkdata + slength - 2U)
|
|
||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
png_ptr->chunkdata = NULL;
|
png_ptr->chunkdata = NULL;
|
||||||
@@ -1548,16 +1478,15 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length > 2*PNG_MAX_PALETTE_LENGTH ||
|
num = length / 2 ;
|
||||||
length != (unsigned int) (2*png_ptr->num_palette))
|
if (num != (unsigned int) png_ptr->num_palette || num >
|
||||||
|
(unsigned int) PNG_MAX_PALETTE_LENGTH)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Incorrect hIST chunk length");
|
png_warning(png_ptr, "Incorrect hIST chunk length");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = length / 2 ;
|
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
png_byte buf[2];
|
png_byte buf[2];
|
||||||
@@ -1717,7 +1646,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
/* We need to have at least 12 bytes after the purpose string
|
/* We need to have at least 12 bytes after the purpose string
|
||||||
in order to get the parameter information. */
|
in order to get the parameter information. */
|
||||||
if (slength < 12U || endptr - buf <= 12)
|
if (endptr <= buf + 12)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Invalid pCAL data");
|
png_warning(png_ptr, "Invalid pCAL data");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
@@ -1826,21 +1755,12 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need unit type, width, \0, height: minimum 4 bytes */
|
|
||||||
else if (length < 4)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "sCAL chunk too short");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)",
|
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)",
|
||||||
length + 1);
|
length + 1);
|
||||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||||
if (png_ptr->chunkdata == NULL)
|
if (png_ptr->chunkdata == NULL)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Out of memory while processing sCAL chunk");
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk");
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
slength = (png_size_t)length;
|
slength = (png_size_t)length;
|
||||||
@@ -1862,8 +1782,6 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (*vp)
|
if (*vp)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "malformed width string in sCAL chunk");
|
png_warning(png_ptr, "malformed width string in sCAL chunk");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
|
||||||
png_ptr->chunkdata = NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -1872,22 +1790,21 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (swidth == NULL)
|
if (swidth == NULL)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Out of memory while processing sCAL chunk width");
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk width");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
|
||||||
png_ptr->chunkdata = NULL;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep) + 1);
|
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (ep = png_ptr->chunkdata + 1; *ep; ep++)
|
for (ep = png_ptr->chunkdata; *ep; ep++)
|
||||||
/* Empty loop */ ;
|
/* Empty loop */ ;
|
||||||
ep++;
|
ep++;
|
||||||
|
|
||||||
if (png_ptr->chunkdata + slength < ep)
|
if (png_ptr->chunkdata + slength < ep)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Truncated sCAL chunk");
|
png_warning(png_ptr, "Truncated sCAL chunk");
|
||||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
#if defined(PNG_FIXED_POINT_SUPPORTED) && \
|
||||||
|
!defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||||
png_free(png_ptr, swidth);
|
png_free(png_ptr, swidth);
|
||||||
#endif
|
#endif
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
@@ -1900,11 +1817,6 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (*vp)
|
if (*vp)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "malformed height string in sCAL chunk");
|
png_warning(png_ptr, "malformed height string in sCAL chunk");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
|
||||||
png_ptr->chunkdata = NULL;
|
|
||||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
|
||||||
png_free(png_ptr, swidth);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -1913,14 +1825,9 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (sheight == NULL)
|
if (sheight == NULL)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
|
png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
|
||||||
png_ptr->chunkdata = NULL;
|
|
||||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
|
||||||
png_free(png_ptr, swidth);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
png_memcpy(sheight, ep, (png_size_t)png_strlen(ep) + 1);
|
png_memcpy(sheight, ep, (png_size_t)png_strlen(ep));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2015,23 +1922,6 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug(1, "in png_handle_tEXt");
|
png_debug(1, "in png_handle_tEXt");
|
||||||
|
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
if (png_ptr->user_chunk_cache_max != 0)
|
|
||||||
{
|
|
||||||
if (png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (--png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "No space in chunk cache for tEXt");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
png_error(png_ptr, "Missing IHDR before tEXt");
|
png_error(png_ptr, "Missing IHDR before tEXt");
|
||||||
|
|
||||||
@@ -2117,23 +2007,6 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug(1, "in png_handle_zTXt");
|
png_debug(1, "in png_handle_zTXt");
|
||||||
|
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
if (png_ptr->user_chunk_cache_max != 0)
|
|
||||||
{
|
|
||||||
if (png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (--png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "No space in chunk cache for zTXt");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
png_error(png_ptr, "Missing IHDR before zTXt");
|
png_error(png_ptr, "Missing IHDR before zTXt");
|
||||||
|
|
||||||
@@ -2173,7 +2046,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Empty loop */ ;
|
/* Empty loop */ ;
|
||||||
|
|
||||||
/* zTXt must have some text after the chunkdataword */
|
/* zTXt must have some text after the chunkdataword */
|
||||||
if (slength < 2U || text >= png_ptr->chunkdata + slength - 2U)
|
if (text >= png_ptr->chunkdata + slength - 2)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Truncated zTXt chunk");
|
png_warning(png_ptr, "Truncated zTXt chunk");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
@@ -2238,23 +2111,6 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug(1, "in png_handle_iTXt");
|
png_debug(1, "in png_handle_iTXt");
|
||||||
|
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
if (png_ptr->user_chunk_cache_max != 0)
|
|
||||||
{
|
|
||||||
if (png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (--png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "No space in chunk cache for iTXt");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||||
png_error(png_ptr, "Missing IHDR before iTXt");
|
png_error(png_ptr, "Missing IHDR before iTXt");
|
||||||
|
|
||||||
@@ -2299,7 +2155,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
* keyword
|
* keyword
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (slength < 3U || lang >= png_ptr->chunkdata + slength - 3U)
|
if (lang >= png_ptr->chunkdata + slength - 3)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Truncated iTXt chunk");
|
png_warning(png_ptr, "Truncated iTXt chunk");
|
||||||
png_free(png_ptr, png_ptr->chunkdata);
|
png_free(png_ptr, png_ptr->chunkdata);
|
||||||
@@ -2382,23 +2238,6 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_debug(1, "in png_handle_unknown");
|
png_debug(1, "in png_handle_unknown");
|
||||||
|
|
||||||
#ifdef PNG_USER_LIMITS_SUPPORTED
|
|
||||||
if (png_ptr->user_chunk_cache_max != 0)
|
|
||||||
{
|
|
||||||
if (png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (--png_ptr->user_chunk_cache_max == 1)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "No space in chunk cache for unknown chunk");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (png_ptr->mode & PNG_HAVE_IDAT)
|
if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||||
{
|
{
|
||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
@@ -2439,8 +2278,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
||||||
(png_charp)png_ptr->chunk_name,
|
(png_charp)png_ptr->chunk_name,
|
||||||
png_sizeof(png_ptr->unknown_chunk.name));
|
png_sizeof(png_ptr->unknown_chunk.name));
|
||||||
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1]
|
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1] = '\0';
|
||||||
= '\0';
|
|
||||||
png_ptr->unknown_chunk.size = (png_size_t)length;
|
png_ptr->unknown_chunk.size = (png_size_t)length;
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
png_ptr->unknown_chunk.data = NULL;
|
png_ptr->unknown_chunk.data = NULL;
|
||||||
@@ -2483,7 +2321,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_crc_finish(png_ptr, skip);
|
png_crc_finish(png_ptr, skip);
|
||||||
|
|
||||||
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
|
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2732,9 +2570,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
png_uint_32 transformations = png_ptr->transformations;
|
png_uint_32 transformations = png_ptr->transformations;
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
/* Offset to next interlace block */
|
/* Offset to next interlace block */
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
#endif
|
|
||||||
|
|
||||||
png_debug(1, "in png_do_read_interlace");
|
png_debug(1, "in png_do_read_interlace");
|
||||||
if (row != NULL && row_info != NULL)
|
if (row != NULL && row_info != NULL)
|
||||||
@@ -2914,8 +2750,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
png_size_t pixel_bytes = (row_info->pixel_depth >> 3);
|
png_size_t pixel_bytes = (row_info->pixel_depth >> 3);
|
||||||
png_bytep sp = row + (png_size_t)(row_info->width - 1)
|
png_bytep sp = row + (png_size_t)(row_info->width - 1) * pixel_bytes;
|
||||||
* pixel_bytes;
|
|
||||||
png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
|
png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
|
||||||
|
|
||||||
int jstop = png_pass_inc[pass];
|
int jstop = png_pass_inc[pass];
|
||||||
@@ -2941,7 +2776,7 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
|
||||||
}
|
}
|
||||||
#ifndef PNG_READ_PACKSWAP_SUPPORTED
|
#ifndef PNG_READ_PACKSWAP_SUPPORTED
|
||||||
PNG_UNUSED(transformations) /* Silence compiler warning */
|
transformations = transformations; /* Silence compiler warning */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||||
@@ -3074,7 +2909,6 @@ void /* PRIVATE */
|
|||||||
png_read_finish_row(png_structp png_ptr)
|
png_read_finish_row(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* Start of interlace block */
|
/* Start of interlace block */
|
||||||
@@ -3088,7 +2922,6 @@ png_read_finish_row(png_structp png_ptr)
|
|||||||
|
|
||||||
/* Offset to next interlace block in the y direction */
|
/* Offset to next interlace block in the y direction */
|
||||||
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||||
#endif
|
|
||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||||
|
|
||||||
png_debug(1, "in png_read_finish_row");
|
png_debug(1, "in png_read_finish_row");
|
||||||
@@ -3112,6 +2945,9 @@ png_read_finish_row(png_structp png_ptr)
|
|||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
|
|
||||||
|
png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
|
||||||
|
png_ptr->iwidth) + 1;
|
||||||
|
|
||||||
if (!(png_ptr->transformations & PNG_INTERLACE))
|
if (!(png_ptr->transformations & PNG_INTERLACE))
|
||||||
{
|
{
|
||||||
png_ptr->num_rows = (png_ptr->height +
|
png_ptr->num_rows = (png_ptr->height +
|
||||||
@@ -3170,7 +3006,7 @@ png_read_finish_row(png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in ||
|
if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in ||
|
||||||
png_ptr->idat_size)
|
png_ptr->idat_size)
|
||||||
png_warning(png_ptr, "Extra compressed data.");
|
png_warning(png_ptr, "Extra compressed data");
|
||||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||||
break;
|
break;
|
||||||
@@ -3192,7 +3028,7 @@ png_read_finish_row(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (png_ptr->idat_size || png_ptr->zstream.avail_in)
|
if (png_ptr->idat_size || png_ptr->zstream.avail_in)
|
||||||
png_warning(png_ptr, "Extra compression data.");
|
png_warning(png_ptr, "Extra compression data");
|
||||||
|
|
||||||
inflateReset(&png_ptr->zstream);
|
inflateReset(&png_ptr->zstream);
|
||||||
|
|
||||||
@@ -3204,7 +3040,6 @@ void /* PRIVATE */
|
|||||||
png_read_start_row(png_structp png_ptr)
|
png_read_start_row(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* Start of interlace block */
|
/* Start of interlace block */
|
||||||
@@ -3218,7 +3053,6 @@ png_read_start_row(png_structp png_ptr)
|
|||||||
|
|
||||||
/* Offset to next interlace block in the y direction */
|
/* Offset to next interlace block in the y direction */
|
||||||
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int max_pixel_depth;
|
int max_pixel_depth;
|
||||||
@@ -3240,12 +3074,16 @@ png_read_start_row(png_structp png_ptr)
|
|||||||
png_pass_inc[png_ptr->pass] - 1 -
|
png_pass_inc[png_ptr->pass] - 1 -
|
||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
|
|
||||||
|
png_ptr->irowbytes =
|
||||||
|
PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||||
{
|
{
|
||||||
png_ptr->num_rows = png_ptr->height;
|
png_ptr->num_rows = png_ptr->height;
|
||||||
png_ptr->iwidth = png_ptr->width;
|
png_ptr->iwidth = png_ptr->width;
|
||||||
|
png_ptr->irowbytes = png_ptr->rowbytes + 1;
|
||||||
}
|
}
|
||||||
max_pixel_depth = png_ptr->pixel_depth;
|
max_pixel_depth = png_ptr->pixel_depth;
|
||||||
|
|
||||||
@@ -3367,14 +3205,9 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
|||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->big_row_buf);
|
png_free(png_ptr, png_ptr->big_row_buf);
|
||||||
if (png_ptr->interlaced)
|
if (png_ptr->interlaced)
|
||||||
png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr,
|
png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, row_bytes + 64);
|
||||||
row_bytes + 64);
|
|
||||||
else
|
else
|
||||||
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr,
|
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 64);
|
||||||
row_bytes + 64);
|
|
||||||
png_ptr->old_big_row_buf_size = row_bytes + 64;
|
|
||||||
|
|
||||||
/* Use 32 bytes of padding before and after row_buf. */
|
|
||||||
png_ptr->row_buf = png_ptr->big_row_buf + 32;
|
png_ptr->row_buf = png_ptr->big_row_buf + 32;
|
||||||
png_ptr->old_big_row_buf_size = row_bytes + 64;
|
png_ptr->old_big_row_buf_size = row_bytes + 64;
|
||||||
}
|
}
|
||||||
@@ -3402,8 +3235,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
|||||||
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
|
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
|
||||||
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
|
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
|
||||||
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
|
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
|
||||||
png_debug1(3, "irowbytes = %lu",
|
png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes);
|
||||||
PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
|
|
||||||
|
|
||||||
png_ptr->flags |= PNG_FLAG_ROW_INIT;
|
png_ptr->flags |= PNG_FLAG_ROW_INIT;
|
||||||
}
|
}
|
||||||
|
|||||||
100
pngset.c
100
pngset.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.54 [November 12, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||||
|
|
||||||
@@ -263,10 +262,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
- 1 /* filter byte */
|
- 1 /* filter byte */
|
||||||
- 7*8 /* rounding of width to multiple of 8 pixels */
|
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||||
- 8) /* extra max_pixel_depth pad */
|
- 8) /* extra max_pixel_depth pad */
|
||||||
{
|
|
||||||
info_ptr->rowbytes = (png_size_t)0;
|
info_ptr->rowbytes = (png_size_t)0;
|
||||||
png_error(png_ptr, "Image width is too large for this architecture");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
|
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
|
||||||
}
|
}
|
||||||
@@ -449,17 +445,12 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
|||||||
png_colorp palette, int num_palette)
|
png_colorp palette, int num_palette)
|
||||||
{
|
{
|
||||||
|
|
||||||
png_uint_32 max_palette_length;
|
|
||||||
|
|
||||||
png_debug1(1, "in %s storage function", "PLTE");
|
png_debug1(1, "in %s storage function", "PLTE");
|
||||||
|
|
||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
max_palette_length = (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
|
if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH)
|
||||||
(1 << info_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
|
|
||||||
|
|
||||||
if (num_palette < 0 || num_palette > (int) max_palette_length)
|
|
||||||
{
|
{
|
||||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
png_error(png_ptr, "Invalid palette length");
|
png_error(png_ptr, "Invalid palette length");
|
||||||
@@ -470,7 +461,8 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* It may not actually be necessary to set png_ptr->palette here;
|
/*
|
||||||
|
* It may not actually be necessary to set png_ptr->palette here;
|
||||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
* we do it for backward compatibility with the way the png_handle_tRNS
|
||||||
* function used to do the allocation.
|
* function used to do the allocation.
|
||||||
*/
|
*/
|
||||||
@@ -479,8 +471,8 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
|
/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
|
||||||
* of num_palette entries, in case of an invalid PNG file or incorrect
|
* of num_palette entries, in case of an invalid PNG file that has
|
||||||
* call to png_set_PLTE() with too-large sample values.
|
* too-large sample values.
|
||||||
*/
|
*/
|
||||||
png_ptr->palette = (png_colorp)png_calloc(png_ptr,
|
png_ptr->palette = (png_colorp)png_calloc(png_ptr,
|
||||||
PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
|
PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
|
||||||
@@ -541,10 +533,8 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
|
float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
|
||||||
#endif
|
#endif
|
||||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
|
||||||
png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
|
png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
|
||||||
int_green_y, int_blue_x, int_blue_y;
|
int_green_y, int_blue_x, int_blue_y;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM");
|
png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM");
|
||||||
|
|
||||||
@@ -565,7 +555,6 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_cHRM_SUPPORTED
|
#ifdef PNG_cHRM_SUPPORTED
|
||||||
# ifdef PNG_FIXED_POINT_SUPPORTED
|
|
||||||
int_white_x = 31270L;
|
int_white_x = 31270L;
|
||||||
int_white_y = 32900L;
|
int_white_y = 32900L;
|
||||||
int_red_x = 64000L;
|
int_red_x = 64000L;
|
||||||
@@ -574,12 +563,8 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
|
|||||||
int_green_y = 60000L;
|
int_green_y = 60000L;
|
||||||
int_blue_x = 15000L;
|
int_blue_x = 15000L;
|
||||||
int_blue_y = 6000L;
|
int_blue_y = 6000L;
|
||||||
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);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifdef PNG_FLOATING_POINT_SUPPORTED
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
white_x = (float).3127;
|
white_x = (float).3127;
|
||||||
white_y = (float).3290;
|
white_y = (float).3290;
|
||||||
red_x = (float).64;
|
red_x = (float).64;
|
||||||
@@ -588,9 +573,17 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
|
|||||||
green_y = (float).60;
|
green_y = (float).60;
|
||||||
blue_x = (float).15;
|
blue_x = (float).15;
|
||||||
blue_y = (float).06;
|
blue_y = (float).06;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||||
|
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);
|
||||||
|
#endif
|
||||||
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
png_set_cHRM(png_ptr, info_ptr,
|
png_set_cHRM(png_ptr, info_ptr,
|
||||||
white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
|
white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
|
||||||
# endif
|
#endif
|
||||||
#endif /* cHRM */
|
#endif /* cHRM */
|
||||||
}
|
}
|
||||||
#endif /* sRGB */
|
#endif /* sRGB */
|
||||||
@@ -635,8 +628,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
|||||||
info_ptr->iccp_name = new_iccp_name;
|
info_ptr->iccp_name = new_iccp_name;
|
||||||
info_ptr->iccp_profile = new_iccp_profile;
|
info_ptr->iccp_profile = new_iccp_profile;
|
||||||
/* Compression is always zero but is here so the API and info structure
|
/* Compression is always zero but is here so the API and info structure
|
||||||
* does not have to change if we introduce multiple compression types
|
* does not have to change if we introduce multiple compression types */
|
||||||
*/
|
|
||||||
info_ptr->iccp_compression = (png_byte)compression_type;
|
info_ptr->iccp_compression = (png_byte)compression_type;
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
info_ptr->free_me |= PNG_FREE_ICCP;
|
info_ptr->free_me |= PNG_FREE_ICCP;
|
||||||
@@ -674,26 +666,22 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
*/
|
*/
|
||||||
if (info_ptr->num_text + num_text > info_ptr->max_text)
|
if (info_ptr->num_text + num_text > info_ptr->max_text)
|
||||||
{
|
{
|
||||||
int old_max_text = info_ptr->max_text;
|
|
||||||
int old_num_text = info_ptr->num_text;
|
|
||||||
|
|
||||||
if (info_ptr->text != NULL)
|
if (info_ptr->text != NULL)
|
||||||
{
|
{
|
||||||
png_textp old_text;
|
png_textp old_text;
|
||||||
|
int old_max;
|
||||||
|
|
||||||
|
old_max = info_ptr->max_text;
|
||||||
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
||||||
old_text = info_ptr->text;
|
old_text = info_ptr->text;
|
||||||
|
|
||||||
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
||||||
if (info_ptr->text == NULL)
|
if (info_ptr->text == NULL)
|
||||||
{
|
{
|
||||||
/* Restore to previous condition */
|
png_free(png_ptr, old_text);
|
||||||
info_ptr->max_text = old_max_text;
|
|
||||||
info_ptr->text = old_text;
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text *
|
png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max *
|
||||||
png_sizeof(png_text)));
|
png_sizeof(png_text)));
|
||||||
png_free(png_ptr, old_text);
|
png_free(png_ptr, old_text);
|
||||||
}
|
}
|
||||||
@@ -704,12 +692,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
||||||
if (info_ptr->text == NULL)
|
if (info_ptr->text == NULL)
|
||||||
{
|
|
||||||
/* Restore to previous condition */
|
|
||||||
info_ptr->num_text = old_num_text;
|
|
||||||
info_ptr->max_text = old_max_text;
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
|
||||||
#ifdef PNG_FREE_ME_SUPPORTED
|
#ifdef PNG_FREE_ME_SUPPORTED
|
||||||
info_ptr->free_me |= PNG_FREE_TEXT;
|
info_ptr->free_me |= PNG_FREE_TEXT;
|
||||||
#endif
|
#endif
|
||||||
@@ -717,7 +700,6 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
png_debug1(3, "allocated %d entries for info_ptr->text",
|
png_debug1(3, "allocated %d entries for info_ptr->text",
|
||||||
info_ptr->max_text);
|
info_ptr->max_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_text; i++)
|
for (i = 0; i < num_text; i++)
|
||||||
{
|
{
|
||||||
png_size_t text_length, key_len;
|
png_size_t text_length, key_len;
|
||||||
@@ -778,10 +760,10 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
|||||||
(key_len + text_length + lang_len + lang_key_len + 4));
|
(key_len + text_length + lang_len + lang_key_len + 4));
|
||||||
if (textp->key == NULL)
|
if (textp->key == NULL)
|
||||||
return(1);
|
return(1);
|
||||||
png_debug2(2, "Allocated %lu bytes at %p in png_set_text",
|
png_debug2(2, "Allocated %lu bytes at %x in png_set_text",
|
||||||
(png_uint_32)
|
(png_uint_32)
|
||||||
(key_len + lang_len + lang_key_len + text_length + 4),
|
(key_len + lang_len + lang_key_len + text_length + 4),
|
||||||
textp->key);
|
(int)textp->key);
|
||||||
|
|
||||||
png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len));
|
png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len));
|
||||||
*(textp->key + key_len) = '\0';
|
*(textp->key + key_len) = '\0';
|
||||||
@@ -842,15 +824,6 @@ png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
|
|||||||
(png_ptr->mode & PNG_WROTE_tIME))
|
(png_ptr->mode & PNG_WROTE_tIME))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mod_time->month == 0 || mod_time->month > 12 ||
|
|
||||||
mod_time->day == 0 || mod_time->day > 31 ||
|
|
||||||
mod_time->hour > 23 || mod_time->minute > 59 ||
|
|
||||||
mod_time->second > 60)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Ignoring invalid time value");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time));
|
png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time));
|
||||||
info_ptr->valid |= PNG_INFO_tIME;
|
info_ptr->valid |= PNG_INFO_tIME;
|
||||||
}
|
}
|
||||||
@@ -866,12 +839,6 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
|||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (num_trans < 0 || num_trans > PNG_MAX_PALETTE_LENGTH)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Ignoring invalid num_trans value");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (trans != NULL)
|
if (trans != NULL)
|
||||||
{
|
{
|
||||||
/* It may not actually be necessary to set png_ptr->trans here;
|
/* It may not actually be necessary to set png_ptr->trans here;
|
||||||
@@ -992,7 +959,7 @@ png_set_sPLT(png_structp png_ptr,
|
|||||||
}
|
}
|
||||||
#endif /* PNG_sPLT_SUPPORTED */
|
#endif /* PNG_sPLT_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_unknown_chunks(png_structp png_ptr,
|
png_set_unknown_chunks(png_structp png_ptr,
|
||||||
png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
|
png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
|
||||||
@@ -1016,14 +983,15 @@ png_set_unknown_chunks(png_structp png_ptr,
|
|||||||
png_memcpy(np, info_ptr->unknown_chunks,
|
png_memcpy(np, info_ptr->unknown_chunks,
|
||||||
info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
|
info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
|
||||||
png_free(png_ptr, info_ptr->unknown_chunks);
|
png_free(png_ptr, info_ptr->unknown_chunks);
|
||||||
info_ptr->unknown_chunks = NULL;
|
info_ptr->unknown_chunks=NULL;
|
||||||
|
|
||||||
for (i = 0; i < num_unknowns; i++)
|
for (i = 0; i < num_unknowns; i++)
|
||||||
{
|
{
|
||||||
png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
|
png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
|
||||||
png_unknown_chunkp from = unknowns + i;
|
png_unknown_chunkp from = unknowns + i;
|
||||||
|
|
||||||
png_memcpy((png_charp)to->name, (png_charp)from->name,
|
png_memcpy((png_charp)to->name,
|
||||||
|
(png_charp)from->name,
|
||||||
png_sizeof(from->name));
|
png_sizeof(from->name));
|
||||||
to->name[png_sizeof(to->name)-1] = '\0';
|
to->name[png_sizeof(to->name)-1] = '\0';
|
||||||
to->size = from->size;
|
to->size = from->size;
|
||||||
@@ -1097,7 +1065,7 @@ png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
||||||
chunk_list, int num_chunks)
|
chunk_list, int num_chunks)
|
||||||
@@ -1176,6 +1144,7 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_compression_buffer_size(png_structp png_ptr,
|
png_set_compression_buffer_size(png_structp png_ptr,
|
||||||
png_uint_32 size)
|
png_uint_32 size)
|
||||||
@@ -1188,6 +1157,7 @@ png_set_compression_buffer_size(png_structp png_ptr,
|
|||||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
||||||
@@ -1206,7 +1176,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
|
|||||||
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
||||||
if (png_ptr != NULL)
|
if (png_ptr != NULL)
|
||||||
png_ptr->asm_flags = 0;
|
png_ptr->asm_flags = 0;
|
||||||
PNG_UNUSED(asm_flags) /* Quiet the compiler */
|
asm_flags = asm_flags; /* Quiet the compiler */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function was added to libpng 1.2.0 */
|
/* This function was added to libpng 1.2.0 */
|
||||||
@@ -1219,8 +1189,8 @@ png_set_mmx_thresholds (png_structp png_ptr,
|
|||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
/* Quiet the compiler */
|
/* Quiet the compiler */
|
||||||
PNG_UNUSED(mmx_bitdepth_threshold)
|
mmx_bitdepth_threshold = mmx_bitdepth_threshold;
|
||||||
PNG_UNUSED(mmx_rowbytes_threshold)
|
mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
||||||
}
|
}
|
||||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||||
|
|
||||||
@@ -1232,7 +1202,7 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
|
|||||||
{
|
{
|
||||||
/* Images with dimensions larger than these limits will be
|
/* Images with dimensions larger than these limits will be
|
||||||
* rejected by png_set_IHDR(). To accept any PNG datastream
|
* rejected by png_set_IHDR(). To accept any PNG datastream
|
||||||
* regardless of dimensions, set both limits to 0x7fffffffL.
|
* regardless of dimensions, set both limits to 0x7ffffffL.
|
||||||
*/
|
*/
|
||||||
if (png_ptr == NULL)
|
if (png_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
|
|||||||
100
pngtest.c
100
pngtest.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.54 [November 12, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
* of files at once by typing "pngtest -m file1.png file2.png ..."
|
* of files at once by typing "pngtest -m file1.png file2.png ..."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
@@ -312,17 +311,12 @@ static int wrote_question = 0;
|
|||||||
static void
|
static void
|
||||||
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||||
{
|
{
|
||||||
png_size_t check = 0;
|
png_size_t check;
|
||||||
png_voidp io_ptr;
|
|
||||||
|
|
||||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||||
* instead of an int, which is what fread() actually returns.
|
* instead of an int, which is what fread() actually returns.
|
||||||
*/
|
*/
|
||||||
io_ptr = png_get_io_ptr(png_ptr);
|
READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
|
||||||
if (io_ptr != NULL)
|
|
||||||
{
|
|
||||||
READFILE((png_FILE_p)io_ptr, data, length, check);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check != length)
|
if (check != length)
|
||||||
{
|
{
|
||||||
@@ -382,7 +376,7 @@ static void
|
|||||||
pngtest_flush(png_structp png_ptr)
|
pngtest_flush(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
/* Do nothing; fflush() is said to be just a waste of energy. */
|
/* Do nothing; fflush() is said to be just a waste of energy. */
|
||||||
PNG_UNUSED(png_ptr) /* Stifle compiler warning */
|
png_ptr = png_ptr; /* Stifle compiler warning */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -462,12 +456,9 @@ static void
|
|||||||
pngtest_warning(png_structp png_ptr, png_const_charp message)
|
pngtest_warning(png_structp png_ptr, png_const_charp message)
|
||||||
{
|
{
|
||||||
PNG_CONST char *name = "UNKNOWN (ERROR!)";
|
PNG_CONST char *name = "UNKNOWN (ERROR!)";
|
||||||
char *test;
|
if (png_ptr != NULL && png_ptr->error_ptr != NULL)
|
||||||
test = png_get_error_ptr(png_ptr);
|
name = png_ptr->error_ptr;
|
||||||
if (test == NULL)
|
|
||||||
fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
|
fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
|
||||||
else
|
|
||||||
fprintf(STDERR, "%s: libpng warning: %s\n", test, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the default error handling function. Note that replacements for
|
/* This is the default error handling function. Note that replacements for
|
||||||
@@ -557,7 +548,7 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
|||||||
/* Make sure the caller isn't assuming zeroed memory. */
|
/* Make sure the caller isn't assuming zeroed memory. */
|
||||||
png_memset(pinfo->pointer, 0xdd, pinfo->size);
|
png_memset(pinfo->pointer, 0xdd, pinfo->size);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("png_malloc %lu bytes at %p\n", (unsigned long)size,
|
printf("png_malloc %lu bytes at %x\n", (unsigned long)size,
|
||||||
pinfo->pointer);
|
pinfo->pointer);
|
||||||
return (png_voidp)(pinfo->pointer);
|
return (png_voidp)(pinfo->pointer);
|
||||||
}
|
}
|
||||||
@@ -578,7 +569,6 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Unlink the element from the list. */
|
/* Unlink the element from the list. */
|
||||||
if (pinformation != NULL)
|
|
||||||
{
|
{
|
||||||
memory_infop FAR *ppinfo = &pinformation;
|
memory_infop FAR *ppinfo = &pinformation;
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -599,7 +589,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
|
|||||||
}
|
}
|
||||||
if (pinfo->next == NULL)
|
if (pinfo->next == NULL)
|
||||||
{
|
{
|
||||||
fprintf(STDERR, "Pointer %p not found\n", ptr);
|
fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ppinfo = &pinfo->next;
|
ppinfo = &pinfo->next;
|
||||||
@@ -608,7 +598,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
|
|||||||
|
|
||||||
/* Finally free the data. */
|
/* Finally free the data. */
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("Freeing %p\n", ptr);
|
printf("Freeing %x\n", ptr);
|
||||||
png_free_default(png_ptr, ptr);
|
png_free_default(png_ptr, ptr);
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
}
|
}
|
||||||
@@ -720,8 +710,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
||||||
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0,
|
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||||
NULL)) == INVALID_HANDLE_VALUE)
|
|
||||||
#else
|
#else
|
||||||
if ((fpin = fopen(inname, "rb")) == NULL)
|
if ((fpin = fopen(inname, "rb")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
@@ -732,8 +721,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
||||||
if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||||
0, NULL)) == INVALID_HANDLE_VALUE)
|
|
||||||
#else
|
#else
|
||||||
if ((fpout = fopen(outname, "wb")) == NULL)
|
if ((fpout = fopen(outname, "wb")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
@@ -923,8 +911,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
{
|
{
|
||||||
png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x,
|
png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x,
|
||||||
blue_y;
|
blue_y;
|
||||||
if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y,
|
if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, &red_x,
|
||||||
&red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y))
|
&red_y, &green_x, &green_y, &blue_x, &blue_y))
|
||||||
{
|
{
|
||||||
png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x,
|
png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x,
|
||||||
red_y, green_x, green_y, blue_x, blue_y);
|
red_y, green_x, green_y, blue_x, blue_y);
|
||||||
@@ -1076,8 +1064,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width,
|
if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width,
|
||||||
&scal_height))
|
&scal_height))
|
||||||
{
|
{
|
||||||
png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width,
|
png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, scal_height);
|
||||||
scal_height);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1231,7 +1218,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
#ifndef SINGLE_ROWBUF_ALLOC
|
#ifndef SINGLE_ROWBUF_ALLOC
|
||||||
png_debug2(0, "Allocating row buffer (pass %d, y = %lu)...", pass, y);
|
png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y);
|
||||||
row_buf = (png_bytep)png_malloc(read_ptr,
|
row_buf = (png_bytep)png_malloc(read_ptr,
|
||||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||||
png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf,
|
png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf,
|
||||||
@@ -1254,7 +1241,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
#endif /* PNG_WRITE_SUPPORTED */
|
#endif /* PNG_WRITE_SUPPORTED */
|
||||||
|
|
||||||
#ifndef SINGLE_ROWBUF_ALLOC
|
#ifndef SINGLE_ROWBUF_ALLOC
|
||||||
png_debug2(0, "Freeing row buffer (pass %d, y = %lu)", pass, y);
|
png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y);
|
||||||
png_free(read_ptr, row_buf);
|
png_free(read_ptr, row_buf);
|
||||||
row_buf = NULL;
|
row_buf = NULL;
|
||||||
#endif /* !SINGLE_ROWBUF_ALLOC */
|
#endif /* !SINGLE_ROWBUF_ALLOC */
|
||||||
@@ -1361,8 +1348,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
png_debug(0, "Opening files for comparison");
|
png_debug(0, "Opening files for comparison");
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
||||||
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||||
0, NULL)) == INVALID_HANDLE_VALUE)
|
|
||||||
#else
|
#else
|
||||||
if ((fpin = fopen(inname, "rb")) == NULL)
|
if ((fpin = fopen(inname, "rb")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
@@ -1373,8 +1359,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
||||||
if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||||
0, NULL)) == INVALID_HANDLE_VALUE)
|
|
||||||
#else
|
#else
|
||||||
if ((fpout = fopen(outname, "rb")) == NULL)
|
if ((fpout = fopen(outname, "rb")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
@@ -1457,8 +1442,6 @@ main(int argc, char *argv[])
|
|||||||
int multiple = 0;
|
int multiple = 0;
|
||||||
int ierror = 0;
|
int ierror = 0;
|
||||||
|
|
||||||
png_structp dummy_ptr;
|
|
||||||
|
|
||||||
fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING);
|
fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING);
|
||||||
fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION);
|
fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION);
|
||||||
fprintf(STDERR, "%s", png_get_copyright(NULL));
|
fprintf(STDERR, "%s", png_get_copyright(NULL));
|
||||||
@@ -1544,14 +1527,14 @@ main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
for (i=2; i<argc; ++i)
|
for (i=2; i<argc; ++i)
|
||||||
{
|
{
|
||||||
|
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||||
|
int k;
|
||||||
|
#endif
|
||||||
int kerror;
|
int kerror;
|
||||||
fprintf(STDERR, "\n Testing %s:", argv[i]);
|
fprintf(STDERR, "\n Testing %s:", argv[i]);
|
||||||
kerror = test_one_file(argv[i], outname);
|
kerror = test_one_file(argv[i], outname);
|
||||||
if (kerror == 0)
|
if (kerror == 0)
|
||||||
{
|
{
|
||||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
|
||||||
int k;
|
|
||||||
#endif
|
|
||||||
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
||||||
fprintf(STDERR, "\n PASS (%lu zero samples)\n",
|
fprintf(STDERR, "\n PASS (%lu zero samples)\n",
|
||||||
(unsigned long)zero_samples);
|
(unsigned long)zero_samples);
|
||||||
@@ -1587,9 +1570,9 @@ main(int argc, char *argv[])
|
|||||||
current_allocation);
|
current_allocation);
|
||||||
while (pinfo != NULL)
|
while (pinfo != NULL)
|
||||||
{
|
{
|
||||||
fprintf(STDERR, " %lu bytes at %p\n",
|
fprintf(STDERR, " %lu bytes at %x\n",
|
||||||
(unsigned long)pinfo->size,
|
(unsigned long)pinfo->size,
|
||||||
pinfo->pointer);
|
(unsigned int) pinfo->pointer);
|
||||||
pinfo = pinfo->next;
|
pinfo = pinfo->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1637,7 +1620,8 @@ main(int argc, char *argv[])
|
|||||||
for (k = 0; k<256; k++)
|
for (k = 0; k<256; k++)
|
||||||
if (filters_used[k])
|
if (filters_used[k])
|
||||||
fprintf(STDERR, " Filter %d was used %lu times\n",
|
fprintf(STDERR, " Filter %d was used %lu times\n",
|
||||||
k, (unsigned long)filters_used[k]);
|
k,
|
||||||
|
(unsigned long)filters_used[k]);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PNG_TIME_RFC1123_SUPPORTED
|
#ifdef PNG_TIME_RFC1123_SUPPORTED
|
||||||
if (tIME_chunk_present != 0)
|
if (tIME_chunk_present != 0)
|
||||||
@@ -1664,8 +1648,8 @@ main(int argc, char *argv[])
|
|||||||
current_allocation);
|
current_allocation);
|
||||||
while (pinfo != NULL)
|
while (pinfo != NULL)
|
||||||
{
|
{
|
||||||
fprintf(STDERR, " %lu bytes at %p\n",
|
fprintf(STDERR, " %lu bytes at %x\n",
|
||||||
(unsigned long)pinfo->size, pinfo->pointer);
|
(unsigned long)pinfo->size, (unsigned int)pinfo->pointer);
|
||||||
pinfo = pinfo->next;
|
pinfo = pinfo->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1701,34 +1685,8 @@ main(int argc, char *argv[])
|
|||||||
fprintf(STDERR, " libpng passes test\n");
|
fprintf(STDERR, " libpng passes test\n");
|
||||||
else
|
else
|
||||||
fprintf(STDERR, " libpng FAILS test\n");
|
fprintf(STDERR, " libpng FAILS test\n");
|
||||||
|
|
||||||
dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
|
||||||
fprintf(STDERR, " Default limits:\n");
|
|
||||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
|
||||||
fprintf(STDERR, " width_max = %lu\n",
|
|
||||||
(unsigned long) png_get_user_width_max(dummy_ptr));
|
|
||||||
fprintf(STDERR, " height_max = %lu\n",
|
|
||||||
(unsigned long) png_get_user_height_max(dummy_ptr));
|
|
||||||
#else
|
|
||||||
fprintf(STDERR, " width_max = %lu\n",
|
|
||||||
(unsigned long) PNG_USER_WIDTH_MAX);
|
|
||||||
fprintf(STDERR, " height_max = %lu\n",
|
|
||||||
(unsigned long) PNG_USER_HEIGHT_MAX);
|
|
||||||
#endif /* PNG_SET_USER_LIMITS_SUPPORTED */
|
|
||||||
if (PNG_USER_CHUNK_CACHE_MAX == 0)
|
|
||||||
fprintf(STDERR, " cache_max = unlimited\n");
|
|
||||||
else
|
|
||||||
fprintf(STDERR, " cache_max = %lu\n",
|
|
||||||
(unsigned long) PNG_USER_CHUNK_CACHE_MAX);
|
|
||||||
if (PNG_USER_CHUNK_MALLOC_MAX == 0)
|
|
||||||
fprintf(STDERR, " malloc_max = unlimited\n");
|
|
||||||
else
|
|
||||||
fprintf(STDERR, " malloc_max = %lu\n",
|
|
||||||
(unsigned long) PNG_USER_CHUNK_MALLOC_MAX);
|
|
||||||
png_destroy_read_struct(&dummy_ptr, NULL, NULL);
|
|
||||||
|
|
||||||
return (int)(ierror != 0);
|
return (int)(ierror != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_0_65 your_png_h_is_not_version_1_0_65;
|
typedef version_1_2_41beta17 your_png_h_is_not_version_1_2_41beta17;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.41 [December 3, 2009]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||||
|
|
||||||
|
|||||||
13
pngvcrd.c
13
pngvcrd.c
@@ -1,12 +1 @@
|
|||||||
/* pngvcrd.c
|
/* pnggvrd.c was removed from libpng-1.2.20. */
|
||||||
*
|
|
||||||
* Last changed in libpng 1.2.48 [March 8, 2012]
|
|
||||||
* Copyright (c) 1998-2012 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
|
|
||||||
*
|
|
||||||
* This nearly empty file is for use by configure's compilation test. The
|
|
||||||
* remainder of the file was removed from libpng-1.2.20.
|
|
||||||
*/
|
|
||||||
|
|||||||
5
pngwio.c
5
pngwio.c
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.41 [December 3, 2009]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
|
|
||||||
@@ -174,7 +173,7 @@ png_default_flush(png_structp png_ptr)
|
|||||||
* arguments a pointer to a png_struct. After a call to
|
* arguments a pointer to a png_struct. After a call to
|
||||||
* the flush function, there should be no data in any buffers
|
* the flush function, there should be no data in any buffers
|
||||||
* or pending transmission. If the output method doesn't do
|
* or pending transmission. If the output method doesn't do
|
||||||
* any buffering of output, a function prototype must still be
|
* any buffering of ouput, a function prototype must still be
|
||||||
* supplied although it doesn't have to do anything. If
|
* supplied although it doesn't have to do anything. If
|
||||||
* PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile
|
* PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile
|
||||||
* time, output_flush_fn will be ignored, although it must be
|
* time, output_flush_fn will be ignored, although it must be
|
||||||
|
|||||||
201
pngwrite.c
201
pngwrite.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.54 [November 12, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
/* Get internal access to png.h */
|
/* Get internal access to png.h */
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
|
|
||||||
@@ -38,8 +37,7 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
|
|||||||
/* Write PNG signature */
|
/* Write PNG signature */
|
||||||
png_write_sig(png_ptr);
|
png_write_sig(png_ptr);
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||||
if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) && \
|
if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted))
|
||||||
(png_ptr->mng_features_permitted))
|
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
|
png_warning(png_ptr, "MNG features are not allowed in a PNG datastream");
|
||||||
png_ptr->mng_features_permitted = 0;
|
png_ptr->mng_features_permitted = 0;
|
||||||
@@ -295,7 +293,6 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
|
|||||||
if (keep != PNG_HANDLE_CHUNK_NEVER &&
|
if (keep != PNG_HANDLE_CHUNK_NEVER &&
|
||||||
up->location && (up->location & PNG_HAVE_PLTE) &&
|
up->location && (up->location & PNG_HAVE_PLTE) &&
|
||||||
!(up->location & PNG_HAVE_IDAT) &&
|
!(up->location & PNG_HAVE_IDAT) &&
|
||||||
!(up->location & PNG_AFTER_IDAT) &&
|
|
||||||
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
||||||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
|
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
|
||||||
{
|
{
|
||||||
@@ -417,12 +414,12 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
|
|||||||
* do not set png_ptr->output_flush_fn to crash. If your application
|
* do not set png_ptr->output_flush_fn to crash. If your application
|
||||||
* experiences a problem, please try building libpng with
|
* experiences a problem, please try building libpng with
|
||||||
* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to
|
* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to
|
||||||
* png-mng-implement at lists.sf.net .
|
* png-mng-implement at lists.sf.net . This kludge will be removed
|
||||||
|
* from libpng-1.4.0.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
#if defined(PNG_WRITE_FLUSH_SUPPORTED) && \
|
||||||
# ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED
|
defined(PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED)
|
||||||
png_flush(png_ptr);
|
png_flush(png_ptr);
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,23 +522,15 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||||
png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
|
png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
|
||||||
|
|
||||||
if (user_png_ver != NULL)
|
if (user_png_ver)
|
||||||
{
|
{
|
||||||
int found_dots = 0;
|
i = 0;
|
||||||
i = -1;
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
i++;
|
if (user_png_ver[i] != png_libpng_ver[i])
|
||||||
if (user_png_ver[i] != PNG_LIBPNG_VER_STRING[i])
|
|
||||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||||
if (user_png_ver[i] == '.')
|
} while (png_libpng_ver[i++]);
|
||||||
found_dots++;
|
|
||||||
} while (found_dots < 2 && user_png_ver[i] != 0 &&
|
|
||||||
PNG_LIBPNG_VER_STRING[i] != 0);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
|
||||||
|
|
||||||
if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
|
if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
|
||||||
{
|
{
|
||||||
@@ -584,6 +573,11 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
||||||
png_flush_ptr_NULL);
|
png_flush_ptr_NULL);
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||||
|
1, png_doublep_NULL, png_doublep_NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
/* Applications that neglect to set up their own setjmp() and then
|
/* Applications that neglect to set up their own setjmp() and then
|
||||||
* encounter a png_error() will longjmp here. Since the jmpbuf is
|
* encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||||
@@ -644,8 +638,7 @@ png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
|||||||
png_ptr->flags = 0;
|
png_ptr->flags = 0;
|
||||||
#endif
|
#endif
|
||||||
png_error(png_ptr,
|
png_error(png_ptr,
|
||||||
"The png struct allocated by the application for writing is"
|
"The png struct allocated by the application for writing is too small.");
|
||||||
" too small.");
|
|
||||||
}
|
}
|
||||||
if (png_sizeof(png_info) > png_info_size)
|
if (png_sizeof(png_info) > png_info_size)
|
||||||
{
|
{
|
||||||
@@ -654,8 +647,7 @@ png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
|||||||
png_ptr->flags = 0;
|
png_ptr->flags = 0;
|
||||||
#endif
|
#endif
|
||||||
png_error(png_ptr,
|
png_error(png_ptr,
|
||||||
"The info struct allocated by the application for writing is"
|
"The info struct allocated by the application for writing is too small.");
|
||||||
" too small.");
|
|
||||||
}
|
}
|
||||||
png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
|
png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
|
||||||
}
|
}
|
||||||
@@ -688,8 +680,7 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
"Application uses deprecated png_write_init() and should be recompiled.");
|
"Application uses deprecated png_write_init() and should be recompiled.");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
i++;
|
} while (png_libpng_ver[i++]);
|
||||||
} while (png_libpng_ver[i] != 0 && user_png_ver[i] != 0);
|
|
||||||
|
|
||||||
png_debug(1, "in png_write_init_3");
|
png_debug(1, "in png_write_init_3");
|
||||||
|
|
||||||
@@ -726,6 +717,10 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)png_ptr->zbuf_size);
|
(png_uint_32)png_ptr->zbuf_size);
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||||
|
1, png_doublep_NULL, png_doublep_NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a few rows of image data. If the image is interlaced,
|
/* Write a few rows of image data. If the image is interlaced,
|
||||||
@@ -807,19 +802,15 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
|||||||
/* Check for transforms that have been set but were defined out */
|
/* Check for transforms that have been set but were defined out */
|
||||||
#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
|
#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
|
||||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined.");
|
||||||
"PNG_WRITE_INVERT_SUPPORTED is not defined.");
|
|
||||||
#endif
|
#endif
|
||||||
#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED)
|
#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED)
|
||||||
if (png_ptr->transformations & PNG_FILLER)
|
if (png_ptr->transformations & PNG_FILLER)
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined.");
|
||||||
"PNG_WRITE_FILLER_SUPPORTED is not defined.");
|
|
||||||
#endif
|
#endif
|
||||||
#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \
|
#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||||
defined(PNG_READ_PACKSWAP_SUPPORTED)
|
|
||||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
|
||||||
"PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
|
|
||||||
#endif
|
#endif
|
||||||
#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED)
|
#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED)
|
||||||
if (png_ptr->transformations & PNG_PACK)
|
if (png_ptr->transformations & PNG_PACK)
|
||||||
@@ -1074,7 +1065,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
|
|||||||
{
|
{
|
||||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
|
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
|
||||||
|
|
||||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
if (png_ptr->num_chunk_list)
|
if (png_ptr->num_chunk_list)
|
||||||
{
|
{
|
||||||
png_free(png_ptr, png_ptr->chunk_list);
|
png_free(png_ptr, png_ptr->chunk_list);
|
||||||
@@ -1141,6 +1132,14 @@ png_write_destroy(png_structp png_ptr)
|
|||||||
png_free(png_ptr, png_ptr->time_buffer);
|
png_free(png_ptr, png_ptr->time_buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
png_free(png_ptr, png_ptr->prev_filters);
|
||||||
|
png_free(png_ptr, png_ptr->filter_weights);
|
||||||
|
png_free(png_ptr, png_ptr->inv_filter_weights);
|
||||||
|
png_free(png_ptr, png_ptr->filter_costs);
|
||||||
|
png_free(png_ptr, png_ptr->inv_filter_costs);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
/* Reset structure */
|
/* Reset structure */
|
||||||
png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
||||||
@@ -1184,13 +1183,14 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
|||||||
{
|
{
|
||||||
switch (filters & (PNG_ALL_FILTERS | 0x07))
|
switch (filters & (PNG_ALL_FILTERS | 0x07))
|
||||||
{
|
{
|
||||||
case PNG_FILTER_VALUE_NONE:
|
|
||||||
png_ptr->do_filter = PNG_FILTER_NONE; break;
|
|
||||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
case 7: png_warning(png_ptr, "Unknown row filter for method 0");
|
case 7: png_warning(png_ptr, "Unknown row filter for method 0");
|
||||||
break;
|
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||||
|
case PNG_FILTER_VALUE_NONE:
|
||||||
|
png_ptr->do_filter = PNG_FILTER_NONE; break;
|
||||||
|
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||||
case PNG_FILTER_VALUE_SUB:
|
case PNG_FILTER_VALUE_SUB:
|
||||||
png_ptr->do_filter = PNG_FILTER_SUB; break;
|
png_ptr->do_filter = PNG_FILTER_SUB; break;
|
||||||
case PNG_FILTER_VALUE_UP:
|
case PNG_FILTER_VALUE_UP:
|
||||||
@@ -1202,7 +1202,6 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
|||||||
default: png_ptr->do_filter = (png_byte)filters; break;
|
default: png_ptr->do_filter = (png_byte)filters; break;
|
||||||
#else
|
#else
|
||||||
default: png_warning(png_ptr, "Unknown row filter for method 0");
|
default: png_warning(png_ptr, "Unknown row filter for method 0");
|
||||||
break;
|
|
||||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1293,11 +1292,117 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
|
|||||||
int num_weights, png_doublep filter_weights,
|
int num_weights, png_doublep filter_weights,
|
||||||
png_doublep filter_costs)
|
png_doublep filter_costs)
|
||||||
{
|
{
|
||||||
PNG_UNUSED(png_ptr)
|
int i;
|
||||||
PNG_UNUSED(heuristic_method)
|
|
||||||
PNG_UNUSED(num_weights)
|
png_debug(1, "in png_set_filter_heuristics");
|
||||||
PNG_UNUSED(filter_weights)
|
|
||||||
PNG_UNUSED(filter_costs)
|
if (png_ptr == NULL)
|
||||||
|
return;
|
||||||
|
if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Unknown filter heuristic method");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT)
|
||||||
|
{
|
||||||
|
heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num_weights < 0 || filter_weights == NULL ||
|
||||||
|
heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED)
|
||||||
|
{
|
||||||
|
num_weights = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_ptr->num_prev_filters = (png_byte)num_weights;
|
||||||
|
png_ptr->heuristic_method = (png_byte)heuristic_method;
|
||||||
|
|
||||||
|
if (num_weights > 0)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters == NULL)
|
||||||
|
{
|
||||||
|
png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_sizeof(png_byte) * num_weights));
|
||||||
|
|
||||||
|
/* To make sure that the weighting starts out fairly */
|
||||||
|
for (i = 0; i < num_weights; i++)
|
||||||
|
{
|
||||||
|
png_ptr->prev_filters[i] = 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (png_ptr->filter_weights == NULL)
|
||||||
|
{
|
||||||
|
png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_sizeof(png_uint_16) * num_weights));
|
||||||
|
|
||||||
|
png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_sizeof(png_uint_16) * num_weights));
|
||||||
|
for (i = 0; i < num_weights; i++)
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_weights[i] =
|
||||||
|
png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < num_weights; i++)
|
||||||
|
{
|
||||||
|
if (filter_weights[i] < 0.0)
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_weights[i] =
|
||||||
|
png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_weights[i] =
|
||||||
|
(png_uint_16)((double)PNG_WEIGHT_FACTOR*filter_weights[i]+0.5);
|
||||||
|
png_ptr->filter_weights[i] =
|
||||||
|
(png_uint_16)((double)PNG_WEIGHT_FACTOR/filter_weights[i]+0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If, in the future, there are other filter methods, this would
|
||||||
|
* need to be based on png_ptr->filter.
|
||||||
|
*/
|
||||||
|
if (png_ptr->filter_costs == NULL)
|
||||||
|
{
|
||||||
|
png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
|
||||||
|
|
||||||
|
png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr,
|
||||||
|
(png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST));
|
||||||
|
|
||||||
|
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_costs[i] =
|
||||||
|
png_ptr->filter_costs[i] = PNG_COST_FACTOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Here is where we set the relative costs of the different filters. We
|
||||||
|
* should take the desired compression level into account when setting
|
||||||
|
* the costs, so that Paeth, for instance, has a high relative cost at low
|
||||||
|
* compression levels, while it has a lower relative cost at higher
|
||||||
|
* compression settings. The filter types are in order of increasing
|
||||||
|
* relative cost, so it would be possible to do this with an algorithm.
|
||||||
|
*/
|
||||||
|
for (i = 0; i < PNG_FILTER_VALUE_LAST; i++)
|
||||||
|
{
|
||||||
|
if (filter_costs == NULL || filter_costs[i] < 0.0)
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_costs[i] =
|
||||||
|
png_ptr->filter_costs[i] = PNG_COST_FACTOR;
|
||||||
|
}
|
||||||
|
else if (filter_costs[i] >= 1.0)
|
||||||
|
{
|
||||||
|
png_ptr->inv_filter_costs[i] =
|
||||||
|
(png_uint_16)((double)PNG_COST_FACTOR / filter_costs[i] + 0.5);
|
||||||
|
png_ptr->filter_costs[i] =
|
||||||
|
(png_uint_16)((double)PNG_COST_FACTOR * filter_costs[i] + 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
|
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
|
||||||
|
|
||||||
@@ -1472,8 +1577,8 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
/* It is REQUIRED to call this to finish writing the rest of the file */
|
/* It is REQUIRED to call this to finish writing the rest of the file */
|
||||||
png_write_end(png_ptr, info_ptr);
|
png_write_end(png_ptr, info_ptr);
|
||||||
|
|
||||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
transforms = transforms; /* Quiet compiler warnings */
|
||||||
PNG_UNUSED(params)
|
params = params;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* PNG_WRITE_SUPPORTED */
|
#endif /* PNG_WRITE_SUPPORTED */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.43 [February 25, 2010]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
|
|
||||||
@@ -30,8 +29,7 @@ png_do_write_transformations(png_structp png_ptr)
|
|||||||
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
||||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||||
if (png_ptr->write_user_transform_fn != NULL)
|
if (png_ptr->write_user_transform_fn != NULL)
|
||||||
(*(png_ptr->write_user_transform_fn)) /* User write transform
|
(*(png_ptr->write_user_transform_fn)) /* User write transform function */
|
||||||
function */
|
|
||||||
(png_ptr, /* png_ptr */
|
(png_ptr, /* png_ptr */
|
||||||
&(png_ptr->row_info), /* row_info: */
|
&(png_ptr->row_info), /* row_info: */
|
||||||
/* png_uint_32 width; width of row */
|
/* png_uint_32 width; width of row */
|
||||||
|
|||||||
346
pngwutil.c
346
pngwutil.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwutil.c - utilities to write a PNG file
|
/* pngwutil.c - utilities to write a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.2.54 [November 12, 2015]
|
* Last changed in libpng 1.2.41 [November 10, 2009]
|
||||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
#define PNG_NO_PEDANTIC_WARNINGS
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
|
|
||||||
@@ -59,7 +58,7 @@ png_save_uint_16(png_bytep buf, unsigned int i)
|
|||||||
* we should call png_set_sig_bytes() to tell libpng how many of the
|
* we should call png_set_sig_bytes() to tell libpng how many of the
|
||||||
* bytes have already been written.
|
* bytes have already been written.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
void PNGAPI
|
||||||
png_write_sig(png_structp png_ptr)
|
png_write_sig(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||||
@@ -254,7 +253,7 @@ png_text_compress(png_structp png_ptr,
|
|||||||
old_ptr = comp->output_ptr;
|
old_ptr = comp->output_ptr;
|
||||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||||
(png_uint_32)
|
(png_uint_32)
|
||||||
(comp->max_output_ptr * png_sizeof(png_charp)));
|
(comp->max_output_ptr * png_sizeof(png_charpp)));
|
||||||
png_memcpy(comp->output_ptr, old_ptr, old_max
|
png_memcpy(comp->output_ptr, old_ptr, old_max
|
||||||
* png_sizeof(png_charp));
|
* png_sizeof(png_charp));
|
||||||
png_free(png_ptr, old_ptr);
|
png_free(png_ptr, old_ptr);
|
||||||
@@ -413,8 +412,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
|||||||
case 4:
|
case 4:
|
||||||
case 8:
|
case 8:
|
||||||
case 16: png_ptr->channels = 1; break;
|
case 16: png_ptr->channels = 1; break;
|
||||||
default: png_error(png_ptr,
|
default: png_error(png_ptr, "Invalid bit depth for grayscale image");
|
||||||
"Invalid bit depth for grayscale image");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PNG_COLOR_TYPE_RGB:
|
case PNG_COLOR_TYPE_RGB:
|
||||||
@@ -575,20 +573,17 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
|||||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||||
PNG_PLTE;
|
PNG_PLTE;
|
||||||
#endif
|
#endif
|
||||||
png_uint_32 max_palette_length, i;
|
png_uint_32 i;
|
||||||
png_colorp pal_ptr;
|
png_colorp pal_ptr;
|
||||||
png_byte buf[3];
|
png_byte buf[3];
|
||||||
|
|
||||||
png_debug(1, "in png_write_PLTE");
|
png_debug(1, "in png_write_PLTE");
|
||||||
|
|
||||||
max_palette_length = (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ?
|
|
||||||
(1 << png_ptr->bit_depth) : PNG_MAX_PALETTE_LENGTH;
|
|
||||||
|
|
||||||
if ((
|
if ((
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||||
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
|
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
|
||||||
#endif
|
#endif
|
||||||
num_pal == 0) || num_pal > max_palette_length)
|
num_pal == 0) || num_pal > 256)
|
||||||
{
|
{
|
||||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
{
|
{
|
||||||
@@ -622,9 +617,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
|||||||
png_write_chunk_data(png_ptr, buf, (png_size_t)3);
|
png_write_chunk_data(png_ptr, buf, (png_size_t)3);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* This is a little slower but some buggy compilers need to do this
|
/* This is a little slower but some buggy compilers need to do this instead */
|
||||||
* instead
|
|
||||||
*/
|
|
||||||
pal_ptr=palette;
|
pal_ptr=palette;
|
||||||
for (i = 0; i < num_pal; i++)
|
for (i = 0; i < num_pal; i++)
|
||||||
{
|
{
|
||||||
@@ -1646,8 +1639,7 @@ png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
|
|||||||
size_t wc_len;
|
size_t wc_len;
|
||||||
swprintf(wc_buf, TEXT("%12.12e"), width);
|
swprintf(wc_buf, TEXT("%12.12e"), width);
|
||||||
wc_len = wcslen(wc_buf);
|
wc_len = wcslen(wc_buf);
|
||||||
WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL,
|
WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL, NULL);
|
||||||
NULL);
|
|
||||||
total_len = wc_len + 2;
|
total_len = wc_len + 2;
|
||||||
swprintf(wc_buf, TEXT("%12.12e"), height);
|
swprintf(wc_buf, TEXT("%12.12e"), height);
|
||||||
wc_len = wcslen(wc_buf);
|
wc_len = wcslen(wc_buf);
|
||||||
@@ -1762,7 +1754,6 @@ void /* PRIVATE */
|
|||||||
png_write_start_row(png_structp png_ptr)
|
png_write_start_row(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* Start of interlace block */
|
/* Start of interlace block */
|
||||||
@@ -1776,7 +1767,6 @@ png_write_start_row(png_structp png_ptr)
|
|||||||
|
|
||||||
/* Offset to next interlace block in the y direction */
|
/* Offset to next interlace block in the y direction */
|
||||||
int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
png_size_t buf_size;
|
png_size_t buf_size;
|
||||||
@@ -1862,7 +1852,6 @@ void /* PRIVATE */
|
|||||||
png_write_finish_row(png_structp png_ptr)
|
png_write_finish_row(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* Start of interlace block */
|
/* Start of interlace block */
|
||||||
@@ -1876,7 +1865,6 @@ png_write_finish_row(png_structp png_ptr)
|
|||||||
|
|
||||||
/* Offset to next interlace block in the y direction */
|
/* Offset to next interlace block in the y direction */
|
||||||
int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
@@ -1983,13 +1971,11 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
|||||||
{
|
{
|
||||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
#ifndef PNG_USE_GLOBAL_ARRAYS
|
|
||||||
/* Start of interlace block */
|
/* Start of interlace block */
|
||||||
int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0};
|
||||||
|
|
||||||
/* Offset to next interlace block */
|
/* Offset to next interlace block */
|
||||||
int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
#endif
|
|
||||||
|
|
||||||
png_debug(1, "in png_do_write_interlace");
|
png_debug(1, "in png_do_write_interlace");
|
||||||
|
|
||||||
@@ -2159,9 +2145,20 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
png_uint_32 mins, bpp;
|
png_uint_32 mins, bpp;
|
||||||
png_byte filter_to_do = png_ptr->do_filter;
|
png_byte filter_to_do = png_ptr->do_filter;
|
||||||
png_uint_32 row_bytes = row_info->rowbytes;
|
png_uint_32 row_bytes = row_info->rowbytes;
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
int num_p_filters = (int)png_ptr->num_prev_filters;
|
||||||
|
#endif
|
||||||
|
|
||||||
png_debug(1, "in png_write_find_filter");
|
png_debug(1, "in png_write_find_filter");
|
||||||
|
|
||||||
|
#ifndef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->row_number == 0 && filter_to_do == PNG_ALL_FILTERS)
|
||||||
|
{
|
||||||
|
/* These will never be selected so we need not test them. */
|
||||||
|
filter_to_do &= ~(PNG_FILTER_UP | PNG_FILTER_PAETH);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Find out how many bytes offset each pixel is */
|
/* Find out how many bytes offset each pixel is */
|
||||||
bpp = (row_info->pixel_depth + 7) >> 3;
|
bpp = (row_info->pixel_depth + 7) >> 3;
|
||||||
|
|
||||||
@@ -2211,6 +2208,41 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
sum += (v < 128) ? v : 256 - v;
|
sum += (v < 128) ? v : 256 - v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
png_uint_32 sumhi, sumlo;
|
||||||
|
int j;
|
||||||
|
sumlo = sum & PNG_LOMASK;
|
||||||
|
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */
|
||||||
|
|
||||||
|
/* Reduce the sum if we match any of the previous rows */
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
|
||||||
|
{
|
||||||
|
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Factor in the cost of this filter (this is here for completeness,
|
||||||
|
* but it makes no sense to have a "cost" for the NONE filter, as
|
||||||
|
* it has the minimum possible computational cost - none).
|
||||||
|
*/
|
||||||
|
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (sumhi > PNG_HIMASK)
|
||||||
|
sum = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
sum = (sumhi << PNG_HISHIFT) + sumlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
mins = sum;
|
mins = sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2240,6 +2272,41 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
/* We temporarily increase the "minimum sum" by the factor we
|
||||||
|
* would reduce the sum of this filter, so that we can do the
|
||||||
|
* early exit comparison without scaling the sum each time.
|
||||||
|
*/
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 lmhi, lmlo;
|
||||||
|
lmlo = lmins & PNG_LOMASK;
|
||||||
|
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
|
||||||
|
{
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (lmhi > PNG_HIMASK)
|
||||||
|
lmins = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
lmins = (lmhi << PNG_HISHIFT) + lmlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;
|
for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp;
|
||||||
i++, rp++, dp++)
|
i++, rp++, dp++)
|
||||||
{
|
{
|
||||||
@@ -2258,6 +2325,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 sumhi, sumlo;
|
||||||
|
sumlo = sum & PNG_LOMASK;
|
||||||
|
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB)
|
||||||
|
{
|
||||||
|
sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (sumhi > PNG_HIMASK)
|
||||||
|
sum = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
sum = (sumhi << PNG_HISHIFT) + sumlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sum < mins)
|
if (sum < mins)
|
||||||
{
|
{
|
||||||
mins = sum;
|
mins = sum;
|
||||||
@@ -2287,6 +2385,38 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 lmhi, lmlo;
|
||||||
|
lmlo = lmins & PNG_LOMASK;
|
||||||
|
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
|
||||||
|
{
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (lmhi > PNG_HIMASK)
|
||||||
|
lmins = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
lmins = (lmhi << PNG_HISHIFT) + lmlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
|
for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1,
|
||||||
pp = prev_row + 1; i < row_bytes; i++)
|
pp = prev_row + 1; i < row_bytes; i++)
|
||||||
{
|
{
|
||||||
@@ -2298,6 +2428,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 sumhi, sumlo;
|
||||||
|
sumlo = sum & PNG_LOMASK;
|
||||||
|
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP)
|
||||||
|
{
|
||||||
|
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (sumhi > PNG_HIMASK)
|
||||||
|
sum = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
sum = (sumhi << PNG_HISHIFT) + sumlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sum < mins)
|
if (sum < mins)
|
||||||
{
|
{
|
||||||
mins = sum;
|
mins = sum;
|
||||||
@@ -2330,6 +2491,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 lmhi, lmlo;
|
||||||
|
lmlo = lmins & PNG_LOMASK;
|
||||||
|
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG)
|
||||||
|
{
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (lmhi > PNG_HIMASK)
|
||||||
|
lmins = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
lmins = (lmhi << PNG_HISHIFT) + lmlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
|
for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1,
|
||||||
pp = prev_row + 1; i < bpp; i++)
|
pp = prev_row + 1; i < bpp; i++)
|
||||||
{
|
{
|
||||||
@@ -2348,6 +2540,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 sumhi, sumlo;
|
||||||
|
sumlo = sum & PNG_LOMASK;
|
||||||
|
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE)
|
||||||
|
{
|
||||||
|
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (sumhi > PNG_HIMASK)
|
||||||
|
sum = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
sum = (sumhi << PNG_HISHIFT) + sumlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sum < mins)
|
if (sum < mins)
|
||||||
{
|
{
|
||||||
mins = sum;
|
mins = sum;
|
||||||
@@ -2401,6 +2624,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 lmhi, lmlo;
|
||||||
|
lmlo = lmins & PNG_LOMASK;
|
||||||
|
lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
|
||||||
|
{
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (lmhi > PNG_HIMASK)
|
||||||
|
lmins = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
lmins = (lmhi << PNG_HISHIFT) + lmlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
|
for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1,
|
||||||
pp = prev_row + 1; i < bpp; i++)
|
pp = prev_row + 1; i < bpp; i++)
|
||||||
{
|
{
|
||||||
@@ -2451,6 +2705,37 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
png_uint_32 sumhi, sumlo;
|
||||||
|
sumlo = sum & PNG_LOMASK;
|
||||||
|
sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK;
|
||||||
|
|
||||||
|
for (j = 0; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH)
|
||||||
|
{
|
||||||
|
sumlo = (sumlo * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_weights[j]) >>
|
||||||
|
PNG_WEIGHT_SHIFT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >>
|
||||||
|
PNG_COST_SHIFT;
|
||||||
|
|
||||||
|
if (sumhi > PNG_HIMASK)
|
||||||
|
sum = PNG_MAXSUM;
|
||||||
|
else
|
||||||
|
sum = (sumhi << PNG_HISHIFT) + sumlo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sum < mins)
|
if (sum < mins)
|
||||||
{
|
{
|
||||||
best_row = png_ptr->paeth_row;
|
best_row = png_ptr->paeth_row;
|
||||||
@@ -2460,6 +2745,21 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
/* Do the actual writing of the filtered row data from the chosen filter. */
|
/* Do the actual writing of the filtered row data from the chosen filter. */
|
||||||
|
|
||||||
png_write_filtered_row(png_ptr, best_row);
|
png_write_filtered_row(png_ptr, best_row);
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||||
|
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
|
/* Save the type of filter we picked this time for future calculations */
|
||||||
|
if (png_ptr->num_prev_filters > 0)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
for (j = 1; j < num_p_filters; j++)
|
||||||
|
{
|
||||||
|
png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1];
|
||||||
|
}
|
||||||
|
png_ptr->prev_filters[j] = best_row[0];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ Copyright (C) 2000-2004 Simon-Pierre Cadieux.
|
|||||||
Copyright (C) 2004 Cosmin Truta.
|
Copyright (C) 2004 Cosmin Truta.
|
||||||
For conditions of distribution and use, see copyright notice in png.h
|
For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
||||||
|
|
||||||
Assumptions:
|
Assumptions:
|
||||||
* The libpng source files are in ..\..
|
* The libpng source files are in ..\..
|
||||||
* The zlib source files are in ..\..\..\zlib
|
* The zlib source files are in ..\..\..\zlib
|
||||||
* The zlib project files are in ..\..\..\zlib\projects\visualc6
|
* The zlib project files are in ..\..\..\zlib\projects\visualc6
|
||||||
|
|
||||||
|
|
||||||
To use:
|
To use:
|
||||||
|
|
||||||
1) On the main menu, select "File | Open Workspace".
|
1) On the main menu, select "File | Open Workspace".
|
||||||
@@ -26,18 +28,20 @@ To use:
|
|||||||
5) If you built the sample program (pngtest),
|
5) If you built the sample program (pngtest),
|
||||||
select "Build | Execute ... (Ctrl+F5)".
|
select "Build | Execute ... (Ctrl+F5)".
|
||||||
|
|
||||||
|
|
||||||
This project builds the libpng binaries as follows:
|
This project builds the libpng binaries as follows:
|
||||||
|
|
||||||
* Win32_DLL_Release\libpng10.dll DLL build
|
* Win32_DLL_Release\libpng13.dll DLL build
|
||||||
* Win32_DLL_Debug\libpng10d.dll DLL build (debug version)
|
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
|
||||||
* Win32_DLL_ASM_Release\libpng10.dll DLL build using ASM code
|
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
|
||||||
* Win32_DLL_ASM_Debug\libpng10d.dll DLL build using ASM (debug version)
|
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
|
||||||
* Win32_DLL_VB\libpng10vb.dll DLL build for Visual Basic, using stdcall
|
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
|
||||||
* Win32_LIB_Release\libpng.lib static build
|
* Win32_LIB_Release\libpng.lib static build
|
||||||
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
||||||
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
||||||
* Win32_LIB_ASM_Debug\libpngd.lib static build using ASM (debug version)
|
* Win32_LIB_ASM_Debug\libpngd.lib static build using ASM (debug version)
|
||||||
|
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
If you change anything in the source files, or select different compiler
|
If you change anything in the source files, or select different compiler
|
||||||
|
|||||||
@@ -56,14 +56,14 @@ MTL=midl.exe
|
|||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG"
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng10.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||||
|
|
||||||
@@ -87,14 +87,14 @@ MTL=midl.exe
|
|||||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG" /d PNG_DEBUG=1
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng10d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug"
|
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release"
|
||||||
|
|
||||||
@@ -118,14 +118,14 @@ MTL=midl.exe
|
|||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions""""
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG" /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions""""
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\libpng10.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release"
|
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug"
|
||||||
|
|
||||||
@@ -149,14 +149,14 @@ MTL=midl.exe
|
|||||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions""""
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG" /d PNG_DEBUG=1 /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions""""
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\libpng10d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug"
|
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||||
|
|
||||||
@@ -180,17 +180,17 @@ MTL=midl.exe
|
|||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /dPNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /dPNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions""""
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG" /dPNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /dPNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions""""
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng10vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng13vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\Win32_DLL_VB
|
OutDir=.\Win32_DLL_VB
|
||||||
TargetName=libpng10vb
|
TargetName=libpng13vb
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PostBuild_Cmds=echo Deleting $(targetname) import library and export file (Not required for VB projects) del $(outdir)\$(targetname).lib del $(outdir)\$(targetname).exp
|
PostBuild_Cmds=echo Deleting $(targetname) import library and export file (Not required for VB projects) del $(outdir)\$(targetname).lib del $(outdir)\$(targetname).exp
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
@@ -213,8 +213,8 @@ CPP=cl.exe
|
|||||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "PNG_NO_MMX_CODE" /D "WIN32" /D "NDEBUG" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "PNG_NO_MMX_CODE" /D "WIN32" /D "NDEBUG" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG"
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -240,8 +240,8 @@ CPP=cl.exe
|
|||||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "PNG_NO_MMX_CODE" /D PNG_DEBUG=1 /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "PNG_NO_MMX_CODE" /D PNG_DEBUG=1 /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -267,8 +267,8 @@ CPP=cl.exe
|
|||||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG"
|
# ADD RSC /l 0x409 /i "..\.." /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
@@ -294,8 +294,8 @@ CPP=cl.exe
|
|||||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||||
# SUBTRACT CPP /YX /Yc /Yu
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 Win32_DLL_Release\libpng10.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
# ADD LINK32 Win32_DLL_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\Win32_DLL_Release
|
OutDir=.\Win32_DLL_Release
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -90,7 +90,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 Win32_DLL_Debug\libpng10d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD LINK32 Win32_DLL_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\Win32_DLL_Debug
|
OutDir=.\Win32_DLL_Debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -122,7 +122,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 Win32_DLL_ASM_Release\libpng10.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
# ADD LINK32 Win32_DLL_ASM_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\Win32_DLL_ASM_Release
|
OutDir=.\Win32_DLL_ASM_Release
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
@@ -154,7 +154,7 @@ BSC32=bscmake.exe
|
|||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 Win32_DLL_ASM_Debug\libpng10d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD LINK32 Win32_DLL_ASM_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
OutDir=.\Win32_DLL_ASM_Debug
|
OutDir=.\Win32_DLL_ASM_Debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ To use:
|
|||||||
|
|
||||||
This project builds the libpng binaries as follows:
|
This project builds the libpng binaries as follows:
|
||||||
|
|
||||||
* Win32_DLL_Release\libpng10.dll DLL build
|
* Win32_DLL_Release\libpng13.dll DLL build
|
||||||
* Win32_DLL_Debug\libpng10d.dll DLL build (debug version)
|
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
|
||||||
* Win32_DLL_ASM_Release\libpng10.dll DLL build using ASM code
|
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
|
||||||
* Win32_DLL_ASM_Debug\libpng10d.dll DLL build using ASM (debug version)
|
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
|
||||||
* Win32_DLL_VB\libpng10vb.dll DLL build for Visual Basic, using stdcall
|
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
|
||||||
* Win32_LIB_Release\libpng.lib static build
|
* Win32_LIB_Release\libpng.lib static build
|
||||||
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
||||||
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Copyright (C) 2004 Simon-Pierre Cadieux.
|
|||||||
Copyright (C) 2004 Cosmin Truta.
|
Copyright (C) 2004 Cosmin Truta.
|
||||||
For conditions of distribution and use, see copyright notice in zlib.h.
|
For conditions of distribution and use, see copyright notice in zlib.h.
|
||||||
|
|
||||||
|
|
||||||
To use:
|
To use:
|
||||||
|
|
||||||
1) On the main menu, select "File | Open Solution".
|
1) On the main menu, select "File | Open Solution".
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/libpng10.dll"
|
OutputFile="$(OutDir)/libpng13.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/libpng10d.dll"
|
OutputFile="$(OutDir)/libpng13d.dll"
|
||||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
||||||
GenerateDebugInformation="TRUE"/>
|
GenerateDebugInformation="TRUE"/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/libpng10.dll"
|
OutputFile="$(OutDir)/libpng13.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
AdditionalOptions="/d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
||||||
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||||
Culture="1033"
|
Culture="1033"
|
||||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/libpng10d.dll"
|
OutputFile="$(OutDir)/libpng13d.dll"
|
||||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
||||||
GenerateDebugInformation="TRUE"/>
|
GenerateDebugInformation="TRUE"/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
AdditionalOptions="/d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
||||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
||||||
Culture="1033"
|
Culture="1033"
|
||||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
Name="VCCustomBuildTool"/>
|
Name="VCCustomBuildTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/libpng10vb.dll"
|
OutputFile="$(OutDir)/libpng13vb.dll"
|
||||||
LinkIncremental="1"/>
|
LinkIncremental="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCMIDLTool"/>
|
Name="VCMIDLTool"/>
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
Name="VCPreLinkEventTool"/>
|
Name="VCPreLinkEventTool"/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCResourceCompilerTool"
|
Name="VCResourceCompilerTool"
|
||||||
AdditionalOptions="/d PNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /d PNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions"""""
|
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /d PNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions"""""
|
||||||
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||||
Culture="1033"
|
Culture="1033"
|
||||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
|||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
OutputFile="$(OutDir)/pngtest.exe"
|
OutputFile="$(OutDir)/pngtest.exe"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
IgnoreDefaultLibraryNames="$(IntDir)\libpng10vb.lib"
|
IgnoreDefaultLibraryNames="$(IntDir)\libpng13vb.lib"
|
||||||
SubSystem="1"
|
SubSystem="1"
|
||||||
TargetMachine="1"/>
|
TargetMachine="1"/>
|
||||||
<Tool
|
<Tool
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
A set of project files is available for WinCE. Get
|
A set of project files is available for WinCE. Get
|
||||||
libpng-1.0.65-project-wince.zip from a libpng distribution
|
libpng-1.2.41beta17-project-wince.zip from a libpng distribution
|
||||||
site such as http://libpng.sourceforge.net/index.html
|
site such as http://libpng.sourceforge.net/index.html
|
||||||
|
|
||||||
Put the zip file in this directory (projects) and then run
|
Put the zip file in this directory (projects) and then run
|
||||||
"unzip -a libpng-1.0.65-project-wince.zip"
|
"unzip -a libpng-1.2.41beta17-project-wince.zip"
|
||||||
|
|||||||
26
projects/xcode/Info.plist
Normal file
26
projects/xcode/Info.plist
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>libpng</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.apple.carbonframeworktemplate</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CSResourcesFileMapped</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
2
projects/xcode/libpng.xcodeproj/.gitignore
vendored
Normal file
2
projects/xcode/libpng.xcodeproj/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*.mode1*
|
||||||
|
*.pbxuser
|
||||||
349
projects/xcode/libpng.xcodeproj/project.pbxproj
Normal file
349
projects/xcode/libpng.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,349 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 44;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
14461C7109C3C37F005840C0 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C5D09C3C37F005840C0 /* png.c */; };
|
||||||
|
14461C7209C3C37F005840C0 /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = 14461C5E09C3C37F005840C0 /* png.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
14461C7309C3C37F005840C0 /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 14461C5F09C3C37F005840C0 /* pngconf.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
14461C7409C3C37F005840C0 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6009C3C37F005840C0 /* pngerror.c */; };
|
||||||
|
14461C7509C3C37F005840C0 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6109C3C37F005840C0 /* pnggccrd.c */; };
|
||||||
|
14461C7609C3C37F005840C0 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6209C3C37F005840C0 /* pngget.c */; };
|
||||||
|
14461C7709C3C37F005840C0 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6309C3C37F005840C0 /* pngmem.c */; };
|
||||||
|
14461C7809C3C37F005840C0 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6409C3C37F005840C0 /* pngpread.c */; };
|
||||||
|
14461C7909C3C37F005840C0 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6509C3C37F005840C0 /* pngread.c */; };
|
||||||
|
14461C7A09C3C37F005840C0 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6609C3C37F005840C0 /* pngrio.c */; };
|
||||||
|
14461C7B09C3C37F005840C0 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6709C3C37F005840C0 /* pngrtran.c */; };
|
||||||
|
14461C7C09C3C37F005840C0 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6809C3C37F005840C0 /* pngrutil.c */; };
|
||||||
|
14461C7D09C3C37F005840C0 /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6909C3C37F005840C0 /* pngset.c */; };
|
||||||
|
14461C7F09C3C37F005840C0 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6B09C3C37F005840C0 /* pngtrans.c */; };
|
||||||
|
14461C8009C3C37F005840C0 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6C09C3C37F005840C0 /* pngvcrd.c */; };
|
||||||
|
14461C8109C3C37F005840C0 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6D09C3C37F005840C0 /* pngwio.c */; };
|
||||||
|
14461C8209C3C37F005840C0 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6E09C3C37F005840C0 /* pngwrite.c */; };
|
||||||
|
14461C8309C3C37F005840C0 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6F09C3C37F005840C0 /* pngwtran.c */; };
|
||||||
|
14461C8409C3C37F005840C0 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C7009C3C37F005840C0 /* pngwutil.c */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
14461C5D09C3C37F005840C0 /* png.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = png.c; path = ../../png.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C5E09C3C37F005840C0 /* png.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = png.h; path = ../../png.h; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C5F09C3C37F005840C0 /* pngconf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pngconf.h; path = ../../pngconf.h; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6009C3C37F005840C0 /* pngerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngerror.c; path = ../../pngerror.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6109C3C37F005840C0 /* pnggccrd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pnggccrd.c; path = ../../pnggccrd.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6209C3C37F005840C0 /* pngget.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngget.c; path = ../../pngget.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6309C3C37F005840C0 /* pngmem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngmem.c; path = ../../pngmem.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6409C3C37F005840C0 /* pngpread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngpread.c; path = ../../pngpread.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6509C3C37F005840C0 /* pngread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngread.c; path = ../../pngread.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6609C3C37F005840C0 /* pngrio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrio.c; path = ../../pngrio.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6709C3C37F005840C0 /* pngrtran.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrtran.c; path = ../../pngrtran.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6809C3C37F005840C0 /* pngrutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrutil.c; path = ../../pngrutil.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6909C3C37F005840C0 /* pngset.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngset.c; path = ../../pngset.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6B09C3C37F005840C0 /* pngtrans.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngtrans.c; path = ../../pngtrans.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6C09C3C37F005840C0 /* pngvcrd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngvcrd.c; path = ../../pngvcrd.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6D09C3C37F005840C0 /* pngwio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwio.c; path = ../../pngwio.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6E09C3C37F005840C0 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwrite.c; path = ../../pngwrite.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C6F09C3C37F005840C0 /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwtran.c; path = ../../pngwtran.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
14461C7009C3C37F005840C0 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwutil.c; path = ../../pngwutil.c; sourceTree = SOURCE_ROOT; };
|
||||||
|
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
8D07F2C80486CC7A007CD1D0 /* libpng.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libpng.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
034768DDFF38A45A11DB9C8B /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
8D07F2C80486CC7A007CD1D0 /* libpng.framework */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
0867D691FE84028FC02AAC07 /* libpng */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
08FB77ACFE841707C02AAC07 /* Source */,
|
||||||
|
089C1665FE841158C02AAC07 /* Resources */,
|
||||||
|
034768DDFF38A45A11DB9C8B /* Products */,
|
||||||
|
);
|
||||||
|
name = libpng;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
089C1665FE841158C02AAC07 /* Resources */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
|
||||||
|
);
|
||||||
|
name = Resources;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
08FB77ACFE841707C02AAC07 /* Source */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
14461C5D09C3C37F005840C0 /* png.c */,
|
||||||
|
14461C5E09C3C37F005840C0 /* png.h */,
|
||||||
|
14461C5F09C3C37F005840C0 /* pngconf.h */,
|
||||||
|
14461C6009C3C37F005840C0 /* pngerror.c */,
|
||||||
|
14461C6109C3C37F005840C0 /* pnggccrd.c */,
|
||||||
|
14461C6209C3C37F005840C0 /* pngget.c */,
|
||||||
|
14461C6309C3C37F005840C0 /* pngmem.c */,
|
||||||
|
14461C6409C3C37F005840C0 /* pngpread.c */,
|
||||||
|
14461C6509C3C37F005840C0 /* pngread.c */,
|
||||||
|
14461C6609C3C37F005840C0 /* pngrio.c */,
|
||||||
|
14461C6709C3C37F005840C0 /* pngrtran.c */,
|
||||||
|
14461C6809C3C37F005840C0 /* pngrutil.c */,
|
||||||
|
14461C6909C3C37F005840C0 /* pngset.c */,
|
||||||
|
14461C6B09C3C37F005840C0 /* pngtrans.c */,
|
||||||
|
14461C6C09C3C37F005840C0 /* pngvcrd.c */,
|
||||||
|
14461C6D09C3C37F005840C0 /* pngwio.c */,
|
||||||
|
14461C6E09C3C37F005840C0 /* pngwrite.c */,
|
||||||
|
14461C6F09C3C37F005840C0 /* pngwtran.c */,
|
||||||
|
14461C7009C3C37F005840C0 /* pngwutil.c */,
|
||||||
|
);
|
||||||
|
name = Source;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXHeadersBuildPhase section */
|
||||||
|
8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
|
||||||
|
isa = PBXHeadersBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
14461C7209C3C37F005840C0 /* png.h in Headers */,
|
||||||
|
14461C7309C3C37F005840C0 /* pngconf.h in Headers */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXHeadersBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
8D07F2BC0486CC7A007CD1D0 /* libpng */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "libpng" */;
|
||||||
|
buildPhases = (
|
||||||
|
8D07F2BD0486CC7A007CD1D0 /* Headers */,
|
||||||
|
8D07F2BF0486CC7A007CD1D0 /* Resources */,
|
||||||
|
8D07F2C10486CC7A007CD1D0 /* Sources */,
|
||||||
|
8D07F2C30486CC7A007CD1D0 /* Frameworks */,
|
||||||
|
8D07F2C50486CC7A007CD1D0 /* Rez */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = libpng;
|
||||||
|
productInstallPath = "$(HOME)/Library/Frameworks";
|
||||||
|
productName = libpng;
|
||||||
|
productReference = 8D07F2C80486CC7A007CD1D0 /* libpng.framework */;
|
||||||
|
productType = "com.apple.product-type.framework";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "libpng" */;
|
||||||
|
compatibilityVersion = "Xcode 2.4";
|
||||||
|
hasScannedForEncodings = 1;
|
||||||
|
mainGroup = 0867D691FE84028FC02AAC07 /* libpng */;
|
||||||
|
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = ../..;
|
||||||
|
targets = (
|
||||||
|
8D07F2BC0486CC7A007CD1D0 /* libpng */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXRezBuildPhase section */
|
||||||
|
8D07F2C50486CC7A007CD1D0 /* Rez */ = {
|
||||||
|
isa = PBXRezBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXRezBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
8D07F2C10486CC7A007CD1D0 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
14461C7109C3C37F005840C0 /* png.c in Sources */,
|
||||||
|
14461C7409C3C37F005840C0 /* pngerror.c in Sources */,
|
||||||
|
14461C7509C3C37F005840C0 /* pnggccrd.c in Sources */,
|
||||||
|
14461C7609C3C37F005840C0 /* pngget.c in Sources */,
|
||||||
|
14461C7709C3C37F005840C0 /* pngmem.c in Sources */,
|
||||||
|
14461C7809C3C37F005840C0 /* pngpread.c in Sources */,
|
||||||
|
14461C7909C3C37F005840C0 /* pngread.c in Sources */,
|
||||||
|
14461C7A09C3C37F005840C0 /* pngrio.c in Sources */,
|
||||||
|
14461C7B09C3C37F005840C0 /* pngrtran.c in Sources */,
|
||||||
|
14461C7C09C3C37F005840C0 /* pngrutil.c in Sources */,
|
||||||
|
14461C7D09C3C37F005840C0 /* pngset.c in Sources */,
|
||||||
|
14461C7F09C3C37F005840C0 /* pngtrans.c in Sources */,
|
||||||
|
14461C8009C3C37F005840C0 /* pngvcrd.c in Sources */,
|
||||||
|
14461C8109C3C37F005840C0 /* pngwio.c in Sources */,
|
||||||
|
14461C8209C3C37F005840C0 /* pngwrite.c in Sources */,
|
||||||
|
14461C8309C3C37F005840C0 /* pngwtran.c in Sources */,
|
||||||
|
14461C8409C3C37F005840C0 /* pngwutil.c in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
4FADC24308B4156D00ABE55E /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 3;
|
||||||
|
DYLIB_CURRENT_VERSION = 3;
|
||||||
|
FRAMEWORK_VERSION = 1.2.41beta17;
|
||||||
|
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||||
|
GCC_PREFIX_HEADER = "";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||||
|
LIBRARY_STYLE = DYNAMIC;
|
||||||
|
MACH_O_TYPE = mh_dylib;
|
||||||
|
OTHER_LDFLAGS = "-lz";
|
||||||
|
PRODUCT_NAME = libpng;
|
||||||
|
WRAPPER_EXTENSION = framework;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
4FADC24408B4156D00ABE55E /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
DYLIB_COMPATIBILITY_VERSION = 3;
|
||||||
|
DYLIB_CURRENT_VERSION = 3;
|
||||||
|
FRAMEWORK_VERSION = 1.2.41beta17;
|
||||||
|
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||||
|
GCC_PREFIX_HEADER = "";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||||
|
LIBRARY_STYLE = DYNAMIC;
|
||||||
|
MACH_O_TYPE = mh_dylib;
|
||||||
|
OTHER_LDFLAGS = "-lz";
|
||||||
|
PRODUCT_NAME = libpng;
|
||||||
|
WRAPPER_EXTENSION = framework;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
4FADC24708B4156D00ABE55E /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = (
|
||||||
|
i386,
|
||||||
|
ppc,
|
||||||
|
ppc64,
|
||||||
|
x86_64,
|
||||||
|
);
|
||||||
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
|
GCC_ENABLE_CPP_EXCEPTIONS = NO;
|
||||||
|
GCC_ENABLE_CPP_RTTI = NO;
|
||||||
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
|
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||||
|
GCC_VERSION_i386 = 4.0;
|
||||||
|
GCC_VERSION_ppc = 3.3;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
|
"MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4;
|
||||||
|
"MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||||
|
"SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
|
"SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk";
|
||||||
|
SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
|
SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk";
|
||||||
|
ZERO_LINK = NO;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
4FADC24808B4156D00ABE55E /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = (
|
||||||
|
i386,
|
||||||
|
ppc,
|
||||||
|
ppc64,
|
||||||
|
x86_64,
|
||||||
|
);
|
||||||
|
GCC_ENABLE_CPP_EXCEPTIONS = NO;
|
||||||
|
GCC_ENABLE_CPP_RTTI = NO;
|
||||||
|
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||||
|
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 2;
|
||||||
|
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||||
|
GCC_VERSION_i386 = 4.0;
|
||||||
|
GCC_VERSION_ppc = 3.3;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.5;
|
||||||
|
"MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4;
|
||||||
|
"MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET_ppc = 10.2;
|
||||||
|
PREBINDING = NO;
|
||||||
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
|
||||||
|
"SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
|
"SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk";
|
||||||
|
SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
|
SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk";
|
||||||
|
ZERO_LINK = NO;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "libpng" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
4FADC24308B4156D00ABE55E /* Debug */,
|
||||||
|
4FADC24408B4156D00ABE55E /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "libpng" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
4FADC24708B4156D00ABE55E /* Debug */,
|
||||||
|
4FADC24808B4156D00ABE55E /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||||
|
}
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
|
|
||||||
Makefiles for libpng version 1.0.65 - December 3, 2015
|
|
||||||
|
|
||||||
makefile.linux => Linux/ELF makefile
|
|
||||||
(gcc, creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
|
||||||
ansi2knr (Requires ansi2knr.c from
|
|
||||||
ftp://ftp.cs.wisc.edu/ghost)
|
|
||||||
makefile.acorn => Acorn makefile
|
|
||||||
makefile.aix => AIX/gcc makefile
|
|
||||||
makefile.amiga => Amiga makefile
|
|
||||||
makefile.atari => Atari makefile
|
|
||||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
|
|
||||||
makefile.beos => beos makefile
|
|
||||||
makefile.bor => Borland makefile (uses bcc)
|
|
||||||
makefile.cegcc => minge32ce for Windows CE makefile
|
|
||||||
makefile.cygwin => Cygwin/gcc makefile
|
|
||||||
makefile.darwin => Darwin makefile, can use on MacosX
|
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
|
||||||
makefile.dj2 => DJGPP 2 makefile
|
|
||||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
|
||||||
gcc, creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.freebsd => FreeBSD makefile
|
|
||||||
makefile.gcc => Generic gcc makefile
|
|
||||||
makefile.gccmmx => Generic gcc makefile previously using MMX code
|
|
||||||
makefile.hpgcc => HPUX makefile using gcc
|
|
||||||
makefile.hpux => HPUX (10.20 and 11.00) makefile
|
|
||||||
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit
|
|
||||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
|
||||||
makefile.intel => Intel C/C++ version 4.0 and later
|
|
||||||
makefile.mingw => Mingw makefile
|
|
||||||
makefile.mips => MIPS makefile
|
|
||||||
makefile.msc => Microsoft C makefile
|
|
||||||
makefile.netbsd => NetBSD/cc makefile, makes libpng.so.
|
|
||||||
makefile.nommx => Generic gcc makefile not using MMX code
|
|
||||||
makefile.openbsd => OpenBSD makefile
|
|
||||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
|
||||||
makefile.sggcc => Silicon Graphics (gcc,
|
|
||||||
creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
|
||||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
|
||||||
creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.solaris-x86 => Solaris 2.X makefile (gcc, no MMX code,
|
|
||||||
creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.so9 => Solaris 9 makefile (gcc,
|
|
||||||
creates libpng10.so.0.1.0.65)
|
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
|
||||||
makefile.sunos => Sun makefile
|
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
|
||||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
|
||||||
makefile.tc3 => Turbo C 3.0 makefile
|
|
||||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 4.0 and later
|
|
||||||
previously using MMX code
|
|
||||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later
|
|
||||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
|
|
||||||
makevms.com => VMS build script
|
|
||||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
|
||||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
|
||||||
|
|
||||||
Other supporting scripts:
|
|
||||||
descrip.mms => VMS makefile for MMS or MMK
|
|
||||||
libpng-config.in => Used by "configure" to create libpng-config.
|
|
||||||
libpng-config-body.in => used by several makefiles to create libpng-config
|
|
||||||
libpng-config-head.in => used by several makefiles to create libpng-config
|
|
||||||
libpng.pc.in => Used by several makefiles to create libpng.pc
|
|
||||||
libpng.pc-configure.in => Used by "configure" to create libpng.pc
|
|
||||||
libpng.icc
|
|
||||||
pngos2.def => OS/2 module definition file used by makefile.os2
|
|
||||||
pngw32.def => Module definitions for makefile.cygwin and mingw
|
|
||||||
png32ce.def => Module definition file used by makefile.cegcc
|
|
||||||
pngw32.rc => Used by the visualc6 and visualc71 projects.
|
|
||||||
SCOPTIONS.ppc => Used with smakefile.ppc
|
|
||||||
|
|
||||||
Further information can be found in comments in the individual makefiles.
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
# Modeled after libxml-config.
|
# Modeled after libxml-config.
|
||||||
|
|
||||||
version=1.0.65
|
version=1.2.41beta17
|
||||||
prefix=""
|
prefix=""
|
||||||
libdir=""
|
libdir=""
|
||||||
libs=""
|
libs=""
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
prefix=@prefix@
|
prefix=@prefix@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
includedir=@includedir@/libpng10
|
includedir=@includedir@/libpng12
|
||||||
|
|
||||||
Name: libpng
|
Name: libpng
|
||||||
Description: Loads and saves PNG files
|
Description: Loads and saves PNG files
|
||||||
Version: 1.0.65
|
Version: 1.2.41beta17
|
||||||
Libs: -L${libdir} -lpng10
|
Libs: -L${libdir} -lpng12
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
# and license in png.h
|
# and license in png.h
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME=libpng10
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
|||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC=cc
|
CC=cc
|
||||||
@@ -33,7 +33,7 @@ RM_F=/bin/rm -f
|
|||||||
SUN_CC_FLAGS=-fast -xtarget=ultra
|
SUN_CC_FLAGS=-fast -xtarget=ultra
|
||||||
SUN_LD_FLAGS=-fast -xtarget=ultra
|
SUN_LD_FLAGS=-fast -xtarget=ultra
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng10.so and libpng10/png.h
|
# where make install puts libpng.a, libpng12.so and libpng12/png.h
|
||||||
prefix=/a
|
prefix=/a
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ ZLIBINC=/usr/include
|
|||||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||||
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
||||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
|
LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -106,7 +106,7 @@ libpng-config:
|
|||||||
echo R_opts=\"-R$(LIBPATH)\"; \
|
echo R_opts=\"-R$(LIBPATH)\"; \
|
||||||
echo ccopts=\"-xtarget=ultra\"; \
|
echo ccopts=\"-xtarget=ultra\"; \
|
||||||
echo ldopts=\"-xtarget=ultra\"; \
|
echo ldopts=\"-xtarget=ultra\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
# and license in png.h
|
# and license in png.h
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME=libpng10
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
|||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC=cc
|
CC=cc
|
||||||
@@ -33,7 +33,7 @@ RM_F=/bin/rm -f
|
|||||||
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
|
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||||
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng10.so and libpng10/png.h
|
# where make install puts libpng.a, libpng12.so and libpng12/png.h
|
||||||
prefix=/a
|
prefix=/a
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
|
|
||||||
@@ -49,9 +49,9 @@ ZLIBINC=/usr/include
|
|||||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||||
CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
||||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng10 -lz -lm
|
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(exec_prefix)/lib
|
LIBPATH=$(exec_prefix)/lib
|
||||||
@@ -95,7 +95,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -106,7 +106,7 @@ libpng-config:
|
|||||||
echo R_opts=\"-R$(LIBPATH)\"; \
|
echo R_opts=\"-R$(LIBPATH)\"; \
|
||||||
echo ccopts=\"-xtarget=ultra -xarch=v9\"; \
|
echo ccopts=\"-xtarget=ultra -xarch=v9\"; \
|
||||||
echo ldopts=\"-xtarget=ultra -xarch=v9\"; \
|
echo ldopts=\"-xtarget=ultra -xarch=v9\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Toolflags:
|
# Toolflags:
|
||||||
CCflags = -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah
|
CCflags = -DPNG_CONFIGURE_LIBPNG -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah
|
||||||
C++flags = -c -depend !Depend -IC: -throwback
|
C++flags = -c -depend !Depend -IC: -throwback
|
||||||
Linkflags = -aif -c++ -o $@
|
Linkflags = -aif -c++ -o $@
|
||||||
ObjAsmflags = -throwback -NoCache -depend !Depend
|
ObjAsmflags = -throwback -NoCache -depend !Depend
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ RANLIB = ranlib
|
|||||||
RM_F = rm -f
|
RM_F = rm -f
|
||||||
LN_SF = ln -f -s
|
LN_SF = ln -f -s
|
||||||
|
|
||||||
LIBNAME=libpng10
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
@@ -48,8 +48,8 @@ LDDEBUG =
|
|||||||
CRELEASE = -O2
|
CRELEASE = -O2
|
||||||
LDRELEASE = -s
|
LDRELEASE = -s
|
||||||
WARNMORE=-W -Wall
|
WARNMORE=-W -Wall
|
||||||
CFLAGS = -D_ALL_SOURCE -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
|
CFLAGS = -DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
|
||||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng10 -lz -lm $(LDRELEASE)
|
LDFLAGS = -L. -L$(ZLIBLIB) -lpng12 -lz -lm $(LDRELEASE)
|
||||||
|
|
||||||
# File extensions
|
# File extensions
|
||||||
O=.o
|
O=.o
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ CC=sc
|
|||||||
#compiler flags
|
#compiler flags
|
||||||
# WARNING: a bug in V6.51 causes bad code with OPTGO
|
# WARNING: a bug in V6.51 causes bad code with OPTGO
|
||||||
# So use V6.55 or set NOOPTGO!!!!!!!!!
|
# So use V6.55 or set NOOPTGO!!!!!!!!!
|
||||||
CFLAGS= NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\
|
CFLAGS= -DPNG_CONFIGURE_LIBPNG NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\
|
||||||
OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \
|
OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \
|
||||||
DEFINE=PNG_INTERNAL
|
DEFINE=PNG_INTERNAL
|
||||||
#linker flags
|
#linker flags
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
|
# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
|
||||||
# rules for library management
|
# rules for library management
|
||||||
#
|
#
|
||||||
CFLAGS=-I..\zlib -O
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I..\zlib -O
|
||||||
LBR = png.lib
|
LBR = png.lib
|
||||||
LDFLAGS=-lpng -lz -lm
|
LDFLAGS=-lpng -lz -lm
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ LDEBUG=$(LDEBUG) -N
|
|||||||
# -d merge duplicate strings
|
# -d merge duplicate strings
|
||||||
# -k- turn off standard stack frame
|
# -k- turn off standard stack frame
|
||||||
# -w display all warnings
|
# -w display all warnings
|
||||||
CFLAGS=-I$(ZLIB_DIR) -O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIB_DIR) -O2 -d -k- -w $(TARGET_CPU) $(CDEBUG)
|
||||||
|
|
||||||
# -M generate map file
|
# -M generate map file
|
||||||
LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)
|
LDFLAGS=-L$(ZLIB_DIR) -M $(LDEBUG)
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
# and license in png.h
|
# and license in png.h
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME=libpng10
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
|||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC=gcc
|
CC=gcc
|
||||||
@@ -44,12 +44,12 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
|
|
||||||
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
|
# On BeOS, -O1 is actually better than -O3. This is a known bug but it's
|
||||||
# still here in R4.5
|
# still here in R4.5
|
||||||
CFLAGS=-I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
|
||||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
|
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
|
||||||
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
|
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng10.so*, and png.h
|
# where make install puts libpng.a, libpng12.so*, and png.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
@@ -91,13 +91,13 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
echo prefix=\"$(prefix)\"; \
|
echo prefix=\"$(prefix)\"; \
|
||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo libs=\"-lpng10 -lz \"; \
|
echo libs=\"-lpng12 -lz \"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ $(OLDSOVER): $(OBJSDLL)
|
|||||||
$(OLDSOVER) $(OBJSDLL) $(LDFLAGS)
|
$(OLDSOVER) $(OBJSDLL) $(LDFLAGS)
|
||||||
|
|
||||||
pngtest: pngtest.o $(LIBSO)
|
pngtest: pngtest.o $(LIBSO)
|
||||||
$(CC) -L$(ZLIBLIB) -L. -lz -lpng10 -o pngtest pngtest.o
|
$(CC) -L$(ZLIBLIB) -L. -lz -lpng12 -o pngtest pngtest.o
|
||||||
|
|
||||||
test: pngtest
|
test: pngtest
|
||||||
./pngtest
|
./pngtest
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ LDEBUG=$(LDEBUG) -N
|
|||||||
# -w set all warnings on
|
# -w set all warnings on
|
||||||
# -O2 optimize for speed
|
# -O2 optimize for speed
|
||||||
# -Z global optimization
|
# -Z global optimization
|
||||||
CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG)
|
||||||
|
|
||||||
# -M generate map file
|
# -M generate map file
|
||||||
LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
|
LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ DESTDIR=
|
|||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
ifdef MINGW
|
ifdef MINGW
|
||||||
MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw
|
MINGW_CCFLAGS=-DPNG_CONFIGURE_LIBPNG -mno-cygwin -I/usr/include/mingw
|
||||||
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
|
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -74,10 +74,10 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
|||||||
-W -Wall -O3 $(ALIGN) -funroll-loops -DPNG_NO_MMX_CODE \
|
-W -Wall -O3 $(ALIGN) -funroll-loops -DPNG_NO_MMX_CODE \
|
||||||
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
|
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
CYGDLL = 10
|
CYGDLL = 12
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||||
@@ -141,7 +141,7 @@ libpng.pc: scripts/libpng.pc.in
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz! > libpng.pc
|
||||||
|
|
||||||
libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in
|
libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in
|
||||||
@echo -e Making $(LIBNAME) libpng-config file for this libpng \
|
@echo -e Making $(LIBNAME) libpng-config file for this libpng \
|
||||||
@@ -254,16 +254,16 @@ test-dd:
|
|||||||
echo
|
echo
|
||||||
echo Testing installed dynamic shared library in $(DL).
|
echo Testing installed dynamic shared library in $(DL).
|
||||||
$(CC) -I$(DI) $(CFLAGS) \
|
$(CC) -I$(DI) $(CFLAGS) \
|
||||||
`$(BINPATH)/libpng10-config --cflags` pngtest.c \
|
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
|
||||||
-L$(DL) -L$(ZLIBLIB) \
|
-L$(DL) -L$(ZLIBLIB) \
|
||||||
-o pngtestd `$(BINPATH)/libpng10-config --ldflags`
|
-o pngtestd `$(BINPATH)/libpng12-config --ldflags`
|
||||||
./pngtestd pngtest.png
|
./pngtestd pngtest.png
|
||||||
|
|
||||||
test-installed:
|
test-installed:
|
||||||
$(CC) $(CFLAGS) \
|
$(CC) $(CFLAGS) \
|
||||||
`$(BINPATH)/libpng10-config --cflags` pngtest.c \
|
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
|
||||||
-L$(ZLIBLIB) \
|
-L$(ZLIBLIB) \
|
||||||
-o pngtesti$(EXE) `$(BINPATH)/libpng10-config --ldflags`
|
-o pngtesti$(EXE) `$(BINPATH)/libpng12-config --ldflags`
|
||||||
./pngtesti$(EXE) pngtest.png
|
./pngtesti$(EXE) pngtest.png
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
# For conditions of distribution and use, see the disclaimer
|
# For conditions of distribution and use, see the disclaimer
|
||||||
# and license in png.h
|
# and license in png.h
|
||||||
|
|
||||||
# where "make install" puts libpng.a, libpng10.dylib, png.h and pngconf.h
|
# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@ ZLIBLIB=../zlib
|
|||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 10
|
PNGMAJ = 12
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -30,8 +30,8 @@ LIBSO=$(LIBNAME).dylib
|
|||||||
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
|
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
|
||||||
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
|
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
|
||||||
OLDSO=libpng.dylib
|
OLDSO=libpng.dylib
|
||||||
OLDSOMAJ=libpng.2.dylib
|
OLDSOMAJ=libpng.3.dylib
|
||||||
OLDSOVER=libpng.2.$(PNGMIN).dylib
|
OLDSOVER=libpng.3.$(PNGMIN).dylib
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC=cc
|
CC=cc
|
||||||
@@ -41,9 +41,9 @@ LN_SF=ln -sf
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
RM_F=/bin/rm -f
|
RM_F=/bin/rm -f
|
||||||
|
|
||||||
# CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE
|
# CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE
|
||||||
CFLAGS=-I$(ZLIBINC) -W -Wall -O -funroll-loops
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O -funroll-loops
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng10 -lz
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(exec_prefix)/lib
|
LIBPATH=$(exec_prefix)/lib
|
||||||
@@ -87,14 +87,14 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
echo prefix=\"$(prefix)\"; \
|
echo prefix=\"$(prefix)\"; \
|
||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||||
echo libs=\"-lpng10 -lz\"; \
|
echo libs=\"-lpng12 -lz\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ $(LIBSOVER): $(OBJSDLL)
|
|||||||
$(OLDSOVER): $(OBJSDLL)
|
$(OLDSOVER): $(OBJSDLL)
|
||||||
$(CC) -dynamiclib \
|
$(CC) -dynamiclib \
|
||||||
-install_name $(LIBPATH)/$(OLDSOMAJ) \
|
-install_name $(LIBPATH)/$(OLDSOMAJ) \
|
||||||
-current_version 2 -compatibility_version 2 \
|
-current_version 3 -compatibility_version 3 \
|
||||||
-o $(OLDSOVER) \
|
-o $(OLDSOVER) \
|
||||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||||
|
|
||||||
|
|||||||
@@ -8,17 +8,17 @@
|
|||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
LIBSO=$(LIBNAME).so
|
LIBSO=$(LIBNAME).so
|
||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
AR_RC=ar rc
|
AR_RC=ar rc
|
||||||
@@ -57,7 +57,7 @@ DM=$(DESTDIR)$(MANPATH)
|
|||||||
ZLIBLIB=../zlib
|
ZLIBLIB=../zlib
|
||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
|
||||||
LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
|
LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
@@ -75,7 +75,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -83,7 +83,7 @@ libpng-config:
|
|||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo ccopts=\"-std\"; \
|
echo ccopts=\"-std\"; \
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ INCPATH=$(prefix)/include
|
|||||||
LIBPATH=$(prefix)/lib
|
LIBPATH=$(prefix)/lib
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-I../zlib -O
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I../zlib -O
|
||||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
||||||
|
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# makefile for libpng.a and libpng10.so on Linux ELF with gcc
|
# makefile for libpng.a and libpng12.so on Linux ELF with gcc
|
||||||
# Copyright (C) 1998, 1999, 2002, 2006, 2008 Greg Roelofs
|
# Copyright (C) 1998, 1999, 2002, 2006, 2008 Greg Roelofs
|
||||||
# and Glenn Randers-Pehrson
|
# and Glenn Randers-Pehrson
|
||||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||||
@@ -10,13 +10,13 @@
|
|||||||
# Modified for Debian by Junichi Uekawa and Josselin Mouette
|
# Modified for Debian by Junichi Uekawa and Josselin Mouette
|
||||||
# Major modifications are:
|
# Major modifications are:
|
||||||
# * link libpng explicitly with libz and libm
|
# * link libpng explicitly with libz and libm
|
||||||
# * $(OLDSO).2 is a symlink rather than a different library
|
# * $(OLDSO).3 is a symlink rather than a different library
|
||||||
# * versioned symbols
|
# * versioned symbols
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -24,8 +24,8 @@ LIBSO=$(LIBNAME).so
|
|||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
AR_RC=ar rc
|
AR_RC=ar rc
|
||||||
@@ -35,8 +35,8 @@ LN_SF=ln -sf
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
RM_F=/bin/rm -f
|
RM_F=/bin/rm -f
|
||||||
|
|
||||||
# where "make install" puts libpng10.a, libpng10.so*,
|
# where "make install" puts libpng12.a, libpng12.so*,
|
||||||
# libpng10/png.h and libpng10/pngconf.h
|
# libpng12/png.h and libpng12/pngconf.h
|
||||||
# Prefix must be a full pathname.
|
# Prefix must be a full pathname.
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
@@ -57,10 +57,10 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
|
|
||||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||||
|
|
||||||
CFLAGS=-W -Wall -D_REENTRANT -O2 \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -W -Wall -D_REENTRANT -O2 \
|
||||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
|
|
||||||
LDFLAGS=-L. -lpng10
|
LDFLAGS=-L. -lpng12
|
||||||
LDFLAGS_A=libpng.a -lz -lm
|
LDFLAGS_A=libpng.a -lz -lm
|
||||||
LIBADDFLAGS=-lz -lm
|
LIBADDFLAGS=-lz -lm
|
||||||
|
|
||||||
@@ -107,11 +107,11 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng.syms: png.h pngconf.h
|
libpng.syms: png.h pngconf.h
|
||||||
$(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
|
$(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
|
||||||
awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG10_%s {global:\n",PNGMAJ)}\
|
awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG12_%s {global:\n",PNGMAJ)}\
|
||||||
{ for (i=1;i+2<=NF;++i)\
|
{ for (i=1;i+2<=NF;++i)\
|
||||||
if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
|
if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
|
||||||
print $$(i+1) ";";\
|
print $$(i+1) ";";\
|
||||||
@@ -128,8 +128,8 @@ libpng-config:
|
|||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo L_opts=\"\"; \
|
echo L_opts=\"\"; \
|
||||||
echo R_opts=\"\"; \
|
echo R_opts=\"\"; \
|
||||||
echo libs=\"-lpng10\"; \
|
echo libs=\"-lpng12\"; \
|
||||||
echo all_libs=\"-lpng10 $(LIBADDFLAGS)\"; \
|
echo all_libs=\"-lpng12 $(LIBADDFLAGS)\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \
|
|||||||
LDADD+= -lm -lz
|
LDADD+= -lm -lz
|
||||||
DPADD+= ${LIBM} ${LIBZ}
|
DPADD+= ${LIBM} ${LIBZ}
|
||||||
|
|
||||||
CFLAGS+= -I.
|
CFLAGS+= -DPNG_CONFIGURE_LIBPNG -I.
|
||||||
.if (${MACHINE_ARCH} != "i386")
|
.if (${MACHINE_ARCH} != "i386")
|
||||||
CFLAGS+= -DPNG_CONFIGURE_LIBPNG -DPNG_NO_MMX_CODE
|
CFLAGS+= -DPNG_CONFIGURE_LIBPNG -DPNG_NO_MMX_CODE
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ CDEBUG = -g -DPNG_DEBUG=5
|
|||||||
LDDEBUG =
|
LDDEBUG =
|
||||||
CRELEASE = -O2
|
CRELEASE = -O2
|
||||||
LDRELEASE = -s
|
LDRELEASE = -s
|
||||||
#CFLAGS = -W -Wall $(CDEBUG)
|
#CFLAGS = -DPNG_CONFIGURE_LIBPNG -W -Wall $(CDEBUG)
|
||||||
CFLAGS = -W -Wall $(CRELEASE)
|
CFLAGS = -DPNG_CONFIGURE_LIBPNG -W -Wall $(CRELEASE)
|
||||||
#LDFLAGS = $(LDDEBUG)
|
#LDFLAGS = $(LDDEBUG)
|
||||||
LDFLAGS = $(LDRELEASE)
|
LDFLAGS = $(LDRELEASE)
|
||||||
LIBS = -lz -lm
|
LIBS = -lz -lm
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# makefile for libpng.a and libpng10.so on Linux ELF with gcc using MMX
|
# makefile for libpng.a and libpng12.so on Linux ELF with gcc using MMX
|
||||||
# assembler code
|
# assembler code
|
||||||
# Copyright 2002, 2006, 2008 Greg Roelofs and Glenn Randers-Pehrson
|
# Copyright 2002, 2006, 2008 Greg Roelofs and Glenn Randers-Pehrson
|
||||||
# Copyright 1998-2001 Greg Roelofs
|
# Copyright 1998-2001 Greg Roelofs
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
# the background! Context switches between MMX and FPU are expensive.
|
# the background! Context switches between MMX and FPU are expensive.
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -25,8 +25,8 @@ LIBSO=$(LIBNAME).so
|
|||||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||||
OLDSO=libpng.so
|
OLDSO=libpng.so
|
||||||
OLDSOMAJ=libpng.so.2
|
OLDSOMAJ=libpng.so.3
|
||||||
OLDSOVER=libpng.so.2.$(PNGMIN)
|
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC = gcc
|
CC = gcc
|
||||||
@@ -37,8 +37,8 @@ MKDIR_P = mkdir -p
|
|||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
RM_F = /bin/rm -f
|
RM_F = /bin/rm -f
|
||||||
|
|
||||||
# where "make install" puts libpng10.a, libpng10.so*,
|
# where "make install" puts libpng12.a, libpng12.so*,
|
||||||
# libpng10/png.h and libpng10/pngconf.h
|
# libpng12/png.h and libpng12/pngconf.h
|
||||||
# Prefix must be a full pathname.
|
# Prefix must be a full pathname.
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
@@ -73,7 +73,7 @@ CFLAGS=-DPNG_THREAD_UNSAFE_OK -I$(ZLIBINC) -W -Wall -O \
|
|||||||
# -m486 -malign-double -ffast-math \
|
# -m486 -malign-double -ffast-math \
|
||||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
||||||
|
|
||||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng10 -lz -lm
|
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||||
|
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -128,7 +128,7 @@ libpng-config:
|
|||||||
echo cppflags=\"-DPNG_THREAD_UNSAFE_OK \"; \
|
echo cppflags=\"-DPNG_THREAD_UNSAFE_OK \"; \
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||||
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
|
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ ZLIBINC=/opt/zlib/include
|
|||||||
# Note that if you plan to build a libpng shared library, zlib must also
|
# Note that if you plan to build a libpng shared library, zlib must also
|
||||||
# be a shared library, which zlib's configure does not do. After running
|
# be a shared library, which zlib's configure does not do. After running
|
||||||
# zlib's configure, edit the appropriate lines of makefile to read:
|
# zlib's configure, edit the appropriate lines of makefile to read:
|
||||||
# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
|
# CFLAGS=-DPNG_CONFIGURE_LIBPNG -O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
|
||||||
# LDSHARED=ld -b
|
# LDSHARED=ld -b
|
||||||
# SHAREDLIB=libz.sl
|
# SHAREDLIB=libz.sl
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -29,8 +29,8 @@ LIBSO=$(LIBNAME).sl
|
|||||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||||
OLDSO=libpng.sl
|
OLDSO=libpng.sl
|
||||||
OLDSOMAJ=libpng.sl.2
|
OLDSOMAJ=libpng.sl.3
|
||||||
OLDSOVER=libpng.sl.2.$(PNGMIN)
|
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
AR_RC=ar rc
|
AR_RC=ar rc
|
||||||
@@ -40,15 +40,15 @@ LN_SF=ln -sf
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
RM_F=/bin/rm -f
|
RM_F=/bin/rm -f
|
||||||
|
|
||||||
CFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
|
||||||
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
|
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
|
||||||
# Caution: be sure you have built zlib with the same CFLAGS.
|
# Caution: be sure you have built zlib with the same CFLAGS.
|
||||||
CCFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
|
CCFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \
|
||||||
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
|
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP
|
||||||
|
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng10.sl, and png.h
|
# where make install puts libpng.a, libpng12.sl, and png.h
|
||||||
prefix=/opt/libpng
|
prefix=/opt/libpng
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
@@ -93,7 +93,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -101,7 +101,7 @@ libpng-config:
|
|||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
# and license in png.h
|
# and license in png.h
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).sl
|
|||||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||||
OLDSO=libpng.sl
|
OLDSO=libpng.sl
|
||||||
OLDSOMAJ=libpng.sl.2
|
OLDSOMAJ=libpng.sl.3
|
||||||
OLDSOVER=libpng.sl.2.$(PNGMIN)
|
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
CC=gcc
|
CC=gcc
|
||||||
@@ -56,10 +56,10 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
|||||||
|
|
||||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||||
|
|
||||||
CFLAGS=-I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
|
||||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||||
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng10 -lz -lm
|
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng10 -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
LIBPATH=$(exec_prefix)/lib
|
LIBPATH=$(exec_prefix)/lib
|
||||||
@@ -103,13 +103,13 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
echo prefix=\"$(prefix)\"; \
|
echo prefix=\"$(prefix)\"; \
|
||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ ZLIBINC=/opt/zlib/include
|
|||||||
# SHAREDLIB=libz.sl
|
# SHAREDLIB=libz.sl
|
||||||
|
|
||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng10
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.0.65
|
PNGMIN = 1.2.41beta17
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
@@ -29,8 +29,8 @@ LIBSO=$(LIBNAME).sl
|
|||||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||||
OLDSO=libpng.sl
|
OLDSO=libpng.sl
|
||||||
OLDSOMAJ=libpng.sl.2
|
OLDSOMAJ=libpng.sl.3
|
||||||
OLDSOVER=libpng.sl.2.$(PNGMIN)
|
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||||
|
|
||||||
# Utilities:
|
# Utilities:
|
||||||
AR_RC=ar rc
|
AR_RC=ar rc
|
||||||
@@ -40,7 +40,7 @@ LN_SF=ln -sf
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
RM_F=/bin/rm -f
|
RM_F=/bin/rm -f
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng10.sl, and png.h
|
# where make install puts libpng.a, libpng12.sl, and png.h
|
||||||
prefix=/opt/libpng
|
prefix=/opt/libpng
|
||||||
exec_prefix=$(prefix)
|
exec_prefix=$(prefix)
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
@@ -48,9 +48,9 @@ LIBPATH=$(exec_prefix)/lib
|
|||||||
MANPATH=$(prefix)/man
|
MANPATH=$(prefix)/man
|
||||||
BINPATH=$(exec_prefix)/bin
|
BINPATH=$(exec_prefix)/bin
|
||||||
|
|
||||||
CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -DPNG_NO_MMX_CODE
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -DPNG_NO_MMX_CODE
|
||||||
# Caution: be sure you have built zlib with the same CFLAGS.
|
# Caution: be sure you have built zlib with the same CFLAGS.
|
||||||
CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
|
CCFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||||
|
|
||||||
# override DESTDIR= on the make install command line to easily support
|
# override DESTDIR= on the make install command line to easily support
|
||||||
@@ -90,7 +90,7 @@ libpng.pc:
|
|||||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||||
-e s!@libdir@!$(LIBPATH)! \
|
-e s!@libdir@!$(LIBPATH)! \
|
||||||
-e s!@includedir@!$(INCPATH)! \
|
-e s!@includedir@!$(INCPATH)! \
|
||||||
-e s!-lpng10!-lpng10\ -lz\ -lm! > libpng.pc
|
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||||
|
|
||||||
libpng-config:
|
libpng-config:
|
||||||
( cat scripts/libpng-config-head.in; \
|
( cat scripts/libpng-config-head.in; \
|
||||||
@@ -98,7 +98,7 @@ libpng-config:
|
|||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||||
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||||
echo libs=\"-lpng10 -lz -lm\"; \
|
echo libs=\"-lpng12 -lz -lm\"; \
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
cat scripts/libpng-config-body.in ) > libpng-config
|
||||||
chmod +x libpng-config
|
chmod +x libpng-config
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ LD = ilink
|
|||||||
AR = ilib
|
AR = ilib
|
||||||
RM = del
|
RM = del
|
||||||
|
|
||||||
CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3
|
CFLAGS = -DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -Mc -O2 -W3
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
# File extensions
|
# File extensions
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ CALLING=r # __fastcall
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
CC=icl -c
|
CC=icl -c
|
||||||
CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -I$(ZLIBINC) -nologo
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -I$(ZLIBINC) -nologo
|
||||||
LD=link
|
LD=link
|
||||||
LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO
|
LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ LIBPATH=$(prefix)/lib
|
|||||||
DESTDIR=
|
DESTDIR=
|
||||||
|
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-I../zlib -O
|
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I../zlib -O
|
||||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
||||||
# flags for ansi2knr
|
# flags for ansi2knr
|
||||||
ANSI2KNRFLAGS=
|
ANSI2KNRFLAGS=
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user