Imported from libpng-1.0.7beta15.tar

This commit is contained in:
Glenn Randers-Pehrson 2000-05-29 08:58:03 -05:00
parent fc4a143ec6
commit 104622bebb
49 changed files with 1368 additions and 267 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.0.7beta14 - May 17, 2000
Libpng 1.0.7beta15 - May 29, 2000
This is a public release of libpng, intended for use in production codes.
@ -75,6 +75,12 @@ Changes since the last public release (1.0.6):
Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5.
Added png_set_invalid() function.
Fixed incorrect illustrations of png_destroy_write_struct() in example.c.
Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce
fewer error messages.
Set each pointer to NULL after freeing it in png_free_data().
Worked around a problem in pngconf.h; AIX's strings.h defines an "index"
macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos)
Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux).
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

25
CHANGES
View File

@ -392,7 +392,7 @@ version 1.0.3 [January 14, 1999]
version 1.0.3a [August 12, 1999]
Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning
if an attempt is made to read an interlaced image when it's not supported.
Added check if png_ptr->trans is defined before free'ing it in pngread.c
Added check if png_ptr->trans is defined before freeing it in pngread.c
Modified the Y2K statement to include versions back to version 0.71
Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c
Modified makefile.wat (added -zp8 flag, ".symbolic", changed some comments)
@ -669,7 +669,7 @@ version 1.0.6d [April 7, 2000]
Fixed an error in png_rgb_to_gray_fixed()
Revised example.c, usage of png_destroy_write_struct().
Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file
Added a check for info_ptr->free_me&PNG_FREE_TEXT when free'ing text in png.c
Added a check for info_ptr->free_me&PNG_FREE_TEXT when freeing text in png.c
Simplify png_sig_bytes() function to remove use of non-ISO-C strdup().
version 1.0.6e [April 9, 2000]
Added png_data_freer() function.
@ -745,19 +745,32 @@ version 1.0.7beta12 [May 12, 2000]
Added png_access_version_number() function.
Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data().
Expanded libpng.3/libpng.txt information about png_data_freer().
version 1.0.7beta13 [May 16, 2000]
version 1.0.7beta14 [May 17, 2000] (beta13 was not published)
Changed pnggccrd.c and pngvcrd.c to handle bad adaptive filter types as
warnings instead of errors, as pngrutil.c does.
Set the PNG_INFO_IDAT valid flag in png_set_rows() so png_write_png()
will actually write IDATs.
Made the default PNG_USE_LOCAL_ARRAYS depend on PNG_DLL instead of WIN32.
Make png_free_data() ignore its final parameter when freeing data that can
have multiple instances (text, sPLT, unknowns).
version 1.0.7beta14 [May 17, 2000]
Make png_free_data() ignore its final parameter except when freeing data
that can have multiple instances (text, sPLT, unknowns).
Fixed a new bug in png_set_rows().
Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5.
Added png_set_invalid() function.
Fixed incorrect illustrations of png_destroy_write_struct() in example.c.
version 1.0.7beta15 [May 29, 2000]
Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce
fewer error messages.
Rearranged checks for Z_OK to check the most likely path first in pngpread.c
and pngwutil.c.
Added checks in pngtest.c for png_create_*() returning NULL, and mentioned
in libpng.txt/libpng.3 the need for applications to check this.
Changed names of png_default_*() functions in pngtest to pngtest_*().
Changed return type of png_get_x|y_offset_*() from png_uint_32 to png_int_32.
Fixed some bugs in the unused PNG_INCH_CONVERSIONS functions in pngget.c
Set each pointer to NULL after freeing it in png_free_data().
Worked around a problem in pngconf.h; AIX's strings.h defines an "index"
macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos)
Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux).
Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

12
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.0.7beta14 - May 17, 2000
Installing libpng version 1.0.7beta15 - May 29, 2000
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.0.7beta14" or "lpng106" and "zlib-1.1.3"
might be called "libpng-1.0.7beta15" or "lpng106" and "zlib-1.1.3"
or "zlib113") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
@ -47,8 +47,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.0.7beta14)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta14,
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta15)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta15,
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
@ -60,9 +60,9 @@ include
makefile.intel => Intel C/C++ version 4.0 and later
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta14)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta15)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta14)
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta15)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile

View File

@ -5,7 +5,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.90, December 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.7beta14, May 17, 2000)
(libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
@ -68,4 +68,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
randeg@alum.rpi.edu
May 17, 2000
May 29, 2000

10
README
View File

@ -1,4 +1,4 @@
README for libpng 1.0.7beta14 - May 17, 2000 (shared library 2.1)
README for libpng 1.0.7beta15 - May 29, 2000 (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.
@ -172,9 +172,9 @@ Files in this distribution:
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.0.7beta14)
(gcc, creates libpng.so.2.1.0.7beta15)
makefile.gcmmx => Linux/ELF makefile (gcc, creates
libpng.so.2.1.0.7beta14, uses assembler code
libpng.so.2.1.0.7beta15, 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
@ -186,10 +186,10 @@ Files in this distribution:
makefile.intel => Intel C/C++ version 4.0 and later
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta14)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta15)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng.so.2.1.0.7beta14)
(gcc, creates libpng.so.2.1.0.7beta15)
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 17, 2000
May 29, 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.7beta14 are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta15 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.0.7beta14. Instead, please
There is no \"configure\" script for Libpng-1.0.7beta15. Instead, please
copy the appropriate makefile for your system from the \"scripts\"
directory. Read the INSTALL file for more details.
"

View File

