Imported from libpng-1.2.0beta4.tar

This commit is contained in:
Glenn Randers-Pehrson 2001-06-23 08:03:17 -05:00
parent 8b6a889881
commit b182893c04
77 changed files with 419 additions and 10429 deletions

View File

@ -1,26 +1,23 @@
Libpng 1.2.0beta3 - May 18, 2001
Libpng 1.2.0beta4 - June 23, 2001
This is a public release of libpng, intended for use in production codes.
Changes since the last public release (1.0.11):
Changes since the last public release (1.0.12):
Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot)
Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h
Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings.
Enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED
by default.
Added runtime selection of MMX features.
Added png_set_strip_error_numbers function and related macros.
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
Eliminated the png_error about apps using png_read|write_init(). Instead,
libpng will reallocate the png_struct and info_struct if they are too small.
This retains future binary compatibility for old applications written for
libpng-0.88 and earlier.
Enabled user memory function by default.
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.
Bumped shared-library (so-number) and dll-number to 3.
Updated contrib/gregbook
Updated makefile.ibmc
Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes
of png_write_oFFS width and height from png_uint_32 to png_int_32.
Updated example.c
Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

16
CHANGES
View File

@ -948,11 +948,25 @@ version 1.2.0beta1 [May 6, 2001]
version 1.2.0beta2 [May 7, 2001]
Finished merging 1.2.0beta1 with version 1.0.11
Added a check for attempts to read or write PLTE in grayscale PNG datastreams.
version 1.2.0beta3 [May 18, 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.
Increased png_mng_features flag from png_byte to png_uint_32.
Bumped shared-library (so-number) and dll-number to 3.
version 1.2.0beta4 [June 23, 2001]
Check for missing profile length field in iCCP chunk and free chunk_data
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
if user attempts to run it on an 8-bit display.
Updated contrib/gregbook
Use png_malloc instead of png_zalloc to allocate palette in pngset.c
Updated makefile.ibmc
Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes
of png_write_oFFS width and height from png_uint_32 to png_int_32.
Updated example.c
Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

24
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.2.0beta3 - May 18, 2001
Installing libpng version 1.2.0beta4 - June 23, 2001
Before installing libpng, you must first install zlib. zlib
can usually be found wherever you got libpng. zlib can be
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
version of zlib that's installed.
You can rename the directories that you downloaded (they
might be called "libpng-1.2.0beta3" or "lpng109" and "zlib-1.1.3"
might be called "libpng-1.2.0beta4" or "lpng109" and "zlib-1.1.3"
or "zlib113") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
@ -31,7 +31,8 @@ Your directory structure should look like this:
beos
borland
msvc
wince
netware.txt
wince.txt
scripts
makefile.*
pngtest.png
@ -48,9 +49,12 @@ distribution of libpng. It is available in both tar.gz (UNIX style line
endings) and zip (DOS style line endings) formats.
If you are building libpng with MSVC, you can enter the libpng\msvc directory
and follow the instructions in msvc\README.txt. You can build libpng for
WindowsCE by entering the libpng\wince directory and following the
instructions in the README* files.
and follow the instructions in msvc\README.txt.
You can build libpng for WindowsCE by entering the downloading and installing
the libpng\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 as instructed in projects\netware.txt.
Else enter the zlib directory and follow the instructions in zlib/README,
then come back here and choose the appropriate makefile.sys in the scripts
@ -60,8 +64,8 @@ The files that are presently available in the scripts directory
include
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.2.0beta3)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.2.0beta3,
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.2.0beta4)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.2.0beta4,
uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -78,9 +82,9 @@ include
makefile.macosx => MACOS X Makefile
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.2.0beta3)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.2.0beta4)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.2.0beta3)
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.2.0beta4)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile

View File

@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.0.7, July 1, 2000, through 1.2.0beta3, May 18, 2001, are
libpng versions 1.0.7, July 1, 2000, through 1.2.0beta4, June 23, 2001, 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
@ -99,4 +99,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
randeg@alum.rpi.edu
May 18, 2001
June 23, 2001

