diff --git a/README.txt b/README.txt index 6c8d61c9f..37c76346d 100644 --- a/README.txt +++ b/README.txt @@ -10,12 +10,18 @@ This is the copyright notice, disclaimer, and license: * * Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson (randeg@alum.rpi.edu) * - * The pngcrush program is supplied "AS IS". The Author disclaims all + * The pngcrush computer program is supplied "AS IS". The Author disclaims all * warranties, expressed or implied, including, without limitation, the * warranties of merchantability and of fitness for any purpose. The * Author assumes no liability for direct, indirect, incidental, special, * exemplary, or consequential damages, which may result from the use of - * the pngcrush program, even if advised of the possibility of such damage. + * the computer program, even if advised of the possibility of such damage. + * There is no warranty against interference with your enjoyment of the + * computer program or against infringement. There is no warranty that my + * efforts or the computer program will fulfill any of your particular purposes + * or needs. This computer program is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is with + * the user. * * Permission is hereby granted to anyone to use, copy, modify, and distribute * this source code, or portions hereof, for any purpose, without fee, subject @@ -33,13 +39,14 @@ This is the copyright notice, disclaimer, and license: This is the output of "pngcrush" and "pngcrush -help": - | pngcrush 1.4.5, Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson + + | pngcrush 1.5.0, Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson | This is a free, open-source program. Permission is | granted to everyone to use pngcrush without fee. - | This program was built with libpng version 1.0.7rc2, - | Copyright (C) 1995, Guy Eric Schalnat, Group 42 Inc., - | Copyright (C) 1996, 1997 Andreas Dilger, + | This program was built with libpng version 1.0.8, | Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson, + | Copyright (C) 1996, 1997 Andreas Dilger, + | Copyright (C) 1995, Guy Eric Schalnat, Group 42 Inc., | and zlib version 1.1.3pc, Copyright (C) 1998, | Jean-loup Gailly and Mark Adler. @@ -48,6 +55,7 @@ usage: pngcrush [options] infile.png outfile.png pngcrush -e ext [other options] files.png ... pngcrush -d dir [other options] files.png ... options: + -already already_crushed_size [e.g., 8192]) -brute (Use brute-force, try 114 different methods [11-124]) -c color_type of output file [0, 2, 4, or 6] -d directory_name (where output files will go) @@ -73,15 +81,31 @@ options: -v (display more detailed information) -version (display the pngcrush version) -w compression_window_size [32, 16, 8, 4, 2, 1, 512] - -h (help) + -h (help and legal notices) -p (pause) + | pngcrush 1.5.0, Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson + | This is a free, open-source program. Permission is + | granted to everyone to use pngcrush without fee. + | This program was built with libpng version 1.0.8, + | Copyright (C) 1998, 1999, 2000 Glenn Randers-Pehrson, + | Copyright (C) 1996, 1997 Andreas Dilger, + | Copyright (C) 1995, Guy Eric Schalnat, Group 42 Inc., + | and zlib version 1.1.3pc, Copyright (C) 1998, + | Jean-loup Gailly and Mark Adler. + + usage: pngcrush [options] infile.png outfile.png pngcrush -e ext [other options] files.png ... pngcrush -d dir [other options] files.png ... options: + -already already_crushed_size [e.g., 8192]) + + If file has an IDAT greater than this size, it + will be considered to be already crushed. + -brute (Use brute-force, try 114 different methods [11-124]) Very time-consuming and generally not worthwhile. @@ -238,7 +262,7 @@ options: zTXt chunk to insert (see -text). - -h (help) + -h (help and legal notices) Display this information. @@ -247,4 +271,3 @@ options: Wait for [enter] key before continuing display. e.g., type 'pngcrush -pause -help', if the help screen scrolls out of sight. - diff --git a/png.c b/png.c index 325e1d01f..1b2531cd1 100644 --- a/png.c +++ b/png.c @@ -1,7 +1,7 @@ /* png.c - location for general purpose libpng functions * - * libpng version 1.0.8rc1 - July 17, 2000 + * libpng version 1.0.8 - July 24, 2000 * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -13,14 +13,14 @@ #include "png.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_0_8rc1 Your_png_h_is_not_version_1_0_8rc1; +typedef version_1_0_8 Your_png_h_is_not_version_1_0_8; /* Version information for C files. This had better match the version * string defined in png.h. */ #ifdef PNG_USE_GLOBAL_ARRAYS /* png_libpng_ver was changed to a function in version 1.0.5c */ -char png_libpng_ver[12] = "1.0.8rc1"; +char png_libpng_ver[12] = "1.0.8"; /* png_sig was changed to a function in version 1.0.5c */ /* Place to hold the signature string for a PNG file. */ @@ -625,7 +625,7 @@ png_charp PNGAPI png_get_copyright(png_structp png_ptr) { if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */ - return ((png_charp) "\n libpng version 1.0.8rc1 - July 17, 2000\n\ + return ((png_charp) "\n libpng version 1.0.8 - July 24, 2000\n\ Copyright (c) 1998-2000 Glenn Randers-Pehrson\n\ Copyright (c) 1996, 1997 Andreas Dilger\n\ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n"); @@ -643,8 +643,8 @@ png_get_libpng_ver(png_structp png_ptr) { /* Version of *.c files used when building libpng */ if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */ - return((png_charp) "1.0.8rc1"); - return((png_charp) "1.0.8rc1"); + return((png_charp) "1.0.8"); + return((png_charp) "1.0.8"); } png_charp PNGAPI diff --git a/png.h b/png.h index aeb86ef63..0d8e0dc1b 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.0.8rc1 - July 17, 2000 + * libpng version 1.0.8 - July 24, 2000 * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -9,7 +9,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.0.8rc1 - July 17, 2000: Glenn + * libpng versions 0.97, January 1998, through 1.0.8 - July 24, 2000: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -57,6 +57,7 @@ * 1.0.7 10007 (still compatible) * 1.0.8beta1-4 10008 2.1.0.8beta1-4 * 1.0.8rc1 10008 2.1.0.8rc1 + * 1.0.8 10008 2.1.0.8 * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -83,9 +84,9 @@ * If you modify libpng you may insert additional notices immediately following * this sentence. * - * libpng version 1.0.8rc1, July 17, 2000, is - * Copyright (c) 2000 Glenn Randers-Pehrson - * Distributed according to the same disclaimer and license as libpng-1.0.6 + * libpng versions 1.0.7, July 1, 2000, through 1.0.8, July 24, 2000, are + * Copyright (c) 2000 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 @@ -188,13 +189,13 @@ * Y2K compliance in libpng: * ========================= * - * July 17, 2000 + * July 24, 2000 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.0.8rc1 are Y2K compliant. It is my belief that earlier + * upward through 1.0.8 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * * Libpng only has three year fields. One is a 2-byte unsigned integer @@ -250,7 +251,7 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.0.8rc1" +#define PNG_LIBPNG_VER_STRING "1.0.8" #define PNG_LIBPNG_VER_SONUM 2 @@ -260,7 +261,7 @@ #define PNG_LIBPNG_VER_RELEASE 8 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ -#define PNG_LIBPNG_VER_BUILD 1 +#define PNG_LIBPNG_VER_BUILD 0 /* Careful here. At one time, Guy wanted to use 082, but that would be octal. * We must not include leading zeros. @@ -1148,9 +1149,9 @@ struct png_struct_def }; /* This prevents a compiler error in png_get_copyright() in png.c if png.c -and png.h are both at * version 1.0.8rc1 +and png.h are both at * version 1.0.8 */ -typedef png_structp version_1_0_8rc1; +typedef png_structp version_1_0_8; typedef png_struct FAR * FAR * png_structpp; @@ -2182,7 +2183,7 @@ extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr) extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.0.8rc1 - July 17, 2000 (header)\n" + " libpng version 1.0.8 - July 24, 2000 (header)\n" #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on diff --git a/pngasmrd.h b/pngasmrd.h index 3e08d6c94..35fe3b242 100644 --- a/pngasmrd.h +++ b/pngasmrd.h @@ -1,6 +1,6 @@ /* pngasmrd.h - assembler version of utilities to read a PNG file * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1999, 2000 Glenn Randers-Pehrson * diff --git a/pngconf.h b/pngconf.h index ac5a96b95..4769cdf5f 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,6 +1,6 @@ /* pngconf.h - machine configurable file for libpng * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngcrush.c b/pngcrush.c index c23cb70da..efbed08d5 100644 --- a/pngcrush.c +++ b/pngcrush.c @@ -16,7 +16,7 @@ * occasionally creating Linux executables. */ -#define PNGCRUSH_VERSION "1.4.8" +#define PNGCRUSH_VERSION "1.5.0" /* */ @@ -57,6 +57,13 @@ */ /* Change log: + * + * Version 1.5.0 (built with libpng-1.0.8) + * + * After encountering an image with a bad Photoshop iCCP chunk, pngcrush + * 1.4.5 through 1.4.8 write sRGB and gAMA=45455 chunks in all + * remaining PNG files on the command line. This has been fixed so the + * correction is only applied to the particular bad input file. * * Version 1.4.8 (built with libpng-1.0.8rc1) * @@ -107,7 +114,7 @@ * * Version 1.4.4 (built with libpng-1.0.6i and cexcept-0.6.3) * - * Can be built on RISC OS platforms. + * Can be built on RISC OS platforms, thanks to Darren Salt. * * Version 1.4.3 (built with libpng-1.0.6h and cexcept-0.6.3) * @@ -504,9 +511,11 @@ static int plte_len=-1; #ifdef PNG_gAMA_SUPPORTED # ifdef PNG_FIXED_POINT_SUPPORTED static int specified_gamma=0; +static int image_specified_gamma=0; static int force_specified_gamma=0; # else static double specified_gamma=0.0; +static double image_specified_gamma=0; static double force_specified_gamma=0.0; # endif static int double_gamma=0; @@ -1967,6 +1976,8 @@ main(int argc, char *argv[]) free(png_row_filters); png_row_filters=NULL; } + image_specified_gamma=0; + inname=argv[names++]; if(inname == NULL) @@ -2758,7 +2769,7 @@ main(int argc, char *argv[]) #if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_WRITE_gAMA_SUPPORTED) { - if(force_specified_gamma > 0) + if(force_specified_gamma) { if(first_trial) { @@ -2790,6 +2801,8 @@ main(int argc, char *argv[]) { if(keep_chunk("gAMA",argv)) { + if(image_specified_gamma) + file_gamma=image_specified_gamma; if(verbose > 1 && first_trial) #ifdef PNG_FIXED_POINT_SUPPORTED fprintf(STDERR, " gamma=(%d/100000)\n", (int)file_gamma); @@ -2804,7 +2817,7 @@ main(int argc, char *argv[]) #endif } } - else if(specified_gamma > 0) + else if(specified_gamma) { if(first_trial) { @@ -3919,9 +3932,9 @@ png_measure_idat(png_structp png_ptr) " Replacing bad Photoshop ICCP chunk with an sRGB chunk\n"); #ifdef PNG_gAMA_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED - specified_gamma=45455L; + image_specified_gamma=45455L; #else - specified_gamma=0.45455; + image_specified_gamma=0.45455; #endif #endif intent=0; diff --git a/pngerror.c b/pngerror.c index cf7930812..3e4210f75 100644 --- a/pngerror.c +++ b/pngerror.c @@ -1,7 +1,7 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pnggccrd.c b/pnggccrd.c index 24115aa66..ea4f972b5 100644 --- a/pnggccrd.c +++ b/pnggccrd.c @@ -6,7 +6,7 @@ * and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm * for Intel's performance analysis of the MMX vs. non-MMX code. * - * libpng version 1.0.8rc1 - July 17, 2000 + * libpng version 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation diff --git a/pngget.c b/pngget.c index ef63066f5..266dc3b17 100644 --- a/pngget.c +++ b/pngget.c @@ -1,7 +1,7 @@ /* pngget.c - retrieval of values from info struct * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngmem.c b/pngmem.c index 12126bc42..22c77beed 100644 --- a/pngmem.c +++ b/pngmem.c @@ -1,7 +1,7 @@ /* pngmem.c - stub functions for memory allocation * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngpread.c b/pngpread.c index e621cc8b5..6dfd01803 100644 --- a/pngpread.c +++ b/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngread.c b/pngread.c index ac652085a..d1cbc512d 100644 --- a/pngread.c +++ b/pngread.c @@ -1,7 +1,7 @@ /* pngread.c - read a PNG file * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -698,7 +698,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) * not called png_set_interlace_handling(), the display_row buffer will * be ignored, so pass NULL to it. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.8rc1 + * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.8 */ void PNGAPI @@ -747,7 +747,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row, * only call this function once. If you desire to have an image for * each pass of a interlaced image, use png_read_rows() instead. * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.8rc1 + * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.8 */ void PNGAPI png_read_image(png_structp png_ptr, png_bytepp image) diff --git a/pngrio.c b/pngrio.c index 8e9a6b36b..b6e592254 100644 --- a/pngrio.c +++ b/pngrio.c @@ -1,7 +1,7 @@ /* pngrio.c - functions for data input * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngrtran.c b/pngrtran.c index d84c6a2bc..da75f0a85 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -1,7 +1,7 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngrutil.c b/pngrutil.c index 2be3c87b8..fc6242050 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngset.c b/pngset.c index eb6fb9e40..60923288d 100644 --- a/pngset.c +++ b/pngset.c @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngtrans.c b/pngtrans.c index 77d69b5f6..b974a66ae 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -1,7 +1,7 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngvcrd.c b/pngvcrd.c index c446bf308..ed09aaea8 100644 --- a/pngvcrd.c +++ b/pngvcrd.c @@ -2,7 +2,7 @@ * * For Intel x86 CPU and Microsoft Visual C++ compiler * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, Intel Corporation diff --git a/pngwio.c b/pngwio.c index 9e61616de..c70062426 100644 --- a/pngwio.c +++ b/pngwio.c @@ -1,7 +1,7 @@ /* pngwio.c - functions for data output * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngwrite.c b/pngwrite.c index ad83cdf9f..167e77056 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1,7 +1,7 @@ /* pngwrite.c - general routines to write a PNG file * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngwtran.c b/pngwtran.c index 78999eafb..257ccd13c 100644 --- a/pngwtran.c +++ b/pngwtran.c @@ -1,7 +1,7 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngwutil.c b/pngwutil.c index b41447407..fb702c986 100644 --- a/pngwutil.c +++ b/pngwutil.c @@ -1,7 +1,7 @@ /* pngwutil.c - utilities to write a PNG file * - * libpng 1.0.8rc1 - July 17, 2000 + * libpng 1.0.8 - July 24, 2000 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)