@ -84,7 +84,7 @@ void read_png(char *file_name) /* We need to open the file */
FILE *fp;
if ((fp = fopen(file_name, "rb")) == NULL)
return;
return (ERROR);
#else no_open_file /* prototype 2 */
void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
{
@ -106,7 +106,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
if (png_ptr == NULL)
{
fclose(fp);
return;
return (ERROR);
}
/* Allocate/initialize the memory for image information. REQUIRED. */
@ -115,7 +115,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
{
fclose(fp);
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
return;
return (ERROR);
}
/* Set error handling if you are using the setjmp/longjmp method (this is
@ -129,7 +129,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
fclose(fp);
/* If we get here, we had a problem reading the file */
return;
return (ERROR);
}
/* One of the following I/O initialization methods is REQUIRED */
@ -282,7 +282,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
/* This reduces the image to the palette supplied in the file */
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette))
{
png_color16p histogram;
png_uint_16p histogram;
png_get_hIST(png_ptr, info_ptr, &histogram);
@ -291,7 +291,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
}
}
/* invert monocrome files to have 0 as white and 1 as black */
/* invert monochrome files to have 0 as white and 1 as black */
png_set_invert_mono(png_ptr);
/* If you want to shift the pixel values from the range [0,255] or
@ -387,7 +387,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
fclose(fp);
/* that's it */
return;
return (OK);
}
/* progressively read a file */
@ -407,7 +407,7 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
if (*png_ptr == NULL)
{
*info_ptr = NULL;
return ERROR;
return (ERROR);
}
*info_ptr = png_create_info_struct(png_ptr);
@ -415,13 +415,13 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
if (*info_ptr == NULL)
{
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
return ERROR;
return (ERROR);
}
if (setjmp(png_jmpbuf((*png_ptr))))
{
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
return ERROR;
return (ERROR);
}
/* This one's new. You will need to provide all three
@ -439,7 +439,7 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
png_set_progressive_read_fn(*png_ptr, (void *)stream_data,
info_callback, row_callback, end_callback);
return OK;
return (OK);
}
int
@ -450,7 +450,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
{
/* Free the png_ptr and info_ptr memory on error */
png_destroy_read_struct(png_ptr, info_ptr, (png_infopp)NULL);
return ERROR;
return (ERROR);
}
/* This one's new also. Simply give it chunks of data as
@ -464,7 +464,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
* callback, if you aren't already displaying them there.
*/
png_process_data(*png_ptr, *info_ptr, buffer, length);
return OK;
return (OK);
}
info_callback(png_structp png_ptr, png_infop info)
@ -533,7 +533,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* open the file */
fp = fopen(file_name, "wb");
if (fp == NULL)
return;
return (ERROR);
/* Create and initialize the png_struct with the desired error handler
* functions. If you want to use the default stderr and longjump method,
@ -547,7 +547,7 @@ void write_png(char *file_name /* , ... other image information ... */)
if (png_ptr == NULL)
{
fclose(fp);
return;
return (ERROR);
}
/* Allocate/initialize the image information data. REQUIRED */
@ -556,7 +556,7 @@ void write_png(char *file_name /* , ... other image information ... */)
{
fclose(fp);
png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
return;
return (ERROR);
}
/* Set error handling. REQUIRED if you aren't supplying your own
@ -567,7 +567,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* If we get here, we had a problem reading the file */
fclose(fp);
png_destroy_write_struct(&png_ptr, &info_ptr);
return;
return (ERROR);
}
/* One of the following I/O initialization functions is REQUIRED */
@ -672,7 +672,7 @@ void write_png(char *file_name /* , ... other image information ... */)
* all optional. Only call them if you want them.
*/
/* invert monocrome pixels */
/* invert monochrome pixels */
png_set_invert_mono(png_ptr);
/* Shift the pixels up to a legal bit depth and fill in
@ -768,7 +768,7 @@ void write_png(char *file_name /* , ... other image information ... */)
fclose(fp);
/* that's it */
return;
return (OK);
}
#endif /* if 0 */

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "May 17, 2000"
.TH LIBPNG 3 "May 29, 2000"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta14
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta15
.SH SYNOPSIS
\fI\fB
@ -274,11 +274,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta14
\fI\fB
\fBpng_uint_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBpng_uint_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
@ -286,11 +286,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta14
\fI\fB
\fBpng_uint_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fBpng_uint_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
@ -747,7 +747,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.0.7beta14 - May 17, 2000
libpng version 1.0.7beta15 - May 29, 2000
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -895,13 +895,13 @@ Customizing libpng.
FILE *fp = fopen(file_name, "rb");
if (!fp)
{
return;
return (ERROR);
}
fread(header, 1, number, fp);
is_png = !png_sig_cmp(header, 0, number);
if (!is_png)
{
return;
return (NOT_PNG);
}
@ -913,19 +913,21 @@ pointers to error handling functions, and a pointer to a data struct for
use by the error functions, if necessary (the pointer and functions can
be NULL if the default error handlers are to be used). See the section
on Changes to Libpng below regarding the old initialization functions.
The structure allocation functions quietly return NULL if they fail to
create the structure, so your application should check for that.
png_structp png_ptr = png_create_read_struct
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return;
return (ERROR);
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
return;
return (ERROR);
}
png_infop end_info = png_create_info_struct(png_ptr);
@ -933,7 +935,7 @@ on Changes to Libpng below regarding the old initialization functions.
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return;
return (ERROR);
}
If you want to use your own memory allocation routines,
@ -968,7 +970,7 @@ free any memory.
png_destroy_read_struct(&png_ptr, &info_ptr,
&end_info);
fclose(fp);
return;
return (ERROR);
}
If you would rather avoid the complexity of setjmp/longjmp issues,
@ -2031,20 +2033,20 @@ png_infop info_ptr;
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return -1;
return (ERROR);
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_read_struct(&png_ptr, (png_infopp)NULL,
(png_infopp)NULL);
return -1;
return (ERROR);
}
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return -1;
return (ERROR);
}
/* This one's new. You can provide functions
@ -2078,7 +2080,7 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return -1;
return (ERROR);
}
/* This one's new also. Simply give it a chunk
@ -2192,7 +2194,7 @@ custom writing functions. See the discussion under Customizing libpng.
FILE *fp = fopen(file_name, "wb");
if (!fp)
{
return;
return (ERROR);
}
Next, png_struct and png_info need to be allocated and initialized.
@ -2207,14 +2209,14 @@ both "png_ptr"; you can call them anything you like, such as
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return;
return (ERROR);
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_write_struct(&png_ptr,
(png_infopp)NULL);
return;
return (ERROR);
}
If you want to use your own memory allocation routines,
@ -2239,9 +2241,9 @@ section below for more information on the libpng error handling.
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
return;
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
return (ERROR);
}
...
return;
@ -3377,13 +3379,13 @@ application:
.SH VII. Y2K Compliance in libpng
May 17, 2000
May 29, 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.7beta14 are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta15 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
@ -3524,7 +3526,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.0.7beta14 - May 17, 2000:
Libpng version 1.0.7beta15 - May 29, 2000:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
@ -3539,7 +3541,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.89c, May 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.7beta14, May 17, 2000)
(libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.0.7beta14 - May 17, 2000
libpng version 1.0.7beta15 - May 29, 2000
Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -148,13 +148,13 @@ Customizing libpng.
FILE *fp = fopen(file_name, "rb");
if (!fp)
{
return;
return (ERROR);
}
fread(header, 1, number, fp);
is_png = !png_sig_cmp(header, 0, number);
if (!is_png)
{
return;
return (NOT_PNG);
}
@ -166,19 +166,21 @@ pointers to error handling functions, and a pointer to a data struct for
use by the error functions, if necessary (the pointer and functions can
be NULL if the default error handlers are to be used). See the section
on Changes to Libpng below regarding the old initialization functions.
The structure allocation functions quietly return NULL if they fail to
create the structure, so your application should check for that.
png_structp png_ptr = png_create_read_struct
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return;
return (ERROR);
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_read_struct(&png_ptr,
(png_infopp)NULL, (png_infopp)NULL);
return;
return (ERROR);
}
png_infop end_info = png_create_info_struct(png_ptr);
@ -186,7 +188,7 @@ on Changes to Libpng below regarding the old initialization functions.
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return;
return (ERROR);
}
If you want to use your own memory allocation routines,
@ -221,7 +223,7 @@ free any memory.
png_destroy_read_struct(&png_ptr, &info_ptr,
&end_info);
fclose(fp);
return;
return (ERROR);
}
If you would rather avoid the complexity of setjmp/longjmp issues,
@ -1284,20 +1286,20 @@ png_infop info_ptr;
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return -1;
return (ERROR);
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_read_struct(&png_ptr, (png_infopp)NULL,
(png_infopp)NULL);
return -1;
return (ERROR);
}
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return -1;
return (ERROR);
}
/* This one's new. You can provide functions
@ -1331,7 +1333,7 @@ png_infop info_ptr;
{
png_destroy_read_struct(&png_ptr, &info_ptr,
(png_infopp)NULL);
return -1;
return (ERROR);
}
/* This one's new also. Simply give it a chunk
@ -1445,7 +1447,7 @@ custom writing functions. See the discussion under Customizing libpng.
FILE *fp = fopen(file_name, "wb");
if (!fp)
{
return;
return (ERROR);
}
Next, png_struct and png_info need to be allocated and initialized.
@ -1460,14 +1462,14 @@ both "png_ptr"; you can call them anything you like, such as
(PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
user_error_fn, user_warning_fn);
if (!png_ptr)
return;
return (ERROR);
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
png_destroy_write_struct(&png_ptr,
(png_infopp)NULL);
return;
return (ERROR);
}
If you want to use your own memory allocation routines,
@ -1492,9 +1494,9 @@ section below for more information on the libpng error handling.
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
return;
png_destroy_write_struct(&png_ptr, &info_ptr);
fclose(fp);
return (ERROR);
}
...
return;
@ -2630,13 +2632,13 @@ application:
VII. Y2K Compliance in libpng
May 17, 2000
May 29, 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.7beta14 are Y2K compliant. It is my belief that earlier
upward through 1.0.7beta15 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 17, 2000"
.TH LIBPNGPF 3 "May 29, 2000"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta14
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta15
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP

38
msvc/README.txt Normal file
View File

@ -0,0 +1,38 @@
Microsoft Developer Studio Build File, Format Version 6.00 for
libpng 1.0.7beta15 (May 29, 2000) and zlib
Copyright (C) 2000 Simon-Pierre Cadieux
For conditions of distribution and use, see copyright notice in png.h
Assumes that libpng sources are in ..
Assumes that zlib sources have been copied to ..\..\zlib
To build:
1) On the main menu Select "Build|Set Active configuration".
Among the configurations beginning with "libpng" select the
one you wish to build (the corresponding "zlib" configuration
will be built automatically).
2) Select "Build|Clean"
3) Select "Build|Rebuild All"
4) Look in the appropriate "win32" subdirectories for both "zlib"
and "libpng" binaries.
This project will build the PNG Development Group's "official" versions of
libpng and zlib libraries:
libpng1.dll (default version, currently C code only)
libpng1d.dll (C code debug version)
libpng1[a-c,e-m].dll (reserved for official versions)
libpng1[n-z].dll (available for private versions)
zlib.dll (default version)
zlibd.dll (debug version)
If you change anything in libpng, or select different compiler settings,
please change the library name to an unreserved name, and define
PRIVATEBUILD or SPECIALBUILD accordingly.

273
msvc/libpng.dsp Normal file
View File

@ -0,0 +1,273 @@
# Microsoft Developer Studio Project File - Name="libpng" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=libpng - Win32 DLL
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libpng.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libpng.mak" CFG="libpng - Win32 DLL"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libpng - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "libpng - Win32 LIB" (based on "Win32 (x86) Static Library")
!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
!IF "$(CFG)" == "libpng - Win32 DLL"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\win32\libpng\dll"
# PROP Intermediate_Dir ".\win32\libpng\dll"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MD /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP /nologo /MD /W3 /O1 /I ".." /I "..\..\zlib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /c
MTL=midl.exe
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /i ".." /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 /nologo /dll /machine:I386 /out:".\win32\libpng\dll\libpng1.dll"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\win32\libpng\dll_dbg"
# PROP Intermediate_Dir ".\win32\libpng\dll_dbg"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Zi /Od /I ".." /I "..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /Yu"png.h" /FD /GZ /c
MTL=midl.exe
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i ".." /d "_DEBUG" /d PNG_DEBUG=1
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\libpng\dll_dbg\libpng1d.dll"
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\win32\libpng\lib"
# PROP Intermediate_Dir ".\win32\libpng\lib"
# PROP Target_Dir ""
MTL=midl.exe
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
# ADD CPP /nologo /W3 /O1 /I ".." /I "..\..\zlib" /D "WIN32" /D "NDEBUG" /Yu"png.h" /FD /c
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /i ".." /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\win32\libpng\lib_dbg"
# PROP Intermediate_Dir ".\win32\libpng\lib_dbg"
# PROP Target_Dir ""
MTL=midl.exe
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /GZ /c
# ADD CPP /nologo /W3 /Zi /Od /I ".." /I "..\..\zlib" /D "DEBUG" /D "_DEBUG" /D PNG_DEBUG=1 /D "WIN32" /Yu"png.h" /FD /GZ /c
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "libpng - Win32 DLL"
# Name "libpng - Win32 DLL Debug"
# Name "libpng - Win32 LIB"
# Name "libpng - Win32 LIB Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\png.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=.\png.rc
!IF "$(CFG)" == "libpng - Win32 DLL"
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug"
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\png32ms.def
!IF "$(CFG)" == "libpng - Win32 DLL"
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
!ELSEIF "$(CFG)" == "libpng - Win32 LIB"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug"
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\pngerror.c
# ADD CPP /Yc"png.h"
# End Source File
# Begin Source File
SOURCE=..\pngget.c
# End Source File
# Begin Source File
SOURCE=..\pngmem.c
# End Source File
# Begin Source File
SOURCE=..\pngpread.c
# End Source File
# Begin Source File
SOURCE=..\pngread.c
# End Source File
# Begin Source File
SOURCE=..\pngrio.c
# End Source File
# Begin Source File
SOURCE=..\pngrtran.c
# End Source File
# Begin Source File
SOURCE=..\pngrutil.c
# End Source File
# Begin Source File
SOURCE=..\pngset.c
# End Source File
# Begin Source File
SOURCE=..\pngtrans.c
# End Source File
# Begin Source File
SOURCE=..\pngwio.c
# End Source File
# Begin Source File
SOURCE=..\pngwrite.c
# End Source File
# Begin Source File
SOURCE=..\pngwtran.c
# End Source File
# Begin Source File
SOURCE=..\pngwutil.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\png.h
# End Source File
# Begin Source File
SOURCE=..\pngconf.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File
SOURCE=.\readme.txt
# PROP Exclude_From_Build 1
# End Source File
# End Target
# End Project

44
msvc/libpng.dsw Normal file
View File

@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "libpng"=.\libpng.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
Project: "zlib"=.\zlib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

67
msvc/png.rc Normal file
View File

@ -0,0 +1,67 @@
#define PNG_VERSION_INFO_ONLY
#include <windows.h>
#include "png.h"
#define _QUOTE(x) # x
#define QUOTE(x) _QUOTE(x)
#define PNG_LIBPNG_DLLFNAME "LIBPNG"
#if defined(PNG_DEBUG) && (PNG_DEBUG > 0)
# define VS_DEBUG VS_FF_DEBUG
# define DEBUG_POSTFIX "D"
# ifndef COMMENTS
# define COMMENTS "PNG_DEBUG=" QUOTE(PNG_DEBUG)
# endif /* COMMENTS */
#else
# define VS_DEBUG 0
# define DEBUG_POSTFIX
#endif /* defined(DEBUG)... */
#ifdef PRIVATEBUILD
# define VS_PRIVATEBUILD VS_FF_PRIVATEBUILD
#else
# define VS_PRIVATEBUILD 0
#endif /* PRIVATEBUILD */
#ifdef SPECIALBUILD
# define VS_SPECIALBUILD VS_FF_SPECIALBUILD
#else
# define VS_SPECIALBUILD 0
#endif /* SPECIALBUILD */
VS_VERSION_INFO VERSIONINFO
FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
PRODUCTVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS VS_DEBUG | VS_PRIVATEBUILD | VS_SPECIALBUILD
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
BEGIN
BLOCK "StringFileInfo"
BEGIN BLOCK "040904E4" /* Language type = U.S English(0x0409) and Character Set = Windows, Multilingual(0x04E4) */
BEGIN
#ifdef COMMENTS
VALUE "Comments", COMMENTS "\000"
#endif /* COMMENTS */
VALUE "FileDescription", "PNG image compression library\000"
VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000"
VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DEBUG_POSTFIX " (Windows 32 bit)\000"
VALUE "LegalCopyright", "Copyright 1998-2000 Glenn Randers-Pehrson\000"
VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_MAJOR) DEBUG_POSTFIX ".DLL\000"
#ifdef PRIVATEBUILD
VALUE "PrivateBuild", PRIVATEBUILD
#endif /* PRIVATEBUILD */
VALUE "ProductName", "LibPNG\000"
VALUE "ProductVersion", "1\000"
#ifdef SPECIALBUILD
VALUE "SpecialBuild", SPECIALBUILD
#endif /* SPECIALBUILD */
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04E4
END
END