18
README
View File

@ -1,4 +1,4 @@
README for libpng 1.2.0beta3 - May 18, 2001 (shared library 2.1)
README for libpng 1.2.0beta4 - June 23, 2001 (shared library 2.1)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@ -177,15 +177,19 @@ Files in this distribution:
and zlib
msvc => Contains a Microsoft Visual C++ (MSVC) workspace
for building libpng and zlib
wince => Contains a Microsoft Visual C++ (Windows CD Toolkit)
workspace for building libpng and zlib on WindowsCE
netware.txt => Contains instructions for downloading a set of
project files for building libpng and zlib on
Netware.
wince.txt => Contains instructions for downloading a Microsoft
Visual C++ (Windows CD Toolkit) workspace for
building libpng and zlib on WindowsCE
scripts => Directory containing scripts for building libpng:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng.so.2.1.2.0beta3)
(gcc, creates libpng.so.2.1.2.0beta4)
makefile.gcmmx => Linux/ELF makefile (gcc, creates
libpng.so.2.1.2.0beta3, uses assembler code
libpng.so.2.1.2.0beta4, uses assembler code
tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -202,10 +206,10 @@ Files in this distribution:
makefile.macosx => MACOS X Makefile
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.2.0beta3)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.2.0beta4)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng.so.2.1.2.0beta3)
(gcc, creates libpng.so.2.1.2.0beta4)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile

View File

@ -1,13 +1,13 @@
Y2K compliance in libpng:
=========================
May 18, 2001
June 23, 2001
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.0beta3 are Y2K compliant. It is my belief that earlier
upward through 1.2.0beta4 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

2
configure vendored
View File

@ -1,5 +1,5 @@
echo "
There is no \"configure\" script for Libpng-1.2.0beta3. Instead, please
There is no \"configure\" script for Libpng-1.2.0beta4. Instead, please
copy the appropriate makefile for your system from the \"scripts\"
directory. Read the INSTALL file for more details.
"

View File

@ -1,6 +1,6 @@
# Sample makefile for rpng-x / rpng2-x / wpng using gcc and make.
# Greg Roelofs
# Last modified: 28 February 2000
# Last modified: 7 February 2001
#
# The programs built by this makefile are described in the book,
# "PNG: The Definitive Guide," by Greg Roelofs (O'Reilly and
@ -27,20 +27,20 @@ PNGINC = -I/usr/local/include
#PNGLIB = -L/usr/local/lib -lpng # dynamically linked against libpng
PNGLIB = /usr/local/lib/libpng.a # statically linked against libpng
# or:
#PNGINC = -I../..
#PNGLIB = -L../.. -lpng
#PNGLIB = ../../libpng.a
#PNGINC = -I../libpng
#PNGLIB = -L../libpng -lpng
#PNGLIB = ../libpng/libpng.a
ZINC = -I/usr/local/include
#ZLIB = -L/usr/local/lib -lz # dynamically linked against zlib
ZLIB = /usr/local/lib/libz.a # statically linked against zlib
#ZINC = -I../zlib
#ZLIB = -L../zlib -lz
#ZLIB = ../../../zlib/libz.a
#ZLIB = ../zlib/libz.a
#XINC = -I/usr/include/X11 # old-style, stock X distributions
#XINC = -I/usr/include # old-style, stock X distributions
#XLIB = -L/usr/lib/X11 -lX11
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
#XLIB = -L/usr/openwin/lib -lX11
XINC = -I/usr/X11R6/include # new X distributions (XFree86, etc.)
XLIB = -L/usr/X11R6/lib -lX11

View File

@ -32,12 +32,12 @@
# macros --------------------------------------------------------------------
PNGPATH = ../..
PNGPATH = ../libpng
PNGINC = -I$(PNGPATH)
#PNGLIB = $(PNGPATH)/pngdll.lib
PNGLIB = $(PNGPATH)/libpng.lib
ZPATH = ../../../zlib
ZPATH = ../zlib
ZINC = -I$(ZPATH)
#ZLIB = $(ZPATH)/zlibdll.lib
ZLIB = $(ZPATH)/zlibstat.lib

