diff --git a/ANNOUNCE b/ANNOUNCE index 45c778212..7cd1cc877 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.6.0beta20 - March 21, 2012 +Libpng 1.6.0beta20 - March 22, 2012 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. @@ -339,10 +339,11 @@ Version 1.6.0beta19 [March 18,2012] Avoid the double gamma correction warning in the simplified API. This allows the --strict option to pass in the pngstest checks -Version 1.6.0beta20 [March 21, 2012] +Version 1.6.0beta20 [March 22, 2012] Changed chunk handler warnings into benign errors, incrementally load iCCP Recognize known sRGB ICC profiles while reading and handle them as if the sRGB chunk had appeared instead. + Added checksum-icc.c to contrib/libtests Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index b00dc8959..b8a585743 100644 --- a/CHANGES +++ b/CHANGES @@ -4090,10 +4090,11 @@ Version 1.6.0beta19 [March 18, 2012] Avoid the double gamma correction warning in the simplified API. This allows the --strict option to pass in the pngstest checks -Version 1.6.0beta20 [March 21, 2012] +Version 1.6.0beta20 [March 22, 2012] Changed chunk handler warnings into benign errors, incrementally load iCCP Recognize known sRGB ICC profiles while reading and handle them as if the sRGB chunk had appeared instead. + Added checksum-icc.c to contrib/libtests Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/libtests/checksum-icc.c b/contrib/libtests/checksum-icc.c new file mode 100644 index 000000000..85b387946 --- /dev/null +++ b/contrib/libtests/checksum-icc.c @@ -0,0 +1,89 @@ +/* checksum-icc.c + * + * Copyright (c) 2012 John Cunningham Bowler + * + * Last changed in libpng 1.6.0 [(PENDING RELEASE)] + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Generate crc32 and adler32 checksums of the given input files, used to + * generate check-codes for use when matching ICC profiles within libpng. + */ +#include + +#include + +static int +read_one_file(FILE *ip, const char *name) +{ + uLong length = 0; + uLong a32 = adler32(0, NULL, 0); + uLong c32 = crc32(0, NULL, 0); + + for (;;) + { + int ch = getc(ip); + Byte b; + + if (ch == EOF) break; + + b = (Byte)ch; + + ++length; + a32 = adler32(a32, &b, 1); + c32 = crc32(c32, &b, 1); + } + + if (ferror(ip)) + return 0; + + /* Success */ + printf("{ 0x%8.8lx, 0x%8.8lx, %lu, \"%s\" },\n", (unsigned long)a32, + (unsigned long)c32, (unsigned long)length, name); + + return 1; +} + +int main(int argc, char **argv) +{ + int err = 0; + + printf("= { /* adler32 crc32 length name */\n"); + + if (argc > 1) + { + int i; + + for (i=1; i