177
msvc/png32ms.def Normal file
View File

@ -0,0 +1,177 @@
;------------------------------------------
; PNGLIB module definition file for Windows
;------------------------------------------
LIBRARY
DESCRIPTION "PNG image compression library for Windows"
EXPORTS
;Version 1.0.7beta15
png_build_grayscale_palette @1
png_check_sig @2
png_chunk_error @3
png_chunk_warning @4
png_convert_from_struct_tm @5
png_convert_from_time_t @6
png_create_info_struct @7
png_create_read_struct @8
png_create_write_struct @9
png_data_freer @10
png_destroy_info_struct @11
png_destroy_read_struct @12
png_destroy_write_struct @13
png_error @14
png_free @15
png_free_data @16
png_get_IHDR @17
png_get_PLTE @18
png_get_bKGD @19
png_get_bit_depth @20
png_get_cHRM @21
png_get_cHRM_fixed @22
png_get_channels @23
png_get_color_type @24
png_get_compression_buffer_size @25
png_get_compression_type @26
png_get_copyright @27
png_get_error_ptr @28
png_get_filter_type @29
png_get_gAMA @30
png_get_gAMA_fixed @31
png_get_hIST @32
png_get_header_ver @33
png_get_header_version @34
png_get_iCCP @35
png_get_image_height @36
png_get_image_width @37
png_get_interlace_type @38
png_get_io_ptr @39
png_get_libpng_ver @40
png_get_oFFs @41
png_get_pCAL @42
png_get_pHYs @43
png_get_pixel_aspect_ratio @44
png_get_pixels_per_meter @45
png_get_progressive_ptr @46
png_get_rgb_to_gray_status @47
png_get_rowbytes @48
png_get_rows @49
png_get_sBIT @50
png_get_sCAL @51
png_get_sPLT @52
png_get_sRGB @53
png_get_signature @54
png_get_tIME @55
png_get_tRNS @56
png_get_text @57
png_get_unknown_chunks @58
png_get_user_chunk_ptr @59
png_get_user_transform_ptr @60
png_get_valid @61
png_get_x_offset_microns @62
png_get_x_offset_pixels @63
png_get_x_pixels_per_meter @64
png_get_y_offset_microns @65
png_get_y_offset_pixels @66
png_get_y_pixels_per_meter @67
png_malloc @68
png_memcpy_check @69
png_memset_check @70
png_permit_empty_plte @71
png_process_data @72
png_progressive_combine_row @73
png_read_end @74
png_read_image @75
png_read_info @76
png_read_init @77
png_read_png @78
png_read_row @79
png_read_rows @80
png_read_update_info @81
png_reset_zstream @82
png_set_IHDR @83
png_set_PLTE @84
png_set_bKGD @85
png_set_background @86
png_set_bgr @87
png_set_cHRM @88
png_set_cHRM_fixed @89
png_set_compression_buffer_size @90
png_set_compression_level @91
png_set_compression_mem_level @92
png_set_compression_method @93
png_set_compression_strategy @94
png_set_compression_window_bits @95
png_set_crc_action @96
png_set_dither @97
png_set_error_fn @98
png_set_expand @99
png_set_filler @100
png_set_filter @101
png_set_filter_heuristics @102
png_set_flush @103
png_set_gAMA @104
png_set_gAMA_fixed @105
png_set_gamma @106
png_set_gray_1_2_4_to_8 @107
png_set_gray_to_rgb @108
png_set_hIST @109
png_set_iCCP @110
png_set_interlace_handling @111
png_set_invert_alpha @112
png_set_invert_mono @113
png_set_keep_unknown_chunks @114
png_set_oFFs @115
png_set_pCAL @116
png_set_pHYs @117
png_set_packing @118
png_set_packswap @119
png_set_palette_to_rgb @120
png_set_progressive_read_fn @121
png_set_read_fn @122
png_set_read_status_fn @123
png_set_read_user_chunk_fn @124
png_set_read_user_transform_fn @125
png_set_rgb_to_gray @126
png_set_rgb_to_gray_fixed @127
png_set_rows @128
png_set_sBIT @129
png_set_sCAL @130
png_set_sPLT @131
png_set_sRGB @132
png_set_sRGB_gAMA_and_cHRM @133
png_set_shift @134
png_set_sig_bytes @135
png_set_strip_16 @136
png_set_strip_alpha @137
png_set_swap @138
png_set_swap_alpha @139
png_set_tIME @140
png_set_tRNS @141
png_set_tRNS_to_alpha @142
png_set_text @143
png_set_unknown_chunk_location @144
png_set_unknown_chunks @145
png_set_user_transform_info @146
png_set_write_fn @147
png_set_write_status_fn @148
png_set_write_user_transform_fn @149
png_sig_cmp @150
png_start_read_image @151
png_warning @152
png_write_chunk @153
png_write_chunk_data @154
png_write_chunk_end @155
png_write_chunk_start @156
png_write_end @157
png_write_flush @158
png_write_image @159
png_write_info @160
png_write_info_before_PLTE @161
png_write_init @162
png_write_png @163
png_write_row @164
png_write_rows @165
png_read_init_2 @166
png_write_init_2 @167
; png_sig_bytes @168