View File

@ -16,13 +16,12 @@ of PBMPLUS/NetPBM) and converts them to PNG.
The source code for all three demo programs currently compiles under
Unix, OpenVMS, and 32-bit Windows. (Special thanks to Martin Zinser,
zinser@decus.de, for making the necessary changes for OpenVMS and for
providing an appropriate build script.) Build instructions can be
found below.
providing an appropriate build script.) Build instructions can be found
below.
Files:
README this file
README.w32 additional Windows-specific information
LICENSE terms of distribution and reuse (BSD-like)
Makefile.unx Unix makefile
@ -46,25 +45,26 @@ Files:
toucan.png transparent PNG for testing (by Stefan Schneider)
Note that the programs are designed to be functional, but their primary
purpose is to demonstrate how to use libpng to add PNG support to other
purpose is to illustrate how to use libpng to add PNG support to other
programs. As such, their user interfaces are crude and definitely not
intended for everyday use.
Please see http://www.cdrom.com/pub/png/pngbook.html for further infor-
Please see http://www.libpng.org/pub/png/pngbook.html for further infor-
mation and links to the latest version of the source code, and Chapters
13-15 of the book for detailed discussion of the three programs.
Greg Roelofs
19 March 2000
newt@pobox.com
30 May 2001
BUILD INSTRUCTIONS
- Prerequisites:
- Prerequisites (in order of compilation):
- zlib ftp://ftp.cdrom.com/pub/infozip/zlib/zlib.html
- libpng http://www.cdrom.com/pub/png/pngcode.html
- pngbook http://www.cdrom.com/pub/png/book/sources.html
- zlib http://www.gzip.org/zlib/
- libpng http://www.libpng.org/pub/png/libpng.html
- pngbook http://www.libpng.org/pub/png/book/sources.html
The pngbook demo programs are explicitly designed to demonstrate proper
coding techniques for using the libpng reference library. As a result,
@ -128,11 +128,13 @@ BUILD INSTRUCTIONS
The result should be three executables: rpng-win.exe, rpng2-win.exe,
and wpng.exe. Copy them somewhere in your PATH or run them from the
current folder. Unlike the Unix versions, the two windowed programs
(rpng and rpng2) do not display a usage screen when invoked without
command-line arguments; see README.w32 for brief help or the book for
details. Note that the programs use the Unix-style "-" character to
specify options, instead of the more common DOS/Windows "/" character.
current folder. Like the Unix versions, the two windowed programs
(rpng and rpng2) now display a usage screen in a console window when
invoked without command-line arguments; this is new behavior as of
the May 2001 release. Note that the programs use the Unix-style "-"
character to specify options, instead of the more common DOS/Windows
"/" character. (For example: "rpng2-win -bgpat 4 foo.png", not
"rpng2-win /bgpat 4 foo.png")
- OpenVMS:

View File

@ -1,5 +1,5 @@
See the main README file for basic instructions on compiling and running
the programs. See http://www.cdrom.com/pub/png/pngbook.html for further
the programs. See http://www.libpng.org/pub/png/pngbook.html for further
information and links to the source code, and Chapters 13-15 of the book
for detailed discussion of the three programs.

View File

@ -9,21 +9,22 @@ $! Set locations where zlib and libpng sources live.
$!
$ zpath = ""
$ pngpath = ""
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
$!
$ if f$search("[---.zlib]zlib.h").nes."" then zpath = "[---.zlib]"
$ if f$search("[--]png.h").nes."" then pngpath = "[--]"
$!
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
$!
$ if zpath .eqs. ""
$ then
$ write sys$output "Zlib include not found. Exiting..."
$ write sys$output "zlib include not found. Exiting..."
$ exit 2
$ endif
$!
$ if pngpath .eqs. ""
$ then
$ write sys$output "Libpng include not found. Exiting..."
$ write sys$output "libpng include not found. Exiting..."
$ exit 2
$ endif
$!

