Imported from pngcrush-1.6.20.tar

This commit is contained in:
Glenn Randers-Pehrson
2009-07-16 07:29:18 -05:00
parent d0391a7de7
commit 4e0e854b89
11 changed files with 1735 additions and 35 deletions

View File

@@ -3,9 +3,9 @@
Change log:
Version 1.6.20 (built with libpng-1.2.38beta01 and zlib-1.2.3.2)
Made the license text identical to the actual zlib/libpng license text
found in zlib.h.
Version 1.6.20 (built with libpng-1.2.38 and zlib-1.2.3.2)
Changed local variable "write" to "wwrite" in inffast.c (zlib) to avoid
shadowed declaration warning.
Version 1.6.19 (built with libpng-1.2.37 and zlib-1.2.3.2)
Added missing braces that cause an incorrect png_error() to be issued.

View File

@@ -1,6 +1,10 @@
/* inffast.c -- fast decoding
* Copyright (C) 1995-2006 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*
* This file was modified by Glenn Randers-Pehrson, by changing the
* variable name "write" to "wwrite" to avoid a "Shadowed Declaration"
* warning.
*/
#include "zutil.h"
@@ -79,7 +83,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
unsigned wsize; /* window size or zero if not using window */
unsigned whave; /* valid bytes in the window */
unsigned write; /* window write index */
unsigned wwrite; /* window write index (pngcrush mod) */
unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
unsigned long hold; /* local strm->hold */
unsigned bits; /* local strm->bits */
@@ -106,7 +110,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
wsize = state->wsize;
whave = state->whave;
write = state->write;
wwrite = state->write;
window = state->window;
hold = state->hold;
bits = state->bits;
@@ -213,7 +217,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#endif
}
from = window - OFF;
if (write == 0) { /* very common case */
if (wwrite == 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
@@ -223,17 +227,17 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
from = out - dist; /* rest from output */
}
}
else if (write < op) { /* wrap around window */
from += wsize + write - op;
op -= write;
else if (wwrite < op) { /* wrap around window */
from += wsize + wwrite - op;
op -= wwrite;
if (op < len) { /* some from end of window */
len -= op;
do {
PUP(out) = PUP(from);
} while (--op);
from = window - OFF;
if (write < len) { /* some from start of window */
op = write;
if (wwrite < len) { /* some from start of window */
op = wwrite;
len -= op;
do {
PUP(out) = PUP(from);
@@ -243,7 +247,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
}
else { /* contiguous in window */
from += write - op;
from += wwrite - op;
if (op < len) { /* some from window */
len -= op;
do {

4
png.c
View File

@@ -16,7 +16,7 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_38rc02 Your_png_h_is_not_version_1_2_38rc02;
typedef version_1_2_38 Your_png_h_is_not_version_1_2_38;
/* Version information for C files. This had better match the version
* string defined in png.h. */
@@ -705,7 +705,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.38rc02 - June 29, 2009\n\
return ((png_charp) "\n libpng version 1.2.38 - July 16, 2009\n\
Copyright (c) 1998-2009 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");

24
png.h
View File

@@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.38rc02 - June 29, 2009
* libpng version 1.2.38 - July 16, 2009
* Copyright (c) 1998-2009 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.)
@@ -10,7 +10,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.2.38rc02 - June 29, 2009: Glenn
* libpng versions 0.97, January 1998, through 1.2.38 - July 16, 2009: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -234,7 +234,9 @@
* 1.2.45 10 10045 12.so.0.45[.0]
* 1.0.46 10 10046 10.so.0.46[.0]
* 1.2.38beta01 13 10238 12.so.0.38[.0]
* 1.2.38rc01-02 13 10238 12.so.0.38[.0]
* 1.2.38rc01-03 13 10238 12.so.0.38[.0]
* 1.0.47 10 10047 10.so.0.47[.0]
* 1.2.38 13 10238 12.so.0.38[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -266,7 +268,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.2.38rc02, June 29, 2009, are
* libpng versions 1.2.6, August 15, 2004, through 1.2.38, July 16, 2009, are
* Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@@ -378,13 +380,13 @@
* Y2K compliance in libpng:
* =========================
*
* June 29, 2009
* July 16, 2009
*
* 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.2.38rc02 are Y2K compliant. It is my belief that earlier
* upward through 1.2.38 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
@@ -440,9 +442,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.38rc02"
#define PNG_LIBPNG_VER_STRING "1.2.38"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.38rc02 - June 29, 2009\n"
" libpng version 1.2.38 - July 16, 2009\n"
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
@@ -455,7 +457,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
#define PNG_LIBPNG_VER_BUILD 02
#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
@@ -472,7 +474,7 @@
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_PRIVATE */
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_RC
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
@@ -1507,7 +1509,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_2_38rc02;
typedef png_structp version_1_2_38;
typedef png_struct FAR * FAR * png_structpp;

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.2.38rc02 - June 29, 2009
* libpng version 1.2.38 - July 16, 2009
* Copyright (c) 1998-2009 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.)
@@ -10,9 +10,9 @@
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
* This file has been modified, by Glenn Randers-Pehrson, from the original
* libpng distribution by adding a line reading
* #include "pngcrush.h"
*/
/* Any machine specific code is near the front of this file, so if you

View File

@@ -159,7 +159,9 @@
Change log:
Version 1.6.20 (built with libpng-1.2.38rc02 and zlib-1.2.3.2)
Version 1.6.20 (built with libpng-1.2.38 and zlib-1.2.3.2)
Changed local variable "write" to "wwrite" in inffast.c (zlib) to avoid
shadowed declaration warning.
Version 1.6.19 (built with libpng-1.2.37 and zlib-1.2.3.2)
Added missing braces that cause an incorrect png_error() to be issued.
@@ -3048,7 +3050,7 @@ int main(int argc, char *argv[])
}
#else
if (do_color_count)
printf(" color counting (-cc option) is disabled.\n");
printf(" color counting (-cc option) is not supported.\n");
#endif /* PNGCRUSH_COUNT_COLORS */
if (force_output_bit_depth != 0 &&

View File

@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
* Last changed in libpng 1.2.37 [June 29, 2009]
* Last changed in libpng 1.2.37 [July 16, 2009]
* Copyright (c) 1998-2009 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.)

View File

@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.2.38 [June 29, 2009]
* Last changed in libpng 1.2.38 [July 16, 2009]
* Copyright (c) 1998-2009 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.)

View File

@@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file
*
* Last changed in libpng 1.2.38 [June 29, 2009]
* Last changed in libpng 1.2.38 [July 16, 2009]
* Copyright (c) 1998-2009 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.)

View File

@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.2.38 [June 29, 2009]
* Last changed in libpng 1.2.38 [July 16, 2009]
* Copyright (c) 1998-2009 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.)

1692
pngtest.c Normal file

File diff suppressed because it is too large Load Diff