44
msvc/zlib.def Normal file
View File

@ -0,0 +1,44 @@
LIBRARY
EXPORTS
adler32 @1
compress @2
crc32 @3
deflate @4
deflateCopy @5
deflateEnd @6
deflateInit2_ @7
deflateInit_ @8
deflateParams @9
deflateReset @10
deflateSetDictionary @11
gzclose @12
gzdopen @13
gzerror @14
gzflush @15
gzopen @16
gzread @17
gzwrite @18
inflate @19
inflateEnd @20
inflateInit2_ @21
inflateInit_ @22
inflateReset @23
inflateSetDictionary @24
inflateSync @25
uncompress @26
zlibVersion @27
gzprintf @28
gzputc @29
gzgetc @30
gzseek @31
gzrewind @32
gztell @33
gzeof @34
gzsetparams @35
zError @36
inflateSyncPoint @37
get_crc_table @38
compress2 @39
gzputs @40
gzgets @41

306
msvc/zlib.dsp Normal file
View File

@ -0,0 +1,306 @@
# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=zlib - Win32 DLL
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "zlib.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 DLL"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "zlib - Win32 DLL" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlib - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "zlib - Win32 LIB" (based on "Win32 (x86) Static Library")
!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
!IF "$(CFG)" == "zlib - Win32 DLL"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\win32\zlib\dll"
# PROP Intermediate_Dir ".\win32\zlib\dll"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MD /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
# ADD CPP /nologo /MD /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "ZLIB_DLL" /FD /c
MTL=midl.exe
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 /nologo /dll /machine:I386
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\win32\zlib\dll_dbg"
# PROP Intermediate_Dir ".\win32\zlib\dll_dbg"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
CPP=cl.exe
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Zi /Od /D "DEBUG" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "ZLIB_DLL" /FD /GZ /c
MTL=midl.exe
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:".\win32\zlib\dll_dbg\zlibd.dll"
!ELSEIF "$(CFG)" == "zlib - Win32 LIB"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\win32\zlib\lib"
# PROP Intermediate_Dir ".\win32\zlib\lib"
# PROP Target_Dir ""
MTL=midl.exe
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /FD /c
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\win32\zlib\lib_dbg"
# PROP Intermediate_Dir ".\win32\zlib\lib_dbg"
# PROP Target_Dir ""
MTL=midl.exe
CPP=cl.exe
# ADD BASE CPP /nologo /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /GZ /c
# ADD CPP /nologo /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "zlib - Win32 DLL"
# Name "zlib - Win32 DLL Debug"
# Name "zlib - Win32 LIB"
# Name "zlib - Win32 LIB Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\zlib\adler32.c
# End Source File
# Begin Source File
SOURCE=..\..\zlib\compress.c
# End Source File
# Begin Source File
SOURCE=..\..\zlib\crc32.c
# End Source File
# Begin Source File
SOURCE=..\..\zlib\deflate.c
# End Source File
# Begin Source File
SOURCE=..\..\zlib\gzio.c
# ADD CPP /Yc"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infblock.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infcodes.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inffast.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inflate.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inftrees.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infutil.c
# ADD CPP /Yu"zutil.h"
# End Source File
# Begin Source File
SOURCE=..\..\zlib\trees.c
# End Source File
# Begin Source File
SOURCE=..\..\zlib\uncompr.c
# End Source File
# Begin Source File
SOURCE=.\zlib.def
!IF "$(CFG)" == "zlib - Win32 DLL"
!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"
!ELSEIF "$(CFG)" == "zlib - Win32 LIB"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\zlib\msdos\zlib.rc
!IF "$(CFG)" == "zlib - Win32 DLL"
!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"
!ELSEIF "$(CFG)" == "zlib - Win32 LIB"
# PROP Exclude_From_Build 1
!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"
# PROP Exclude_From_Build 1
!ENDIF
# End Source File
# Begin Source File
SOURCE=..\..\zlib\zutil.c
# ADD CPP /Yu"zutil.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\zlib\deflate.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infblock.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infcodes.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inffast.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inffixed.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\inftrees.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\infutil.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\trees.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\zconf.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\zlib.h
# End Source File
# Begin Source File
SOURCE=..\..\zlib\zutil.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