View File

@ -239,7 +239,7 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
return NULL;
}
Trace((stderr, "readpng_get_image: rowbytes = %ld, height = %ld\n", rowbytes, height));
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", *pChannels, rowbytes, height));
/* set the individual row_pointers to point at the correct offsets */

View File

@ -117,8 +117,8 @@ void readpng2_version_info(void)
}
}
#else
fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n",
PNG_LIBPNG_VER_STRING, png_libpng_ver);
fprintf(stderr, " Compiled with libpng %s; using libpng %s "
"without MMX support.\n", PNG_LIBPNG_VER_STRING, png_libpng_ver);
#endif
fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n",
@ -530,7 +530,6 @@ static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr)
(*mainprog_ptr->mainprog_finish_display)();
info_ptr = info_ptr; /* without this the compiler whines about info_ptr */
/* all done */

View File

@ -9,7 +9,6 @@
with a little tweaking (or maybe not).
to do:
- stdout/stderr don't work! need message window (maybe scrollable?)
- handle quoted command-line args (especially filenames with spaces)
- have minimum window width: oh well
- use %.1023s to simplify truncation of title-bar string?
@ -22,10 +21,11 @@
match; switched to png_jmpbuf() macro
- 1.02: added extra set of parentheses to png_jmpbuf() macro; fixed
command-line parsing bug
- 1.10: enabled "message window"/console (thanks to David Geldreich)
---------------------------------------------------------------------------
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
This software is provided "as is," without warranty of any kind,
express or implied. In no event shall the author or contributors
@ -52,13 +52,14 @@
#define PROGNAME "rpng-win"
#define LONGNAME "Simple PNG Viewer for Windows"
#define VERSION "1.02 of 19 March 2000"
#define VERSION "1.20 of 28 May 2001"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <windows.h>
#include <conio.h> /* only for _getch() */
/* #define DEBUG : this enables the Trace() macros */
@ -128,7 +129,17 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
filename = (char *)NULL;
/* First set the default value for our display-system exponent, i.e.,
/* First reenable console output, which normally goes to the bit bucket
* for windowed apps. Closing the console window will terminate the
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
* incantation. */
AllocConsole();
freopen("CONOUT$", "a", stderr);
freopen("CONOUT$", "a", stdout);
/* Next set the default value for our display-system exponent, i.e.,
* the product of the CRT exponent and the exponent corresponding to
* the frame-buffer's lookup table (LUT), if any. This is not an
* exhaustive list of LUT values (e.g., OpenStep has a lot of weird
@ -272,20 +283,31 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
/* usage screen */
if (error) {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
int ch;
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
readpng_version_info();
fprintf(stderr, "\n"
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
" exp \ttransfer-function exponent (``gamma'') of the display\n"
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
"\t\t to the product of the lookup-table exponent (varies)\n"
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
" bg \tdesired background color in 7-character hex RGB format\n"
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
"\t\t used with transparent images\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
"\n", PROGNAME, default_display_exponent);
"Usage: %s [-gamma exp] [-bgcolor bg] file.png\n"
" exp \ttransfer-function exponent (``gamma'') of the display\n"
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
"\t\t to the product of the lookup-table exponent (varies)\n"
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
" bg \tdesired background color in 7-character hex RGB format\n"
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
"\t\t used with transparent images\n"
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
"Press Q or Esc to quit this usage screen.\n"
"\n", PROGNAME, default_display_exponent);
do
ch = _getch();
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
exit(1);
} else {
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
fprintf(stderr,
"\n [console window: closing this window will terminate %s]\n\n",
PROGNAME);
}

View File

@ -21,10 +21,11 @@
- 1.10: added support for non-default visuals; fixed X pixel-conversion
- 1.11: added extra set of parentheses to png_jmpbuf() macro; fixed
command-line parsing bug
- 1.12: fixed small X memory leak (thanks to Francois Petitjean)
---------------------------------------------------------------------------
Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
Copyright (c) 1998-2001 Greg Roelofs. All rights reserved.
This software is provided "as is," without warranty of any kind,
express or implied. In no event shall the author or contributors
@ -51,7 +52,7 @@
#define PROGNAME "rpng-x"
#define LONGNAME "Simple PNG Viewer for X"
#define VERSION "1.11 of 19 March 2000"
#define VERSION "1.12 of 28 May 2001"
#include <stdio.h>
#include <stdlib.h>
@ -542,6 +543,16 @@ static int rpng_x_create_window(void)
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
size_hints, wm_hints, NULL);
/* various properties and hints no longer needed; free memory */
if (pWindowName)
XFree(pWindowName->value);
if (pIconName)
XFree(pIconName->value);
if (size_hints)
XFree(size_hints);
if (wm_hints)
XFree(wm_hints);
XMapWindow(display, window);
gc = XCreateGC(display, window, 0, &gcvalues);

View File

@ -24,7 +24,7 @@
- 1.03: modified to allow abbreviated options
- 1.04: removed bogus extra argument from usage fprintf() [Glenn R-P?];
fixed command-line parsing bug
- 1.10: enabled "message window" (console), thanks to David Geldreich
- 1.10: enabled "message window"/console (thanks to David Geldreich)
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
---------------------------------------------------------------------------
@ -56,7 +56,7 @@
#define PROGNAME "rpng2-win"
#define LONGNAME "Progressive PNG Viewer for Windows"
#define VERSION "1.20 of 29 January 2001"
#define VERSION "1.20 of 28 May 2001"
#include <stdio.h>
#include <stdlib.h>

View File

@ -26,6 +26,7 @@
- 1.11: added -usleep option for demos; fixed command-line parsing bug
- 1.12: added -pause option for demos and testing
- 1.20: added runtime MMX-enabling/disabling and new -mmx* options
- 1.21: fixed small X memory leak (thanks to Francois Petitjean)
---------------------------------------------------------------------------
@ -56,7 +57,7 @@
#define PROGNAME "rpng2-x"
#define LONGNAME "Progressive PNG Viewer for X"
#define VERSION "1.20 of 29 January 2001"
#define VERSION "1.21 of 30 May 2001"
#include <stdio.h>
#include <stdlib.h>
@ -585,8 +586,15 @@ static void rpng2_x_init(void)
* pattern */
if (rpng2_x_create_window()) {
/* GRR TEMPORARY HACK: this is fundamentally no different from cases
* above; libpng should longjmp() back to us when png_ptr goes away.
* If we/it segfault instead, seems like a libpng bug... */
/* we're here via libpng callback, so if window fails, clean and bail */
readpng2_cleanup(&rpng2_info);
return;
rpng2_x_cleanup();
exit(2);
}
}
@ -738,6 +746,16 @@ static int rpng2_x_create_window(void)
XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
size_hints, wm_hints, NULL);
/* various properties and hints no longer needed; free memory */
if (pWindowName)
XFree(pWindowName->value);
if (pIconName)
XFree(pIconName->value);
if (size_hints)
XFree(size_hints);
if (wm_hints)
XFree(wm_hints);
XMapWindow(display, window);
gc = XCreateGC(display, window, 0, &gcvalues);

View File