2
png.5
View File

@ -1,4 +1,4 @@
.TH PNG 5 "May 17, 2000"
.TH PNG 5 "May 29, 2000"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

26
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
* libpng version 1.0.7beta14 - May 17, 2000
* libpng version 1.0.7beta15 - May 29, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -14,14 +14,14 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_0_7beta14 Your_png_h_is_not_version_1_0_7beta14;
typedef version_1_0_7beta15 Your_png_h_is_not_version_1_0_7beta15;
/* 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.7beta14";
char png_libpng_ver[12] = "1.0.7beta15";
/* png_sig was changed to a function in version 1.0.5c */
/* Place to hold the signature string for a PNG file. */
@ -324,6 +324,7 @@ if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
{
png_free(png_ptr, info_ptr->trans);
info_ptr->valid &= ~PNG_INFO_tRNS;
info_ptr->trans = NULL;
}
#endif
@ -338,6 +339,8 @@ if (mask & PNG_FREE_SCAL)
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
png_free(png_ptr, info_ptr->scal_s_width);
png_free(png_ptr, info_ptr->scal_s_height);
info_ptr->scal_s_width = NULL;
info_ptr->scal_s_height = NULL;
#endif
info_ptr->valid &= ~PNG_INFO_sCAL;
}
@ -353,12 +356,15 @@ if (mask & PNG_FREE_PCAL)
{
png_free(png_ptr, info_ptr->pcal_purpose);
png_free(png_ptr, info_ptr->pcal_units);
info_ptr->pcal_purpose = NULL;
info_ptr->pcal_units = NULL;
if (info_ptr->pcal_params != NULL)
{
int 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);
info_ptr->pcal_params = NULL;
}
info_ptr->valid &= ~PNG_INFO_pCAL;
}
@ -374,6 +380,8 @@ if (mask & PNG_FREE_ICCP)
{
png_free(png_ptr, info_ptr->iccp_name);
png_free(png_ptr, info_ptr->iccp_profile);
info_ptr->iccp_name = NULL;
info_ptr->iccp_profile = NULL;
info_ptr->valid &= ~PNG_INFO_iCCP;
}
#endif
@ -392,6 +400,8 @@ if (mask & PNG_FREE_SPLT)
{
png_free(png_ptr, info_ptr->splt_palettes[num].name);
png_free(png_ptr, info_ptr->splt_palettes[num].entries);
info_ptr->splt_palettes[num].name = NULL;
info_ptr->splt_palettes[num].entries = NULL;
}
}
else
@ -403,6 +413,7 @@ if (mask & PNG_FREE_SPLT)
png_free_data(png_ptr, info_ptr, PNG_FREE_SPLT, i);
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes = NULL;
info_ptr->splt_palettes_num = 0;
}
info_ptr->valid &= ~PNG_INFO_sPLT;
@ -435,6 +446,7 @@ if (mask & PNG_FREE_UNKN)
png_free_data(png_ptr, info_ptr, PNG_FREE_UNKN, i);
png_free(png_ptr, info_ptr->unknown_chunks);
info_ptr->unknown_chunks = NULL;
info_ptr->unknown_chunks_num = 0;
}
}
@ -450,6 +462,7 @@ if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
#endif
{
png_free(png_ptr, info_ptr->hist);
info_ptr->hist = NULL;
info_ptr->valid &= ~PNG_INFO_hIST;
}
#endif
@ -462,6 +475,7 @@ if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
#endif
{
png_zfree(png_ptr, info_ptr->palette);
info_ptr->palette = NULL;
info_ptr->valid &= ~PNG_INFO_PLTE;
info_ptr->num_palette = 0;
}
@ -591,7 +605,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
return ("\n libpng version 1.0.7beta14 - May 17, 2000\n\
return ("\n libpng version 1.0.7beta15 - May 29, 2000\n\
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\
Copyright (c) 1996, 1997 Andreas Dilger\n\
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n");
@ -609,8 +623,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("1.0.7beta14");
return("1.0.7beta14");
return("1.0.7beta15");
return("1.0.7beta15");
}
png_charp PNGAPI