@ -194,17 +194,17 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
/* Expand paletted colors into true RGB triplets */
if (color_type == PNG_COLOR_TYPE_PALETTE)
png_set_expand(png_ptr);
png_set_palette_rgb(png_ptr);
/* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
png_set_expand(png_ptr);
png_set_gray_1_2_4_to_8(png_ptr);
/* Expand paletted or RGB images with transparency to full alpha channels
* so the data will be available as RGBA quartets.
*/
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_expand(png_ptr);
png_set_tRNS_to_alpha(png_ptr);
/* Set the background color to draw transparent and alpha images over.
* It is possible to set the red, green, and blue components directly
@ -362,8 +362,6 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
{
#ifdef sparkle /* Read the image using the "sparkle" effect. */
png_read_rows(png_ptr, &row_pointers[y], NULL, number_of_rows);
png_read_rows(png_ptr, NULL, row_pointers[y], number_of_rows);
#else no_sparkle /* Read the image using the "rectangle" effect */
png_read_rows(png_ptr, NULL, &row_pointers[y], number_of_rows);
#endif no_sparkle /* use only one of these two methods */

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "May 18, 2001"
.TH LIBPNG 3 "June 23, 2001"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.0beta3
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.0beta4
.SH SYNOPSIS
\fI\fB
@ -787,7 +787,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.0beta3 - May 18, 2001
libpng version 1.2.0beta4 - June 23, 2001
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998-2001 Glenn Randers-Pehrson
@ -2034,8 +2034,7 @@ or png_destroy_*() is supposed to free the data. When the user assumes
responsibility for libpng-allocated data, the application must use
png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it (the png_zalloc() function is the same
as png_malloc() except that it also zeroes the newly-allocated memory).
or png_zalloc() to allocate it.
If you allocated your row_pointers in a single block, as suggested above in
the description of the high level read interface, you must not transfer
@ -3606,13 +3605,13 @@ application:
.SH IX. Y2K Compliance in libpng
May 18, 2001
June 23, 2001
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.0beta3 are Y2K compliant. It is my belief that earlier
upward through 1.2.0beta4 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that
@ -3724,10 +3723,12 @@ the first widely used release:
1.0.11beta1-3 1 10011 2.1.0.11beta1-3
1.0.11rc1 1 10011 2.1.0.11rc1
1.0.11 1 10011 2.1.0.11
1.0.12a 2 10012 2.1.0.12a
1.1.0a-f 10100 2.1.1.0a-f abandoned
1.0.12beta1-2 2 10012 2.1.0.12beta1-2
1.0.12rc1 2 10012 2.1.0.12rc1
1.0.12 2 10012 2.1.0.12
1.1.0a-f - 10100 2.1.1.0a-f abandoned
1.2.0beta1-2 2 10200 2.1.2.0beta1-2
1.2.0beta3 3 10200 3.1.2.0beta3
1.2.0beta3-4 3 10200 3.1.2.0beta3-4
Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be
@ -3785,7 +3786,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.2.0beta3 - May 18, 2001:
Libpng version 1.2.0beta4 - June 23, 2001:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
@ -3802,7 +3803,7 @@ included in the libpng distribution, the latter shall prevail.)
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.0.7, July 1, 2000, through 1.2.0beta3, May 18, 2001, are
libpng versions 1.0.7, July 1, 2000, through 1.2.0beta4, June 23, 2001, are
Copyright (c) 2000-2001 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
@ -3894,7 +3895,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
randeg@alum.rpi.edu
May 18, 2001
June 23, 2001
.\" end of man page

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.0beta3 - May 18, 2001
libpng version 1.2.0beta4 - June 23, 2001
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998-2001 Glenn Randers-Pehrson
@ -1247,8 +1247,7 @@ or png_destroy_*() is supposed to free the data. When the user assumes
responsibility for libpng-allocated data, the application must use
png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it (the png_zalloc() function is the same
as png_malloc() except that it also zeroes the newly-allocated memory).
or png_zalloc() to allocate it.
If you allocated your row_pointers in a single block, as suggested above in
the description of the high level read interface, you must not transfer
@ -2819,13 +2818,13 @@ application:
IX. Y2K Compliance in libpng
May 18, 2001
June 23, 2001
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.0beta3 are Y2K compliant. It is my belief that earlier
upward through 1.2.0beta4 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "May 18, 2001"
.TH LIBPNGPF 3 "June 23, 2001"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.0beta3
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.0beta4
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP

2
png.5
View File

@ -1,4 +1,4 @@
.TH PNG 5 "May 18, 2001"
.TH PNG 5 "June 23, 2001"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

14
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
* libpng version 1.2.0beta3 - May 18, 2001
* libpng version 1.2.0beta4 - June 23, 2001
* Copyright (c) 1998-2001 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_2_0beta3 Your_png_h_is_not_version_1_2_0beta3;
typedef version_1_2_0beta4 Your_png_h_is_not_version_1_2_0beta4;
/* 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 */
const char png_libpng_ver[18] = "1.2.0beta3";
const char png_libpng_ver[18] = "1.2.0beta4";
/* png_sig was changed to a function in version 1.0.5c */
/* Place to hold the signature string for a PNG file. */
@ -551,7 +551,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
if (png_ptr->num_chunk_list)
{
png_free(png_ptr, png_ptr->chunk_list);
png_ptr->chunk_list=NULL;
png_ptr->chunk_list=(png_bytep)NULL;
png_ptr->num_chunk_list=0;
}
#endif
@ -646,7 +646,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.2.0beta3 - May 18, 2001\n\
return ((png_charp) "\n libpng version 1.2.0beta4 - June 23, 2001\n\
Copyright (c) 1998-2001 Glenn Randers-Pehrson\n\
Copyright (c) 1996, 1997 Andreas Dilger\n\
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n");
@ -664,8 +664,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.2.0beta3");
return((png_charp) "1.2.0beta3");
return((png_charp) "1.2.0beta4");
return((png_charp) "1.2.0beta4");
}
png_charp PNGAPI

38
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.0beta3 - May 18, 2001
* libpng version 1.2.0beta4 - June 23, 2001
* Copyright (c) 1998-2001 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.2.0beta3 - May 18, 2001: Glenn
* libpng versions 0.97, January 1998, through 1.2.0beta4 - June 23, 2001: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -70,10 +70,12 @@
* 1.0.11beta1-3 1 10011 2.1.0.11beta1-3
* 1.0.11rc1 1 10011 2.1.0.11rc1
* 1.0.11 1 10011 2.1.0.11
* 1.0.12a 2 10012 2.1.0.12a
* 1.1.0a-f 10100 2.1.1.0a-f (branch abandoned)
* 1.0.12beta1-2 2 10012 2.1.0.12beta1-2
* 1.0.12rc1 2 10012 2.1.0.12rc1
* 1.0.12 2 10012 2.1.0.12
* 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned)
* 1.2.0beta1-2 2 10200 2.1.2.0beta1-2
* 1.2.0beta3 3 10200 3.1.2.0beta3
* 1.2.0beta3-4 3 10200 3.1.2.0beta3-4
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -103,7 +105,7 @@
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.0beta3, May 18, 2001, are
* libpng versions 1.0.7, July 1, 2000, through 1.2.0beta4, June 23, 2001, are
* Copyright (c) 2000, 2001 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
@ -208,13 +210,13 @@
* Y2K compliance in libpng:
* =========================
*
* May 18, 2001
* June 23, 2001
*
* 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.0beta3 are Y2K compliant. It is my belief that earlier
* upward through 1.2.0beta4 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
@ -270,7 +272,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.0beta3"
#define PNG_LIBPNG_VER_STRING "1.2.0beta4"
#define PNG_LIBPNG_VER_SONUM 3
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
@ -282,7 +284,7 @@
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
#define PNG_LIBPNG_VER_BUILD 3
#define PNG_LIBPNG_VER_BUILD 4
#define PNG_LIBPNG_BUILD_ALPHA 1
#define PNG_LIBPNG_BUILD_BETA 2
@ -1210,9 +1212,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.2.0beta3
and png.h are both at version 1.2.0beta4
*/
typedef png_structp version_1_2_0beta3;
typedef png_structp version_1_2_0beta4;
typedef png_struct FAR * FAR * png_structpp;
@ -1296,7 +1298,7 @@ extern PNG_EXPORT(png_infop,png_create_info_struct)
/* Initialize the info structure (old interface - DEPRECATED) */
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
#define png_info_init(info_ptr) png_info_init_3(&(info_ptr), sizeof(png_info));
#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info));
extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
png_size_t png_info_struct_size));
@ -2329,7 +2331,7 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.0beta3 - May 18, 2001 (header)\n"
" libpng version 1.2.0beta4 - June 23, 2001 (header)\n"
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on
@ -2562,7 +2564,7 @@ PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
* (old interface - DEPRECATED - use png_create_read_struct instead).
*/
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
#define png_read_init(png_ptr) png_read_init_3(&(png_ptr), \
#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size));
@ -2574,7 +2576,7 @@ extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
* (old interface - DEPRECATED - use png_create_write_struct instead).
*/
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
#define png_write_init(png_ptr) png_write_init_3(&(png_ptr), \
#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size));
@ -2649,7 +2651,7 @@ PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
*/
PNG_EXTERN void png_save_uint_32 PNGARG((png_bytep buf, png_uint_32 i));
#if defined(PNG_WRITE_pCAL_SUPPORTED)
#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED)
PNG_EXTERN void png_save_int_32 PNGARG((png_bytep buf, png_int_32 i));
#endif
@ -2767,7 +2769,7 @@ PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
#if defined(PNG_WRITE_oFFs_SUPPORTED)
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
png_uint_32 x_offset, png_uint_32 y_offset, int unit_type));
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
#endif
#if defined(PNG_WRITE_pCAL_SUPPORTED)