34
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.0.7beta14 - May 17, 2000
* libpng version 1.0.7beta15 - May 29, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -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.7beta14 - May 17, 2000: Glenn
* libpng versions 0.97, January 1998, through 1.0.7beta15 - May 29, 2000: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -52,9 +52,9 @@
* 1.0.6h 10007 10.6h (testing xy.z so-numbering)
* 1.0.6i 10007 10.6i
* 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0)
* 1.0.7beta11-12 10007 2.1.0.7beta11-12 (binary compatible)
* 1.0.7rc1 10007 2.1.0.7rc1 (binary compatible)
* 1.0.7beta11-15 10007 2.1.0.7beta11-15 (binary compatible)
* planned:
* 1.0.7rc1 10007 2.1.0.7rc1 (binary compatible)
* 1.0.6patch4 (w/4 patches) 10006 2.1.0.6 (binary compatible)
* 1.0.7 10007 (still compatible)
*
@ -87,7 +87,7 @@
* Copyright (c) 1996, 1997 Andreas Dilger
* (libpng versions 0.89c, June 1996, through 0.96, May 1997)
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
* (libpng versions 0.97, January 1998, through 1.0.7beta14, May 17, 2000)
* (libpng versions 0.97, January 1998, through 1.0.7beta15, May 29, 2000)
*
* For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals:
@ -162,13 +162,13 @@
* Y2K compliance in libpng:
* =========================
*
* May 17, 2000
* May 29, 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.7beta14 are Y2K compliant. It is my belief that earlier
* upward through 1.0.7beta15 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
@ -224,7 +224,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.0.7beta14"
#define PNG_LIBPNG_VER_STRING "1.0.7beta15"
#define PNG_LIBPNG_VER_SONUM 2
@ -234,7 +234,7 @@
#define PNG_LIBPNG_VER_RELEASE 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 14
#define PNG_LIBPNG_VER_BUILD 15
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
@ -1123,9 +1123,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.7beta14
and png.h are both at * version 1.0.7beta15
*/
typedef png_structp version_1_0_7beta14;
typedef png_structp version_1_0_7beta15;
typedef png_struct FAR * FAR * png_structpp;
@ -1318,7 +1318,7 @@ extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
#endif
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
/* Invert monocrome files */
/* Invert monochrome files */
extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
#endif
@ -1813,13 +1813,13 @@ png_ptr, png_infop info_ptr));
#endif
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
extern PNG_EXPORT(png_uint_32, png_get_x_offset_pixels) PNGARG((png_structp
extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
png_ptr, png_infop info_ptr));
extern PNG_EXPORT(png_uint_32, png_get_y_offset_pixels) PNGARG((png_structp
extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
png_ptr, png_infop info_ptr));
extern PNG_EXPORT(png_uint_32, png_get_x_offset_microns) PNGARG((png_structp
extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
png_ptr, png_infop info_ptr));
extern PNG_EXPORT(png_uint_32, png_get_y_offset_microns) PNGARG((png_structp
extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
png_ptr, png_infop info_ptr));
#endif /* PNG_EASY_ACCESS_SUPPORTED */
@ -2144,7 +2144,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.7beta14 - May 17, 2000 (header)\n"
" libpng version 1.0.7beta15 - May 29, 2000 (header)\n"
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on

View File

@ -1,6 +1,6 @@
/* pngasmrd.h - assembler version of utilities to read a PNG file
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1999, 2000 Glenn Randers-Pehrson
*

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -33,6 +33,10 @@
#define PNG_ZBUF_SIZE 8192
#endif
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#endif
/* If you are running on a machine where you cannot allocate more
* than 64K of memory at once, uncomment this. While libpng will not
* normally need that much memory in a chunk (unless you load up a very
@ -126,14 +130,15 @@
/* This is an attempt to force a single setjmp behaviour on Linux. If
* the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
*/
# ifdef __linux__
# ifdef _BSD_SOURCE
# define _PNG_SAVE_BSD_SOURCE
# undef _BSD_SOURCE
# endif
# ifdef _SETJMP_H
__png.h__ already includes setjmp.h
__dont__ include it again
__png.h__ already includes setjmp.h;
__dont__ include it again.;
# endif
#endif /* __linux__ */
@ -154,6 +159,11 @@
#include <string.h>
#endif
#ifdef _AIX
/* "index" macro in AIX strings.h conflicts with libpng's png_color_16.index */
#undef index
#endif
/* Other defines for things like memory and the like can go here. */
#ifdef PNG_INTERNAL
#include <stdlib.h>
@ -171,7 +181,7 @@
* them inside an appropriate ifdef/endif pair for portability.
*/
#if !defined(PNG_NO_FLOATING_POINT_SUPPORTED)
#if defined(PNG_FLOATING_POINT_SUPPORTED)
#if defined(MACOS)
/* We need to check that <math.h> hasn't already been included earlier
* as it seems it doesn't agree with <fp.h>, yet we should really use
@ -183,6 +193,12 @@
#else
#include <math.h>
#endif
#if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
#include <m68881.h>
#endif
#endif
/* Codewarrior on NT has linking problems without this. */
@ -318,12 +334,7 @@
#define PNG_NO_FIXED_POINT_SUPPORTED
#endif
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
#define PNG_FLOATING_POINT_SUPPORTED
#endif
/* Ignore attempt to turn off both floating and fixed point support */
#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
!defined(PNG_NO_FIXED_POINT_SUPPORTED)
#define PNG_FIXED_POINT_SUPPORTED

View File

@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -122,6 +122,9 @@ png_default_error(png_structp png_ptr, png_const_charp message)
{
#ifndef PNG_NO_CONSOLE_IO
fprintf(stderr, "libpng error: %s\n", message);
#else
if (message)
/* make compiler happy */ ;
#endif
#ifdef PNG_SETJMP_SUPPORTED
@ -135,7 +138,7 @@ png_default_error(png_structp png_ptr, png_const_charp message)
longjmp(png_ptr->jmpbuf, 1);
# endif
#else
if (png_ptr == NULL)
if (png_ptr)
/* make compiler happy */ ;
PNG_ABORT();
#endif
@ -151,8 +154,11 @@ png_default_warning(png_structp png_ptr, png_const_charp message)
{
#ifndef PNG_NO_CONSOLE_IO
fprintf(stderr, "libpng warning: %s\n", message);
#else
if (message)
/* appease compiler */ ;
#endif
if (png_ptr == NULL)
if (png_ptr)
return;
}

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 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998, Intel Corporation
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson

View File

@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -115,15 +115,17 @@ png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI
png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_pHYs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (info_ptr->valid & PNG_INFO_pHYs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter");
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
return (0);
else return (info_ptr->x_pixels_per_unit);
}
else
#else
return (0);
#endif
return (0);
}
@ -131,15 +133,17 @@ png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI
png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_pHYs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (info_ptr->valid & PNG_INFO_pHYs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter");
png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter");
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
return (0);
else return (info_ptr->y_pixels_per_unit);
}
else
#else
return (0);
#endif
return (0);
}
@ -147,8 +151,9 @@ png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
png_uint_32 PNGAPI
png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_pHYs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (info_ptr->valid & PNG_INFO_pHYs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter");
if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER ||
@ -156,7 +161,8 @@ png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
return (0);
else return (info_ptr->x_pixels_per_unit);
}
else
#else
return (0);
#endif
return (0);
}
@ -165,82 +171,92 @@ png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
float PNGAPI
png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_pHYs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
if (info_ptr->valid & PNG_INFO_pHYs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio");
if (info_ptr->x_pixels_per_unit == 0)
return ((float)0.0);
else
return ((float)info_ptr->y_pixels_per_unit
/(float)info_ptr->x_pixels_per_unit);
return ((float)((float)info_ptr->y_pixels_per_unit
/(float)info_ptr->x_pixels_per_unit));
}
else
#else
return (0.0);
#endif
return ((float)0.0);
return ((float)0.0);
}
#endif
png_uint_32 PNGAPI
png_int_32 PNGAPI
png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_oFFs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (info_ptr->valid & PNG_INFO_oFFs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns");
if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
return (0);
else return (info_ptr->x_offset);
}
else
#else
return (0);
#endif
return (0);
}
png_uint_32 PNGAPI
png_int_32 PNGAPI
png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_oFFs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (info_ptr->valid & PNG_INFO_oFFs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns");
if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
return (0);
else return (info_ptr->y_offset);
}
else
#else
return (0);
#endif
return (0);
}
png_uint_32 PNGAPI
png_int_32 PNGAPI
png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_oFFs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (info_ptr->valid & PNG_INFO_oFFs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns");
if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
return (0);
else return (info_ptr->x_offset);
}
else
#else
return (0);
#endif
return (0);
}
png_uint_32 PNGAPI
png_int_32 PNGAPI
png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
#if defined(PNG_oFFs_SUPPORTED)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
if (info_ptr->valid & PNG_INFO_oFFs)
{
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns");
if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
return (0);
else return (info_ptr->y_offset);
}
else
#else
return (0);
#endif
return (0);
}
@ -250,21 +266,21 @@ png_uint_32 PNGAPI
png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
{
return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5);
*.0254 +.5));
}
png_uint_32 PNGAPI
png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
{
return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5);
*.0254 +.5));
}
png_uint_32 PNGAPI
png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
{
return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr)
*.0254 +.5);
*.0254 +.5));
}
float PNGAPI
@ -278,7 +294,7 @@ float PNGAPI
png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
{
return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
*.00003937)
*.00003937);
}
#if defined(PNG_READ_pHYs_SUPPORTED)
@ -305,7 +321,7 @@ png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
{
*unit_type = (int)info_ptr->phys_unit_type;
retval |= PNG_INFO_pHYs;
if(unit_type == 1)
if(*unit_type == 1)
{
if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50);
if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50);