View File

@ -1,6 +1,6 @@
/* pngasmrd.h - assembler version of utilities to read a PNG file
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 2001 Glenn Randers-Pehrson
*

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -226,7 +226,7 @@
# include <sys/types.h>
#endif
#ifndef PNG_SETJMP_NOT_SUPPORTED
#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED)
# define PNG_SETJMP_SUPPORTED
#endif
@ -651,9 +651,6 @@
# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
# endif
#endif
#ifndef PNG_NO_ZALLOC_ZERO
# define PNG_ZALLOC_ZERO
#endif
*/
/* This is only for PowerPC big-endian and 680x0 systems */

View File

@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -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.2.0beta3 - May 18, 2001
* libpng version 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* Copyright (c) 1998, Intel Corporation

View File

@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngmem.c - stub functions for memory allocation
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* libpng 1.2.0beta3 - May 18, 2001
* libpng 1.2.0beta4 - June 23, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -99,23 +99,24 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
char msg[80];
if (user_png_ver)
{
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
user_png_ver);
png_warning(png_ptr, msg);
}
sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_libpng_ver);
png_warning(png_ptr, msg);
#endif
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags=0;
#endif
png_error(png_ptr,
"Incompatible libpng version in application and library");
}
/* Libpng 1.0.6 was not binary compatible, due to insertion of the
info_ptr->free_me member. Libpng-1.0.1 and earlier were not
compatible due to insertion of the user transform function. Note
to maintainer: this test can be removed from version 1.2.0 and
beyond because the previous test would have already rejected it. */
if (user_png_ver[0] == '1' && user_png_ver[2] == '0' &&
(user_png_ver[4] < '2' || user_png_ver[4] == '6') &&
user_png_ver[5] == '\0')
{
png_error(png_ptr,
"Application must be recompiled; versions <= 1.0.6 were incompatible");
}
}
/* initialize zbuf - compression buffer */
@ -151,7 +152,7 @@ void PNGAPI
png_read_init(png_structp png_ptr)
{
/* We only come here via pre-1.0.7-compiled applications */
png_read_init_2(png_ptr, "1.0.0", 0, 0);
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
}
#undef png_read_init_2
@ -160,15 +161,37 @@ png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
png_size_t png_struct_size, png_size_t png_info_size)
{
/* We only come here via pre-1.0.12-compiled applications */
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
if(sizeof(png_struct) > png_struct_size || sizeof(png_info) > png_info_size)
{
char msg[80];
png_ptr->warning_fn=(png_error_ptr)NULL;
if (user_png_ver)
{
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
user_png_ver);
png_warning(png_ptr, msg);
}
sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_libpng_ver);
png_warning(png_ptr, msg);
}
#endif
if(sizeof(png_struct) > png_struct_size)
{
png_ptr->error_fn=(png_error_ptr)NULL;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags=0;
#endif
png_error(png_ptr,
"The png struct allocated by the application for reading is too small."