View File

@ -1,7 +1,7 @@
/* pngmem.c - stub functions for memory allocation
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -714,23 +714,26 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
for(;;)
{
ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH);
if (ret == Z_STREAM_END)
if (ret != Z_OK)
{
if (png_ptr->zstream.avail_in)
png_error(png_ptr, "Extra compressed data");
if (!(png_ptr->zstream.avail_out))
if (ret == Z_STREAM_END)
{
png_push_process_row(png_ptr);
}
if (png_ptr->zstream.avail_in)
png_error(png_ptr, "Extra compressed data");
if (!(png_ptr->zstream.avail_out))
{
png_push_process_row(png_ptr);
}
png_ptr->mode |= PNG_AFTER_IDAT;
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
break;
png_ptr->mode |= PNG_AFTER_IDAT;
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
break;
}
else if (ret == Z_BUF_ERROR)
break;
else
png_error(png_ptr, "Decompression Error");
}
else if (ret == Z_BUF_ERROR)
break;
else if (ret != Z_OK)
png_error(png_ptr, "Decompression Error");
if (!(png_ptr->zstream.avail_out))
{
png_push_process_row(png_ptr);

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -697,7 +697,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.7beta14
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta15
*/
void PNGAPI
@ -746,7 +746,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.7beta14
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta15
*/
void PNGAPI
png_read_image(png_structp png_ptr, png_bytepp image)

View File

@ -1,7 +1,7 @@
/* pngrio.c - functions for data input
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -979,6 +979,11 @@ png_init_read_transformations(png_structp png_ptr)
}
#endif
}
#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \
&& !defined(PNG_READ_BACKGROUND_SUPPORTED)
if(png_ptr)
return;
#endif
}
/* Modify the info structure to reflect the transformations. The
@ -1103,6 +1108,10 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
info_ptr->bit_depth);
info_ptr->rowbytes = ((info_ptr->width * info_ptr->pixel_depth + 7) >> 3);
#if !defined(PNG_READ_EXPAND_SUPPORTED)
if(png_ptr)
return;
#endif
}
/* Transform the row. The order of transformations is significant,

View File

@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -1347,16 +1347,16 @@ png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_pHYs\n");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before pHYS");
png_error(png_ptr, "Missing IHDR before pHYs");
else if (png_ptr->mode & PNG_HAVE_IDAT)
{
png_warning(png_ptr, "Invalid pHYS after IDAT");
png_warning(png_ptr, "Invalid pHYs after IDAT");
png_crc_finish(png_ptr, length);
return;
}
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
{
png_warning(png_ptr, "Duplicate pHYS chunk");
png_warning(png_ptr, "Duplicate pHYs chunk");
png_crc_finish(png_ptr, length);
return;
}
@ -2469,6 +2469,11 @@ png_do_read_interlace
row_info->rowbytes = ((final_width *
(png_uint_32)row_info->pixel_depth + 7) >> 3);
}
#if !defined(PNG_READ_PACKSWAP_SUPPORTED)
/* silence compiler warning */
if (transformations)
return;
#endif
}
#endif

View File

@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -232,7 +232,7 @@ static int wrote_question = 0;
than changing the library. */
#ifndef USE_FAR_KEYWORD
static void
png_default_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;
@ -257,7 +257,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
#define MIN(a,b) (a <= b ? a : b)
static void
png_default_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)
{
int check;
png_byte *n_data;
@ -299,7 +299,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
static void
png_default_flush(png_structp png_ptr)
pngtest_flush(png_structp png_ptr)
{
FILE *io_ptr;
io_ptr = (FILE *)CVT_PTR((png_ptr->io_ptr));
@ -314,7 +314,7 @@ png_default_flush(png_structp png_ptr)
than changing the library. */
#ifndef USE_FAR_KEYWORD
static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
@ -334,7 +334,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#define MIN(a,b) (a <= b ? a : b)
static void
png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */
@ -381,7 +381,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
* not used, but it is passed in case it may be useful.
*/
static void
png_default_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!)";
if (png_ptr != NULL && png_ptr->error_ptr != NULL)
@ -395,9 +395,9 @@ png_default_warning(png_structp png_ptr, png_const_charp message)
* error function pointer in png_set_error_fn().
*/
static void
png_default_error(png_structp png_ptr, png_const_charp message)
pngtest_error(png_structp png_ptr, png_const_charp message)
{
png_default_warning(png_ptr, message);
pngtest_warning(png_ptr, message);
/* We can return because png_error calls the default handler, which is
* actually OK in this case. */
}
@ -426,6 +426,8 @@ typedef memory_information FAR *memory_infop;
static memory_infop pinformation = NULL;
static int current_allocation = 0;
static int maximum_allocation = 0;
static int total_allocation = 0;
static int num_allocations = 0;
extern PNG_EXPORT(png_voidp,png_debug_malloc) PNGARG((png_structp png_ptr,
png_uint_32 size));
@ -448,6 +450,8 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
memory_infop pinfo = png_malloc_default(png_ptr, sizeof *pinfo);
pinfo->size = size;
current_allocation += size;
total_allocation += size;
num_allocations ++;
if (current_allocation > maximum_allocation)
maximum_allocation = current_allocation;
pinfo->pointer = png_malloc_default(png_ptr, size);
@ -560,8 +564,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
(png_error_ptr)NULL, (png_error_ptr)NULL);
#endif
#if defined(PNG_NO_STDIO)
png_set_error_fn(read_ptr, (png_voidp)inname, png_default_error,
png_default_warning);
png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error,
pngtest_warning);
#endif
#ifdef PNG_USER_MEM_SUPPORTED
write_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, (png_voidp)NULL,
@ -572,8 +576,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
(png_error_ptr)NULL, (png_error_ptr)NULL);
#endif
#if defined(PNG_NO_STDIO)
png_set_error_fn(write_ptr, (png_voidp)inname, png_default_error,
png_default_warning);
png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error,
pngtest_warning);
#endif
png_debug(0, "Allocating read_info, write_info and end_info structures\n");
read_info_ptr = png_create_info_struct(read_ptr);
@ -628,10 +632,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_init_io(read_ptr, fpin);
png_init_io(write_ptr, fpout);
#else
png_set_read_fn(read_ptr, (png_voidp)fpin, png_default_read_data);
png_set_write_fn(write_ptr, (png_voidp)fpout, png_default_write_data,
png_set_read_fn(read_ptr, (png_voidp)fpin, pngtest_read_data);
png_set_write_fn(write_ptr, (png_voidp)fpout, pngtest_write_data,
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
png_default_flush);
pngtest_flush);
#else
NULL);
#endif
@ -1280,10 +1284,14 @@ main(int argc, char *argv[])
#endif
}
#ifdef PNG_USER_MEM_SUPPORTED
fprintf(STDERR, " Current memory allocation: %d bytes\n",
fprintf(STDERR, " Current memory allocation: %10d bytes\n",
current_allocation);
fprintf(STDERR, " Maximum memory allocation: %d bytes\n",
fprintf(STDERR, " Maximum memory allocation: %10d bytes\n",
maximum_allocation);
fprintf(STDERR, " Total memory allocation: %10d bytes\n",
total_allocation);
fprintf(STDERR, " Number of allocations: %10d\n",
num_allocations);
#endif
}
else
@ -1351,10 +1359,14 @@ main(int argc, char *argv[])
#endif
}
#ifdef PNG_USER_MEM_SUPPORTED
fprintf(STDERR, " Current memory allocation: %d bytes\n",
fprintf(STDERR, " Current memory allocation: %10d bytes\n",
current_allocation);
fprintf(STDERR, " Maximum memory allocation: %d bytes\n",
fprintf(STDERR, " Maximum memory allocation: %10d bytes\n",
maximum_allocation);
fprintf(STDERR, " Total memory allocation: %10d bytes\n",
total_allocation);
fprintf(STDERR, " Number of allocations: %10d\n",
num_allocations);
#endif
}
@ -1380,4 +1392,4 @@ main(int argc, char *argv[])
}
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_0_7beta14 your_png_h_is_not_version_1_0_7beta14;
typedef version_1_0_7beta15 your_png_h_is_not_version_1_0_7beta15;

View File

@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -2,7 +2,7 @@
*
* For Intel x86 CPU and Microsoft Visual C++ compiler
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998, Intel Corporation
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson

View File

@ -1,7 +1,7 @@
/* pngwio.c - functions for data output
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file
*
* libpng 1.0.7beta14 - May 17, 2000
* libpng 1.0.7beta15 - May 29, 2000
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
@ -260,7 +260,49 @@ png_text_compress(png_structp png_ptr,
{
/* tell zlib we are finished */
ret = deflate(&png_ptr->zstream, Z_FINISH);
if (ret != Z_OK && ret != Z_STREAM_END)
if (ret == Z_OK)
{
/* check to see if we need more room */
if (!(png_ptr->zstream.avail_out))
{
/* check to make sure our output array has room */
if (comp->num_output_ptr >= comp->max_output_ptr)
{
int old_max;
old_max = comp->max_output_ptr;
comp->max_output_ptr = comp->num_output_ptr + 4;
if (comp->output_ptr != NULL)
{
png_charpp old_ptr;
old_ptr = comp->output_ptr;
/* This could be optimized to realloc() */
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
(png_uint_32)(comp->max_output_ptr * sizeof (png_charpp)));
png_memcpy(comp->output_ptr, old_ptr,
old_max * sizeof (png_charp));
png_free(png_ptr, old_ptr);
}
else
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
(png_uint_32)(comp->max_output_ptr * sizeof (png_charp)));
}
/* save off the data */
comp->output_ptr[comp->num_output_ptr] =
(png_charp)png_malloc(png_ptr, (png_uint_32)png_ptr->zbuf_size);
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
png_ptr->zbuf_size);
comp->num_output_ptr++;
/* and reset the buffer pointers */
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
png_ptr->zstream.next_out = png_ptr->zbuf;
}
}
else if (ret != Z_STREAM_END)
{
/* we got an error */
if (png_ptr->zstream.msg != NULL)
@ -268,45 +310,6 @@ png_text_compress(png_structp png_ptr,
else
png_error(png_ptr, "zlib error");
}
/* check to see if we need more room */
if (!(png_ptr->zstream.avail_out) && ret == Z_OK)
{
/* check to make sure our output array has room */
if (comp->num_output_ptr >= comp->max_output_ptr)
{
int old_max;
old_max = comp->max_output_ptr;
comp->max_output_ptr = comp->num_output_ptr + 4;
if (comp->output_ptr != NULL)
{
png_charpp old_ptr;
old_ptr = comp->output_ptr;
/* This could be optimized to realloc() */
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
(png_uint_32)(comp->max_output_ptr * sizeof (png_charpp)));
png_memcpy(comp->output_ptr, old_ptr,
old_max * sizeof (png_charp));
png_free(png_ptr, old_ptr);
}
else
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
(png_uint_32)(comp->max_output_ptr * sizeof (png_charp)));
}
/* save off the data */
comp->output_ptr[comp->num_output_ptr] = (png_charp)png_malloc(png_ptr,
(png_uint_32)png_ptr->zbuf_size);
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
png_ptr->zbuf_size);
comp->num_output_ptr++;
/* and reset the buffer pointers */
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
png_ptr->zstream.next_out = png_ptr->zbuf;
}
} while (ret != Z_STREAM_END);
/* text length is number of buffers plus last buffer */
@ -1672,20 +1675,23 @@ png_write_finish_row(png_structp png_ptr)
/* tell the compressor we are done */
ret = deflate(&png_ptr->zstream, Z_FINISH);
/* check for an error */
if (ret != Z_OK && ret != Z_STREAM_END)
if (ret == Z_OK)
{
/* check to see if we need more room */
if (!(png_ptr->zstream.avail_out))
{
png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
}
}
else if (ret != Z_STREAM_END)
{
if (png_ptr->zstream.msg != NULL)
png_error(png_ptr, png_ptr->zstream.msg);
else
png_error(png_ptr, "zlib error");
}
/* check to see if we need more room */
if (!(png_ptr->zstream.avail_out) && ret == Z_OK)
{
png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
}
} while (ret != Z_STREAM_END);
/* write any extra space */

View File

@ -0,0 +1,47 @@
# Commodore Amiga Makefile
# makefile for libpng and SAS C V6.5x compiler
# Copyright (C) 1995-2000 Wolf Faust
#
# Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h
#
# Location/path of zlib include files
ZLIB=/zlib
#compiler
CC=sc
#compiler flags
# WARNING: a bug in V6.51 causes bad code with OPTGO
# So use V6.55 or set NOOPTGO!!!!!!!!!
CFLAGS= NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\
OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \
DEFINE=PNG_INTERNAL
#linker flags
LDFLAGS= SD ND BATCH
#link libs
LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib
# linker
LN= slink
# file deletion command
RM= delete quiet
# library (.lib) file creation command
AR= oml
# make directory command
MKDIR= makedir
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o
all: libpng.lib pngtest
libpng.lib: $(OBJS)
-$(RM) libpng.lib
$(AR) libpng.lib r $(OBJS)
pngtest: pngtest.o libpng.lib
$(LN) <WITH <
$(LDFLAGS)
TO pngtest
FROM LIB:c.o pngtest.o
LIB $(LDLIBS)
<

View File

@ -31,7 +31,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
# where make install puts libpng.a, libpng.so*, and png.h

View File

@ -14,7 +14,7 @@ ZLIBINC=../zlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
CC=cc

View File

@ -34,7 +34,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include

View File

@ -34,7 +34,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include

View File

@ -25,7 +25,7 @@ RANLIB=echo
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include

View File

@ -19,8 +19,8 @@ CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 # -g -DPNG_DEBUG=5
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
LDSHARED=gcc -shared
VER=1.0.7beta14
LIBS=libpng.so.1.0.7beta14
VER=1.0.7beta15
LIBS=libpng.so.1.0.7beta15
SHAREDLIB=libpng.so
libdir=$(prefix)/lib32

View File

@ -31,7 +31,7 @@ RANLIB=echo
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it.
PNGMAJ = 2
PNGMIN = 1.0.7beta14
PNGMIN = 1.0.7beta15
PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include

View File

@ -5,7 +5,7 @@ unit pngdef;
interface
const
PNG_LIBPNG_VER_STRING = '1.0.7beta14';
PNG_LIBPNG_VER_STRING = '1.0.7beta15';
PNG_LIBPNG_VER = 10007;
type