Commit 6ee59633 authored by hybrid's avatar hybrid

Merge trunk with new versions of jpeglib and libpng

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3929 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 582cb750
...@@ -205,6 +205,7 @@ LN_S = @LN_S@ ...@@ -205,6 +205,7 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYMGR = @MEMORYMGR@ MEMORYMGR = @MEMORYMGR@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
NM = @NM@ NM = @NM@
...@@ -232,6 +233,7 @@ abs_builddir = @abs_builddir@ ...@@ -232,6 +233,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@ am__include = @am__include@
...@@ -264,7 +266,6 @@ libdir = @libdir@ ...@@ -264,7 +266,6 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
......
The Independent JPEG Group's JPEG software The Independent JPEG Group's JPEG software
========================================== ==========================================
README for release 8b of 16-May-2010 README for release 8c of 16-Jan-2011
==================================== ====================================
This distribution contains the eighth public release of the Independent JPEG This distribution contains the eighth public release of the Independent JPEG
...@@ -114,7 +114,7 @@ with respect to this software, its quality, accuracy, merchantability, or ...@@ -114,7 +114,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you, fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy. its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding. This software is copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below. All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this Permission is hereby granted to use, copy, modify, and distribute this
...@@ -254,8 +254,8 @@ ARCHIVE LOCATIONS ...@@ -254,8 +254,8 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org. The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in The most recent released version can always be found there in
directory "files". This particular version will be archived as directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v8b.tar.gz, and in Windows-compatible http://www.ijg.org/files/jpegsrc.v8c.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr8b.zip. "zip" archive format as http://www.ijg.org/files/jpegsr8c.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG. general information about JPEG.
...@@ -285,8 +285,8 @@ Thank to John Korejwa and Massimo Ballerini for inviting me to ...@@ -285,8 +285,8 @@ Thank to John Korejwa and Massimo Ballerini for inviting me to
fruitful consultations in Boston, MA and Milan, Italy. fruitful consultations in Boston, MA and Milan, Italy.
Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
Maier-Gerber, Walter Stoeber, and Fred Schmitz for corresponding Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
business development. for corresponding business development.
Thank to Nico Zschach and Dirk Stelling of the technical support team Thank to Nico Zschach and Dirk Stelling of the technical support team
at the Digital Images company in Halle for providing me with extra at the Digital Images company in Halle for providing me with extra
......
This source diff could not be displayed because it is too large. You can view the blob instead.
CHANGE LOG for Independent JPEG Group's JPEG software CHANGE LOG for Independent JPEG Group's JPEG software
Version 8c 16-Jan-2011
-----------------------
Add option to compression library and cjpeg (-block N) to use
different DCT block size.
All N from 1 to 16 are possible. Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality.
SmartScale capable decoder (introduced with IJG JPEG 8) required.
Version 8b 16-May-2010 Version 8b 16-May-2010
----------------------- -----------------------
......
.TH CJPEG 1 "30 December 2009" .TH CJPEG 1 "14 November 2010"
.SH NAME .SH NAME
cjpeg \- compress an image file to a JPEG file cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS .SH SYNOPSIS
...@@ -64,7 +64,10 @@ Create progressive JPEG file (see below). ...@@ -64,7 +64,10 @@ Create progressive JPEG file (see below).
.TP .TP
.BI \-scale " M/N" .BI \-scale " M/N"
Scale the output image by a factor M/N. Currently supported scale factors are Scale the output image by a factor M/N. Currently supported scale factors are
8/N with all N from 1 to 16. M/N with all N from 1 to 16, where M is the destination DCT size, which is 8
by default (see
.BI \-block " N"
switch below).
.TP .TP
.B \-targa .B \-targa
Input file is Targa format. Targa files that contain an "identification" Input file is Targa format. Targa files that contain an "identification"
...@@ -152,6 +155,17 @@ about the same --- often a little smaller. ...@@ -152,6 +155,17 @@ about the same --- often a little smaller.
.PP .PP
Switches for advanced users: Switches for advanced users:
.TP .TP
.BI \-block " N"
Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality
(exact DCT stage possible with 1 or 2; with the default quality of 75 and
default Luminance qtable the DCT+Quantization stage is lossless for N=1).
CAUTION: An implementation of the JPEG SmartScale extension is required for
this feature. SmartScale enabled JPEG is not yet widely implemented, so
many decoders will be unable to view a SmartScale extended JPEG file at all.
.TP
.B \-dct int .B \-dct int
Use integer DCT method (default). Use integer DCT method (default).
.TP .TP
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cjpeg.c * cjpeg.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding. * Modified 2003-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
...@@ -165,6 +165,9 @@ usage (void) ...@@ -165,6 +165,9 @@ usage (void)
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n"); fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
#endif #endif
fprintf(stderr, "Switches for advanced users:\n"); fprintf(stderr, "Switches for advanced users:\n");
#ifdef DCT_SCALING_SUPPORTED
fprintf(stderr, " -block N DCT block size (1..16; default is 8)\n");
#endif
#ifdef DCT_ISLOW_SUPPORTED #ifdef DCT_ISLOW_SUPPORTED
fprintf(stderr, " -dct int Use integer DCT method%s\n", fprintf(stderr, " -dct int Use integer DCT method%s\n",
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : "")); (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
...@@ -254,10 +257,30 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv, ...@@ -254,10 +257,30 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#endif #endif
} else if (keymatch(arg, "baseline", 1)) { } else if (keymatch(arg, "baseline", 2)) {
/* Force baseline-compatible output (8-bit quantizer values). */ /* Force baseline-compatible output (8-bit quantizer values). */
force_baseline = TRUE; force_baseline = TRUE;
} else if (keymatch(arg, "block", 2)) {
/* Set DCT block size. */
#if defined(DCT_SCALING_SUPPORTED) && defined(JPEG_LIB_VERSION_MAJOR) && \
(JPEG_LIB_VERSION_MAJOR > 8 || (JPEG_LIB_VERSION_MAJOR == 8 && \
defined(JPEG_LIB_VERSION_MINOR) && JPEG_LIB_VERSION_MINOR >= 3))
int val;
if (++argn >= argc) /* advance to next argument */
usage();
if (sscanf(argv[argn], "%d", &val) != 1)
usage();
if (val < 1 || val > 16)
usage();
cinfo->block_size = val;
#else
fprintf(stderr, "%s: sorry, block size setting not supported\n",
progname);
exit(EXIT_FAILURE);
#endif
} else if (keymatch(arg, "dct", 2)) { } else if (keymatch(arg, "dct", 2)) {
/* Select DCT algorithm. */ /* Select DCT algorithm. */
if (++argn >= argc) /* advance to next argument */ if (++argn >= argc) /* advance to next argument */
......
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Configure script for IJG libjpeg # Configure script for IJG libjpeg
# #
AC_INIT([libjpeg], [8.0.2]) AC_INIT([libjpeg], [8.3.0])
# Directory where autotools helper scripts lives. # Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([.]) AC_CONFIG_AUX_DIR([.])
...@@ -63,7 +63,7 @@ VERS_2 { ...@@ -63,7 +63,7 @@ VERS_2 {
global: sym; global: sym;
} VERS_1; } VERS_1;
EOF EOF
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[have_ld_version_script=yes], [have_ld_version_script=no]) [have_ld_version_script=yes], [have_ld_version_script=no])
rm -f conftest.map rm -f conftest.map
LDFLAGS="$save_LDFLAGS" LDFLAGS="$save_LDFLAGS"
...@@ -306,10 +306,11 @@ AC_DEFINE([NO_MKTEMP],[1],[The mktemp() function is not available.])])]) ...@@ -306,10 +306,11 @@ AC_DEFINE([NO_MKTEMP],[1],[The mktemp() function is not available.])])])
fi fi
AC_SUBST(MEMORYMGR) AC_SUBST(MEMORYMGR)
# Extract the library version ID from jpeglib.h. # Extract the library version IDs from jpeglib.h.
AC_MSG_CHECKING([libjpeg version number]) AC_MSG_CHECKING([libjpeg version number])
[JPEG_LIB_VERSION=`sed -e '/^#define JPEG_LIB_VERSION/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`] [JPEG_LIB_VERSION_MAJOR=`sed -e '/^#define JPEG_LIB_VERSION_MAJOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:2"] [JPEG_LIB_VERSION_MINOR=`sed -e '/^#define JPEG_LIB_VERSION_MINOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION_MAJOR + $JPEG_LIB_VERSION_MINOR`:0:$JPEG_LIB_VERSION_MINOR"]
AC_MSG_RESULT([$JPEG_LIB_VERSION]) AC_MSG_RESULT([$JPEG_LIB_VERSION])
AC_SUBST([JPEG_LIB_VERSION]) AC_SUBST([JPEG_LIB_VERSION])
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* jcmarker.c * jcmarker.c
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2009 by Guido Vollbeding. * Modified 2003-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
...@@ -231,10 +231,10 @@ emit_dac (j_compress_ptr cinfo) ...@@ -231,10 +231,10 @@ emit_dac (j_compress_ptr cinfo)
char ac_in_use[NUM_ARITH_TBLS]; char ac_in_use[NUM_ARITH_TBLS];
int length, i; int length, i;
jpeg_component_info *compptr; jpeg_component_info *compptr;
for (i = 0; i < NUM_ARITH_TBLS; i++) for (i = 0; i < NUM_ARITH_TBLS; i++)
dc_in_use[i] = ac_in_use[i] = 0; dc_in_use[i] = ac_in_use[i] = 0;
for (i = 0; i < cinfo->comps_in_scan; i++) { for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i]; compptr = cinfo->cur_comp_info[i];
/* DC needs no table for refinement scan */ /* DC needs no table for refinement scan */
...@@ -244,23 +244,25 @@ emit_dac (j_compress_ptr cinfo) ...@@ -244,23 +244,25 @@ emit_dac (j_compress_ptr cinfo)
if (cinfo->Se) if (cinfo->Se)
ac_in_use[compptr->ac_tbl_no] = 1; ac_in_use[compptr->ac_tbl_no] = 1;
} }
length = 0; length = 0;
for (i = 0; i < NUM_ARITH_TBLS; i++) for (i = 0; i < NUM_ARITH_TBLS; i++)
length += dc_in_use[i] + ac_in_use[i]; length += dc_in_use[i] + ac_in_use[i];
emit_marker(cinfo, M_DAC); if (length) {
emit_marker(cinfo, M_DAC);
emit_2bytes(cinfo, length*2 + 2);
emit_2bytes(cinfo, length*2 + 2);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) { for (i = 0; i < NUM_ARITH_TBLS; i++) {
emit_byte(cinfo, i); if (dc_in_use[i]) {
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); emit_byte(cinfo, i);
} emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
if (ac_in_use[i]) { }
emit_byte(cinfo, i + 0x10); if (ac_in_use[i]) {
emit_byte(cinfo, cinfo->arith_ac_K[i]); emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
}
} }
} }
#endif /* C_ARITH_CODING_SUPPORTED */ #endif /* C_ARITH_CODING_SUPPORTED */
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* jpeglib.h * jpeglib.h
* *
* Copyright (C) 1991-1998, Thomas G. Lane. * Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding. * Modified 2002-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
...@@ -33,11 +33,13 @@ extern "C" { ...@@ -33,11 +33,13 @@ extern "C" {
#endif #endif
#endif #endif
/* Version ID for the JPEG library. /* Version IDs for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 80". * Might be useful for tests like "#if JPEG_LIB_VERSION >= 80".
*/ */
#define JPEG_LIB_VERSION 80 /* Version 8.0 */ #define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */
#define JPEG_LIB_VERSION_MAJOR 8
#define JPEG_LIB_VERSION_MINOR 3
/* Various constants determining the sizes of things. /* Various constants determining the sizes of things.
......
/* /*
* jversion.h * jversion.h
* *
* Copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding. * Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software. * This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file. * For conditions of distribution and use, see the accompanying README file.
* *
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
*/ */
#define JVERSION "8b 16-May-2010" #define JVERSION "8c 16-Jan-2011"
#define JCOPYRIGHT "Copyright (C) 2010, Thomas G. Lane, Guido Vollbeding" #define JCOPYRIGHT "Copyright (C) 2011, Thomas G. Lane, Guido Vollbeding"
USING THE IJG JPEG LIBRARY USING THE IJG JPEG LIBRARY
Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding. Copyright (C) 1994-2010, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software. This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file. For conditions of distribution and use, see the accompanying README file.
...@@ -876,6 +876,18 @@ jpeg_simple_progression (j_compress_ptr cinfo) ...@@ -876,6 +876,18 @@ jpeg_simple_progression (j_compress_ptr cinfo)
Compression parameters (cinfo fields) include: Compression parameters (cinfo fields) include:
int block_size
Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality.
An exact DCT stage is possible with 1 or 2.
With the default quality of 75 and default Luminance qtable
the DCT+Quantization stage is lossless for value 1.
Note that values other than 8 require a SmartScale capable decoder,
introduced with IJG JPEG 8. Setting the block_size parameter for
compression works with version 8c and later.
J_DCT_METHOD dct_method J_DCT_METHOD dct_method
Selects the algorithm used for the DCT step. Choices are: Selects the algorithm used for the DCT step. Choices are:
JDCT_ISLOW: slow but accurate integer algorithm JDCT_ISLOW: slow but accurate integer algorithm
...@@ -895,8 +907,10 @@ J_DCT_METHOD dct_method ...@@ -895,8 +907,10 @@ J_DCT_METHOD dct_method
unsigned int scale_num, scale_denom unsigned int scale_num, scale_denom
Scale the image by the fraction scale_num/scale_denom. Default is Scale the image by the fraction scale_num/scale_denom. Default is
1/1, or no scaling. Currently, the supported scaling ratios are 1/1, or no scaling. Currently, the supported scaling ratios are
8/N with all N from 1 to 16. (The library design allows for arbitrary M/N with all N from 1 to 16, where M is the destination DCT size,
scaling ratios but this is not likely to be implemented any time soon.) which is 8 by default (see block_size parameter above).
(The library design allows for arbitrary scaling ratios but this
is not likely to be implemented any time soon.)
J_COLOR_SPACE jpeg_color_space J_COLOR_SPACE jpeg_color_space
int num_components int num_components
......
This diff is collapsed.
...@@ -87,8 +87,9 @@ The basic command line switches for cjpeg are: ...@@ -87,8 +87,9 @@ The basic command line switches for cjpeg are:
-progressive Create progressive JPEG file (see below). -progressive Create progressive JPEG file (see below).
-scale M/N Scale the output image by a factor M/N. Currently -scale M/N Scale the output image by a factor M/N. Currently
supported scale factors are 8/N with all N from 1 to supported scale factors are M/N with all N from 1 to
16. 16, where M is the destination DCT size, which is 8 by
default (see -block N switch below).
-targa Input file is Targa format. Targa files that contain -targa Input file is Targa format. Targa files that contain
an "identification" field will not be automatically an "identification" field will not be automatically
...@@ -150,6 +151,19 @@ file size is about the same --- often a little smaller. ...@@ -150,6 +151,19 @@ file size is about the same --- often a little smaller.
Switches for advanced users: Switches for advanced users:
-block N Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality
(exact DCT stage possible with 1 or 2; with the
default quality of 75 and default Luminance qtable
the DCT+Quantization stage is lossless for N=1).
CAUTION: An implementation of the JPEG SmartScale
extension is required for this feature. SmartScale
enabled JPEG is not yet widely implemented, so many
decoders will be unable to view a SmartScale extended
JPEG file at all.
-dct int Use integer DCT method (default). -dct int Use integer DCT method (default).
-dct fast Use fast integer DCT (less accurate). -dct fast Use fast integer DCT (less accurate).
-dct float Use floating-point DCT method. -dct float Use floating-point DCT method.
......
Libpng 1.4.4 - September 23, 2010 Libpng 1.5.5 - September 22, 2011
This is a public release of libpng, intended for use in production codes. This is a public release of libpng, intended for use in production codes.
...@@ -8,58 +8,84 @@ Files available for download: ...@@ -8,58 +8,84 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
libpng-1.4.4.tar.xz (LZMA-compressed, recommended) libpng-1.5.5.tar.xz (LZMA-compressed, recommended)
libpng-1.4.4.tar.gz libpng-1.5.5.tar.gz
libpng-1.4.4.tar.bz2 libpng-1.5.5.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lpng144.zip lpng155.7z (LZMA-compressed, recommended)
lpng144.7z lpng155.zip
Other information: Other information:
libpng-1.4.4-README.txt libpng-1.5.5-README.txt
libpng-1.4.4-LICENSE.txt libpng-1.5.5-LICENSE.txt
Changes since the last public release (1.4.3): Changes since the last public release (1.5.4):
Removed extraneous new_push_process_row.c file.
Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
Removed some newly-added TAB characters from pngpread.c.
Fixed some indentation in pngpread.c and pngrutil.c
Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
Put "#ifndef PNG_EXTERN, #endif" around "#define PNG_EXTERN" in pngpriv.h
Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
Moved the definition of png_snprintf() outside of the enclosing
#ifdef blocks in pngconf.h
Made a special case "#define PNGAPI" in pngconf.h for WATCOM.
Removed reference to cbuilder5/* from Makefile.in and Makefile.am
Updated the read macros and functions from 1.5.0beta38.
Updated projects/visualc71 so it can find scripts/pnglibconf.h
Removed unused png_mem_* defines from pngconf.h.
Correct use of _WINDOWS_ in pngconf.h
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Updated prebuilt aclocal.m4 and ltmain.sh
Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
Updated CMakelists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
installing libpng in /usr/lib64 (Funda Wang).
Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
Revised CMakeLists.txt to make symlinks instead of copies when installing.
Moved "#include pngusr.h" ahead of PNG_USER_PRIVATEBUILD test in pngconf.h
Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c
Eliminated new unnecessary #if tests regarding the sCAL chunk from pngrutil.c
Updated the xcode project to work with libpng-1.4.x and added iOS targets
for simulator and device (Philippe Hausler).
Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
$AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
Rebuilt configure scripts with automake-1.11.1 instead of automake-1.11.
Removed unused mkinstalldirs file.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Fixed some typos and made other minor changes in the manual.
or to png-mng-implement at lists.sf.net (subscription required; visit Updated contrib/pngminus/makefile.std (Samuli Souminen)
https://lists.sourceforge.net/lists/listinfo/png-mng-implement). Revised Makefile.am and Makefile.in to look in the right directory for
pnglibconf.h.prebuilt
Enabled compilation with g++ compiler. This compiler does not recognize
the file extension, so it always compiles with C++ rules. Made minor
changes to pngrutil.c to cast results where C++ expects it but C does not.
Minor editing of libpng.3 and libpng-manual.txt.
Revised CMakeLists.txt (Clifford Yapp)
Updated commentary about the png_rgb_to_gray() default coefficients
in the manual and in pngrtran.c
Prevent unexpected API exports from non-libpng DLLs on Windows. The "_DLL"
is removed from the test of whether a DLL is being built (this erroneously
caused the libpng APIs to be marked as DLL exports in static builds under
Microsoft Visual Studio). Almost all of the libpng building configuration
is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in
pngconf.h, though, so that it is colocated with the import definition (it
is no longer used anywhere in the installed headers). The VStudio project
definitions have been cleaned up: "_USRDLL" has been removed from the
static library builds (this was incorrect), and PNG_USE_DLL has been added
to pngvalid to test the functionality (pngtest does not supply it,
deliberately). The spurious "_EXPORTS" has been removed from the
libpng build (all these errors were a result of copy/paste between project
configurations.)
Added new types and internal functions for CIE RGB end point handling to
pngpriv.h (functions yet to be implemented).
Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt
(Clifford Yap)
Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler):
The rgb_to_gray code had errors when combined with gamma correction.
Some pixels were treated as true grey when they weren't and such pixels
and true grey ones were not gamma corrected (the original value of the
red component was used instead). APIs to get and set cHRM using color
space end points have been added and the rgb_to_gray code that defaults
based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT
VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected.
A considerable number of tests has been added to pngvalid for the
rgb_to_gray transform.
Arithmetic errors in rgb_to_gray whereby the calculated gray value was
truncated to the bit depth rather than rounded have been fixed except in
the 8-bit non-gamma-corrected case (where consistency seems more important
than correctness.) The code still has considerable inaccuracies in the
8-bit case because 8-bit linear arithmetic is used.
Added "$(ARCH)" option to makefile.darwin
Added SunOS support to configure.ac and Makefile.am
Changed png_chunk_benign_error() to png_warning() in png.c, in
png_XYZ_from_xy_checked().
Fixed 64-bit compilation errors (gcc). The errors fixed relate
to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world. This produces potential truncation errors that the
compiler correctly flags.
Constant changes for 64-bit compatibility (removal of L suffixes). The
16-bit cases still use "L" as we don't have a 16-bit test system.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P Glenn R-P
*/ }
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Installing libpng version 1.4.4 - September 23, 2010 Installing libpng
On Unix/Linux and similar systems, you can simply type On Unix/Linux and similar systems, you can simply type
...@@ -13,10 +13,16 @@ If configure does not work on your system and you have a reasonably ...@@ -13,10 +13,16 @@ If configure does not work on your system and you have a reasonably
up-to-date set of tools, running ./autogen.sh before running ./configure up-to-date set of tools, running ./autogen.sh before running ./configure
may fix the problem. You can also run the individual commands in may fix the problem. You can also run the individual commands in
autogen.sh with the --force option, if supported by your version of autogen.sh with the --force option, if supported by your version of
the tools. If you run 'libtoolize --force', though, this will replace the tools. To be really sure that you aren't using any of the included
the distributed, patched, version of ltmain.sh with an unpatched version pre-built scripts, you can do this:
and your shared library builds may fail to produce libraries with the
correct version numbers. ./configure --enable-maintainer-mode
make maintainer-clean
./autogen.sh
./configure [--prefix=/path] [other options]
make
make install
make check
Instead, you can use one of the custom-built makefiles in the Instead, you can use one of the custom-built makefiles in the
"scripts" directory "scripts" directory
...@@ -46,8 +52,8 @@ to have access to the zlib.h and zconf.h include files that ...@@ -46,8 +52,8 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed. correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they You can rename the directories that you downloaded (they
might be called "libpng-1.4.4" or "libpng14" and "zlib-1.2.3" might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.5"
or "zlib123") so that you have directories called "zlib" and "libpng". or "zlib125") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this: Your directory structure should look like this:
...@@ -62,7 +68,7 @@ Your directory structure should look like this: ...@@ -62,7 +68,7 @@ Your directory structure should look like this:
configure.ac, configure, Makefile.am, Makefile.in, configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in, autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub, libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, test-pngtest.sh depcomp, install-sh, mkinstalldirs, test-pngtest.sh
contrib contrib
gregbook gregbook
pngminim pngminim
...@@ -70,14 +76,12 @@ Your directory structure should look like this: ...@@ -70,14 +76,12 @@ Your directory structure should look like this:
pngsuite pngsuite
visupng visupng
projects projects
cbuilder5 (Borland)
visualc6 (msvc)
visualc71 visualc71
vstudio vstudio
xcode
scripts scripts
makefile.* makefile.*
*.def (module definition files) *.def (module definition files)
etc.
pngtest.png pngtest.png
etc. etc.
zlib zlib
...@@ -108,7 +112,7 @@ scripts directory into this directory, for example ...@@ -108,7 +112,7 @@ scripts directory into this directory, for example
Read the makefile to see if you need to change any source or Read the makefile to see if you need to change any source or
target directories to match your preferences. target directories to match your preferences.
Then read pngconf.h to see if you want to make any configuration Then read pnglibconf.dfa to see if you want to make any configuration
changes. changes.
Then just run "make" which will create the libpng library in Then just run "make" which will create the libpng library in
...@@ -126,19 +130,6 @@ do that, run "make install" in the zlib directory first if necessary). ...@@ -126,19 +130,6 @@ do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have Some also allow you to run "make test-installed" after you have
run "make install". run "make install".
If you encounter a compiler error message complaining about the Further information can be found in the README and libpng-manual.txt
lines
__png.h__ already includes setjmp.h;
__dont__ include it again.;
this means you have compiled another module that includes setjmp.h,
which is hazardous because the two modules might not include exactly
the same setjmp.h. If you are sure that you know what you are doing
and that they are exactly the same, then you can comment out or
delete the two lines. Better yet, use the cexcept interface
instead, as demonstrated in contrib/visupng of the libpng distribution.
Further information can be found in the README and libpng.txt
files, in the individual makefiles, in png.h, and the manual pages files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5. libpng.3 and png.5.
...@@ -10,8 +10,8 @@ this sentence. ...@@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.4, September 23, 2010, are libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are
Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5 distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors with the following individual added to the list of Contributing Authors
...@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative. ...@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
September 23, 2010 September 22, 2011
README for libpng version 1.4.4 - September 23, 2010 (shared library 14.0) README for libpng version 1.5.5 - September 22, 2011 (shared library 15.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
...@@ -58,7 +58,7 @@ on the PNG-implement mailing list and not on material submitted ...@@ -58,7 +58,7 @@ on the PNG-implement mailing list and not on material submitted
privately to Guy, Andreas, or Glenn. They will forward any good privately to Guy, Andreas, or Glenn. They will forward any good
suggestions to the list. suggestions to the list.
For a detailed description on using libpng, read libpng.txt. For For a detailed description on using libpng, read libpng-manual.txt. For
examples of libpng in a program, see example.c and pngtest.c. For usage examples of libpng in a program, see example.c and pngtest.c. For usage
information and restrictions (what little they are) on libpng, see information and restrictions (what little they are) on libpng, see
png.h. For a description on using zlib (the compression library used by png.h. For a description on using zlib (the compression library used by
...@@ -114,19 +114,16 @@ given in previous versions of this document. He and Andreas will ...@@ -114,19 +114,16 @@ given in previous versions of this document. He and Andreas will
read mail addressed to the png-implement list, however. read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to Please do not send general questions about PNG. Send them to
the (png-list at ccrc.wustl.edu, subscription required, write to png-mng-misc at lists.sf.net (subscription required; visit
majordomo at ccrc.wustl.edu with "subscribe png-list" in your message). https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
On the other hand, subscribe). If you have a question about something
please do not send libpng questions to that address, send them to me
or to the png-implement list. I'll
get them in the end anyway. If you have a question about something
in the PNG specification that is related to using libpng, send it in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng, to me. Send me any questions that start with "I was using libpng,
and ...". If in doubt, send questions to me. I'll bounce them and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary. to others, if necessary.
Please do not send suggestions on how to change PNG. We have Please do not send suggestions on how to change PNG. We have
been discussing PNG for nine years now, and it is official and been discussing PNG for sixteen years now, and it is official and
finished. If you have suggestions for libpng, however, I'll finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately, gladly listen. Even if your suggestion is not used immediately,
it may be used later. it may be used later.
...@@ -141,13 +138,17 @@ Files in this distribution: ...@@ -141,13 +138,17 @@ Files in this distribution:
TODO => Things not implemented in the current library TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions example.c => Example code for using libpng functions
libpng.3 => manual page for libpng (includes libpng.txt) libpng.3 => manual page for libpng (includes libpng-manual.txt)
libpng.txt => Description of libpng and its functions libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions libpngpf.3 => manual page for libpng's private functions
png.5 => manual page for the PNG format png.5 => manual page for the PNG format
png.c => Basic interface functions common to library png.c => Basic interface functions common to library
png.h => Library function and interface declarations png.h => Library function and interface declarations (public)
pngconf.h => System specific library configuration pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions pngmem.c => Memory handling functions
...@@ -176,72 +177,16 @@ Files in this distribution: ...@@ -176,72 +177,16 @@ Files in this distribution:
visupng => Contains a MSVC workspace for VisualPng visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for projects => Contains project files and workspaces for
building a DLL building a DLL
c5builder => Contains a Borland workspace for building cbuilder5 => Contains a Borland workspace for building
libpng and zlib libpng and zlib
visualc6 => Contains a Microsoft Visual C++ (MSVC) visualc6 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib workspace for building libpng and zlib
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
xcode => Contains an Apple xcode
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng: scripts => Directory containing scripts for building libpng:
descrip.mms => VMS makefile for MMS or MMK (see scripts/README.txt for the list of scripts)
makefile.std => Generic UNIX makefile (cc, creates static
libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng14.so.14.1.4.4)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
ftp://ftp.cs.wisc.edu/ghost)
makefile.aix => AIX makefile
makefile.cygwin => Cygwin/gcc makefile
makefile.darwin => Darwin makefile
makefile.dec => DEC Alpha UNIX makefile
makefile.freebsd => FreeBSD makefile
makefile.hpgcc => HPUX makefile using gcc
makefile.hpux => HPUX (10.20 and 11.00) makefile
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
makefile.intel => Intel C/C++ version 4.0 and later
makefile.mingw => Mingw/gcc makefile
makefile.netbsd => NetBSD/cc makefile, makes libpng.so.
makefile.ne14bsd => NetBSD/cc makefile, makes
libpng14.so
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng14.so.14.1.4.4)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile
makefile.amiga => Amiga makefile
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC
compiler (Requires SCOPTIONS, copied from
scripts/SCOPTIONS.ppc)
makefile.atari => Atari makefile
makefile.beos => BEOS makefile for X86
makefile.bor => Borland makefile (uses bcc)
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
makefile.tc3 => Turbo C 3.0 makefile
makefile.dj2 => DJGPP 2 makefile
makefile.msc => Microsoft C makefile
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and
later (does not use assembler code)
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
png32ce.def => module definition for makefile.cegccg
pngos2.def => OS/2 module definition file used by
makefile.os2
pngwin.def => module definition file used by
makefile.cygwin and makefile.mingw
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
makevms.com => VMS build script
SCOPTIONS.ppc => Used with smakefile.ppc
Good luck, and happy coding. Good luck, and happy coding.
......
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
TODO - list of things to do for libpng: TODO - list of things to do for libpng:
Final bug fixes. Final bug fixes.
Improve API by hiding the png_struct and png_info structs.
Finish work on the no-floating-point version (including gamma compensation)
Better C++ wrapper/full C++ implementation? Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C". Fix problem with C++ and EXTERN "C".
cHRM transformation. cHRM transformation.
Improve setjmp/longjmp usage or remove it in favor of returning error codes. Remove setjmp/longjmp usage in favor of returning error codes.
Add "grayscale->palette" transformation and "palette->grayscale" detection. Add "grayscale->palette" transformation and "palette->grayscale" detection.
Improved quantizing and dithering. Improved dithering.
Multi-lingual error and warning message support. Multi-lingual error and warning message support.
Complete sRGB transformation (presently it simply uses gamma=0.45455). Complete sRGB transformation (presently it simply uses gamma=0.45455).
Man pages for function calls. Man pages for function calls.
...@@ -18,14 +16,12 @@ Better filter selection ...@@ -18,14 +16,12 @@ Better filter selection
(counting huffman bits/precompression? filter inertia? filter costs?). (counting huffman bits/precompression? filter inertia? filter costs?).
Histogram creation. Histogram creation.
Text conversion between different code pages (Latin-1 -> Mac and DOS). Text conversion between different code pages (Latin-1 -> Mac and DOS).
Build gamma tables using fixed point (and do away with floating point entirely).
Avoid building gamma tables whenever possible. Avoid building gamma tables whenever possible.
Use greater precision when changing to linear gamma for compositing against Use greater precision when changing to linear gamma for compositing against
background and doing rgb-to-gray transformation. background and doing rgb-to-gray transformation.
Investigate pre-incremented loop counters and other loop constructions. Investigate pre-incremented loop counters and other loop constructions.
Add interpolated method of handling interlacing. Add interpolated method of handling interlacing.
Provide for conditional compilation of 16-bit support (except for the
initial stripping down to 8-bits when reading a 16-bit PNG datastream).
Switch to the simpler zlib (zlib/libpng) license if legally possible. Switch to the simpler zlib (zlib/libpng) license if legally possible.
Extend pngvalid.c to validate more of the libpng transformations.
*/ */
#!/bin/sh
echo " echo "
There is no \"configure\" script in this distribution of There is no \"configure\" script in this distribution of
libpng-1.4.4. libpng-1.5.5.
Instead, please copy the appropriate makefile for your system from the Instead, please copy the appropriate makefile for your system from the
\"scripts\" directory. Read the INSTALL file for more details. \"scripts\" directory. Read the INSTALL file for more details.
Update, July 2004: you can get a \"configure\" based distribution Update, July 2004: you can get a \"configure\" based distribution
from the libpng distribution sites. Download the file from the libpng distribution sites. Download the file
libpng-1.4.4.tar.gz, libpng-1.4.4.tar.xz, or libpng-1.4.4.tar.bz2 libpng-1.5.5.tar.gz, libpng-1.5.5.tar.xz, or libpng-1.5.5.tar.bz2
If the line endings in the files look funny, which is likely to be the
case if you were trying to run \"configure\" on a Linux machine, you may
wish to get the other distribution of libpng. It is available in both
tar.gz/tar.xz (UNIX style line endings) and .7z/.zip (DOS style line
endings) formats.
" "
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
...@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all. ...@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
...@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals ...@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
...@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ...@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
# macros -------------------------------------------------------------------- # macros --------------------------------------------------------------------
PNGINC = -I/usr/local/include/libpng14 PNGINC = -I/usr/local/include/libpng15
PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng PNGLIB = -L/usr/local/lib -lpng15 # dynamically linked against libpng
#PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng #PNGLIB = /usr/local/lib/libpng15.a # statically linked against libpng
# or: # or:
#PNGINC = -I../.. #PNGINC = -I../..
#PNGLIB = -L../.. -lpng #PNGLIB = -L../.. -lpng
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
# macros -------------------------------------------------------------------- # macros --------------------------------------------------------------------
#PNGDIR = /usr/local/lib #PNGDIR = /usr/local/lib
#PNGINC = -I/usr/local/include/libpng14 #PNGINC = -I/usr/local/include/libpng15
#PNGLIBd = -L$(PNGDIR) -lpng14 # dynamically linked, installed libpng #PNGLIBd = -L$(PNGDIR) -lpng15 # dynamically linked, installed libpng
#PNGLIBs = $(PNGDIR)/libpng14.a # statically linked, installed libpng #PNGLIBs = $(PNGDIR)/libpng15.a # statically linked, installed libpng
# or: # or:
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
#PNGDIR = ../libpng #PNGDIR = ../libpng
PNGINC = -I$(PNGDIR) PNGINC = -I$(PNGDIR)
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng14 # dynamically linked PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng15 # dynamically linked
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
ZDIR = /usr/local/lib ZDIR = /usr/local/lib
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# "c:\windows\command.com /e:4096" as the program command line and set the # "c:\windows\command.com /e:4096" as the program command line and set the
# working directory to this directory. Then double-click to open the new # working directory to this directory. Then double-click to open the new
# DOS-prompt window with a bigger environment and retry the commands above. # DOS-prompt window with a bigger environment and retry the commands above.
# #
# This makefile assumes libpng and zlib have already been built or downloaded # This makefile assumes libpng and zlib have already been built or downloaded
# and are in subdirectories at the same level as the current subdirectory # and are in subdirectories at the same level as the current subdirectory
# (as indicated by the PNGPATH and ZPATH macros below). Edit as appropriate. # (as indicated by the PNGPATH and ZPATH macros below). Edit as appropriate.
......
...@@ -63,9 +63,9 @@ BUILD INSTRUCTIONS ...@@ -63,9 +63,9 @@ BUILD INSTRUCTIONS
- Prerequisites (in order of compilation): - Prerequisites (in order of compilation):
- zlib http://zlib.net/ - zlib http://zlib.net/
- libpng http://www.libpng.org/pub/png/libpng.html - libpng http://www.libpng.org/pub/png/libpng.html
- pngbook http://www.libpng.org/pub/png/book/sources.html - pngbook http://www.libpng.org/pub/png/book/sources.html
The pngbook demo programs are explicitly designed to demonstrate proper The pngbook demo programs are explicitly designed to demonstrate proper
coding techniques for using the libpng reference library. As a result, coding techniques for using the libpng reference library. As a result,
...@@ -104,7 +104,7 @@ BUILD INSTRUCTIONS ...@@ -104,7 +104,7 @@ BUILD INSTRUCTIONS
unpacked the source code. unpacked the source code.
For MSVC, set up the necessary environment variables by invoking For MSVC, set up the necessary environment variables by invoking
%devstudio%\vc\bin\vcvars32.bat %devstudio%\vc\bin\vcvars32.bat
where where %devstudio% is the installation directory for MSVC / where where %devstudio% is the installation directory for MSVC /
...@@ -165,19 +165,19 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO ...@@ -165,19 +165,19 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
rpng is a simple PNG viewer that can display transparent PNGs with a rpng is a simple PNG viewer that can display transparent PNGs with a
specified background color; for example, specified background color; for example,
rpng -bgcolor \#ff0000 toucan.png rpng -bgcolor \#ff0000 toucan.png
would display the image with a red background. rpng2 is a progressive would display the image with a red background. rpng2 is a progressive
viewer that simulates a web browser in some respects; it can display viewer that simulates a web browser in some respects; it can display
images against either a background color or a dynamically generated images against either a background color or a dynamically generated
background image. For example: background image. For example:
rpng2 -bgpat 16 toucan.png rpng2 -bgpat 16 toucan.png
wpng is a purely command-line image converter from binary PBMPLUS/NetPBM wpng is a purely command-line image converter from binary PBMPLUS/NetPBM
format (.pgm or .ppm) to PNG; for example, format (.pgm or .ppm) to PNG; for example,
wpng -time < toucan-notrans.ppm > toucan-notrans.png wpng -time < toucan-notrans.ppm > toucan-notrans.png
would convert the specified PPM file (using redirection) to PNG, auto- would convert the specified PPM file (using redirection) to PNG, auto-
matically setting the PNG modification-time chunk. matically setting the PNG modification-time chunk.
......
...@@ -20,13 +20,13 @@ $ if zpath .eqs. "" ...@@ -20,13 +20,13 @@ $ if zpath .eqs. ""
$ then $ then
$ write sys$output "zlib include not found. Exiting..." $ write sys$output "zlib include not found. Exiting..."
$ exit 2 $ exit 2
$ endif $ endif
$! $!
$ if pngpath .eqs. "" $ if pngpath .eqs. ""
$ then $ then
$ write sys$output "libpng include not found. Exiting..." $ write sys$output "libpng include not found. Exiting..."
$ exit 2 $ exit 2
$ endif $ endif
$! $!
$! Look for the compiler used. $! Look for the compiler used.
$! $!
......
...@@ -229,8 +229,14 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) ...@@ -229,8 +229,14 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
png_set_expand(png_ptr); png_set_expand(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_expand(png_ptr); png_set_expand(png_ptr);
#ifdef PNG_READ_16_TO_8_SUPPORTED
if (bit_depth == 16) if (bit_depth == 16)
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
# else
png_set_strip_16(png_ptr); png_set_strip_16(png_ptr);
# endif
#endif
if (color_type == PNG_COLOR_TYPE_GRAY || if (color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA) color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png_ptr); png_set_gray_to_rgb(png_ptr);
...@@ -263,7 +269,8 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes) ...@@ -263,7 +269,8 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
return NULL; return NULL;
} }
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", *pChannels, 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 */ /* set the individual row_pointers to point at the correct offsets */
......
...@@ -55,8 +55,10 @@ ...@@ -55,8 +55,10 @@
#include <stdlib.h> /* for exit() prototype */ #include <stdlib.h> /* for exit() prototype */
#include <setjmp.h>
#include "png.h" /* libpng header; includes zlib.h and setjmp.h */ #include <zlib.h>
#include "png.h" /* libpng header from the local directory */
#include "readpng2.h" /* typedefs, common macros, public prototypes */ #include "readpng2.h" /* typedefs, common macros, public prototypes */
...@@ -216,7 +218,11 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) ...@@ -216,7 +218,11 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
mainprog_info *mainprog_ptr; mainprog_info *mainprog_ptr;
int color_type, bit_depth; int color_type, bit_depth;
png_uint_32 width, height; png_uint_32 width, height;
#ifdef PNG_FLOATING_POINT_SUPPORTED
double gamma; double gamma;
#else
png_fixed_point gamma;
#endif
/* setjmp() doesn't make sense here, because we'd either have to exit(), /* setjmp() doesn't make sense here, because we'd either have to exit(),
...@@ -305,8 +311,14 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) ...@@ -305,8 +311,14 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
png_set_expand(png_ptr); png_set_expand(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_expand(png_ptr); png_set_expand(png_ptr);
#ifdef PNG_READ_16_TO_8_SUPPORTED
if (bit_depth == 16) if (bit_depth == 16)
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
# else
png_set_strip_16(png_ptr); png_set_strip_16(png_ptr);
# endif
#endif
if (color_type == PNG_COLOR_TYPE_GRAY || if (color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA) color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png_ptr); png_set_gray_to_rgb(png_ptr);
...@@ -327,11 +339,19 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr) ...@@ -327,11 +339,19 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
* "gamma" value for the entire display system, i.e., the product of * "gamma" value for the entire display system, i.e., the product of
* LUT_exponent and CRT_exponent. */ * LUT_exponent and CRT_exponent. */
#ifdef PNG_FLOATING_POINT_SUPPORTED
if (png_get_gAMA(png_ptr, info_ptr, &gamma)) if (png_get_gAMA(png_ptr, info_ptr, &gamma))
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma); png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma);
else else
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455); png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455);
#else
if (png_get_gAMA_fixed(png_ptr, info_ptr, &gamma))
png_set_gamma_fixed(png_ptr,
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), gamma);
else
png_set_gamma_fixed(png_ptr,
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), 45455);
#endif
/* we'll let libpng expand interlaced images, too */ /* we'll let libpng expand interlaced images, too */
...@@ -480,5 +500,12 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg) ...@@ -480,5 +500,12 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg)
exit(99); exit(99);
} }
/* Now we have our data structure we can use the information in it
* to return control to our own higher level code (all the points
* where 'setjmp' is called in this file.) This will work with other
* error handling mechanisms as well - libpng always calls png_error
* when it can proceed no further, thus, so long as the error handler
* is intercepted, application code can do its own error recovery.
*/
longjmp(mainprog_ptr->jmpbuf, 1); longjmp(mainprog_ptr->jmpbuf, 1);
} }
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
#define PROGNAME "rpng-x" #define PROGNAME "rpng-x"
#define LONGNAME "Simple PNG Viewer for X" #define LONGNAME "Simple PNG Viewer for X"
#define VERSION "2.01 of 16 March 2008" #define VERSION "2.01 of 16 March 2008"
#define RESNAME "rpng" /* our X resource application name */ #define RESNAME "rpng" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */ #define RESCLASS "Rpng" /* our X resource class name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -252,8 +252,8 @@ int main(int argc, char **argv) ...@@ -252,8 +252,8 @@ int main(int argc, char **argv)
else { else {
bgstr = *argv; bgstr = *argv;
if (strlen(bgstr) != 7 || bgstr[0] != '#') if (strlen(bgstr) != 7 || bgstr[0] != '#')
++error; ++error;
else else
have_bg = TRUE; have_bg = TRUE;
} }
} else { } else {
......
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
#define PROGNAME "rpng2-x" #define PROGNAME "rpng2-x"
#define LONGNAME "Progressive PNG Viewer for X" #define LONGNAME "Progressive PNG Viewer for X"
#define VERSION "2.03 of 25 February 2010" #define VERSION "2.03 of 25 February 2010"
#define RESNAME "rpng2" /* our X resource application name */ #define RESNAME "rpng2" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */ #define RESCLASS "Rpng" /* our X resource class name */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
(e.type == KeyPress && /* v--- or 1 for shifted keys */ \ (e.type == KeyPress && /* v--- or 1 for shifted keys */ \
((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape))) ((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape)))
#define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */ #define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */
#define rgb1_max bg_freq #define rgb1_max bg_freq
#define rgb1_min bg_gray #define rgb1_min bg_gray
...@@ -302,7 +302,7 @@ int main(int argc, char **argv) ...@@ -302,7 +302,7 @@ int main(int argc, char **argv)
int have_bg = FALSE; int have_bg = FALSE;
#ifdef FEATURE_LOOP #ifdef FEATURE_LOOP
int loop = FALSE; int loop = FALSE;
long loop_interval = -1; /* seconds (100,000 max) */ long loop_interval = -1; /* seconds (100,000 max) */
#endif #endif
double LUT_exponent; /* just the lookup table */ double LUT_exponent; /* just the lookup table */
double CRT_exponent = 2.2; /* just the monitor */ double CRT_exponent = 2.2; /* just the monitor */
...@@ -485,9 +485,6 @@ int main(int argc, char **argv) ...@@ -485,9 +485,6 @@ int main(int argc, char **argv)
"\nPress Q, Esc or mouse button 1 (within image window, after image\n" "\nPress Q, Esc or mouse button 1 (within image window, after image\n"
"is displayed) to quit.\n" "is displayed) to quit.\n"
"\n", PROGNAME, "\n", PROGNAME,
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
(int)strlen(PROGNAME), " ",
#endif
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1); (int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1);
exit(1); exit(1);
} }
...@@ -784,8 +781,9 @@ static void rpng2_x_init(void) ...@@ -784,8 +781,9 @@ static void rpng2_x_init(void)
if (rpng2_x_create_window()) { if (rpng2_x_create_window()) {
/* GRR TEMPORARY HACK: this is fundamentally no different from cases /* GRR TEMPORARY HACK: this is fundamentally no different from cases
* above; libpng should longjmp() back to us when png_ptr goes away. * above; libpng should call our error handler to longjmp() back to us
* If we/it segfault instead, seems like a libpng bug... */ * 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 */ /* we're here via libpng callback, so if window fails, clean and bail */
readpng2_cleanup(&rpng2_info); readpng2_cleanup(&rpng2_info);
...@@ -1279,7 +1277,7 @@ static int rpng2_x_load_bg_image(void) ...@@ -1279,7 +1277,7 @@ static int rpng2_x_load_bg_image(void)
for (row = 0; row < rpng2_info.height; ++row) { for (row = 0; row < rpng2_info.height; ++row) {
src = bg_data + row*bg_rowbytes; src = bg_data + row*bg_rowbytes;
dest = ximage->data + row*ximage_rowbytes; dest = ximage->data + row*ximage_rowbytes;
if (bpp == 32) { /* slightly optimized version */ if (bpp == 32) { /* slightly optimized version */
for (i = rpng2_info.width; i > 0; --i) { for (i = rpng2_info.width; i > 0; --i) {
red = *src++; red = *src++;
green = *src++; green = *src++;
......
...@@ -104,7 +104,8 @@ int writepng_init(mainprog_info *mainprog_ptr) ...@@ -104,7 +104,8 @@ int writepng_init(mainprog_info *mainprog_ptr)
/* setjmp() must be called in every function that calls a PNG-writing /* setjmp() must be called in every function that calls a PNG-writing
* libpng function, unless an alternate error handler was installed-- * libpng function, unless an alternate error handler was installed--
* but compatible error handlers must either use longjmp() themselves * but compatible error handlers must either use longjmp() themselves
* (as in this program) or exit immediately, so here we go: */ * (as in this program) or some other method to return control to
* application code, so here we go: */
if (setjmp(mainprog_ptr->jmpbuf)) { if (setjmp(mainprog_ptr->jmpbuf)) {
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
...@@ -388,5 +389,12 @@ static void writepng_error_handler(png_structp png_ptr, png_const_charp msg) ...@@ -388,5 +389,12 @@ static void writepng_error_handler(png_structp png_ptr, png_const_charp msg)
exit(99); exit(99);
} }
/* Now we have our data structure we can use the information in it
* to return control to our own higher level code (all the points
* where 'setjmp' is called in this file.) This will work with other
* error handling mechanisms as well - libpng always calls png_error
* when it can proceed no further, thus, so long as the error handler
* is intercepted, application code can do its own error recovery.
*/
longjmp(mainprog_ptr->jmpbuf, 1); longjmp(mainprog_ptr->jmpbuf, 1);
} }
This demonstrates the use of PNG_USER_CONFIG and pngusr.h This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa
To build a minimal read-only decoder with embedded libpng and zlib, run The makefile builds a minimal read-only decoder with embedded libpng
and zlib.
gather.sh # to collect needed files from pngminus, libpng, and zlib Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
make on the make command line.
If you prefer to use the shared libraries, go to contrib/pngminus If you prefer to use the shared libraries, go to contrib/pngminus
and build the png2pnm application there. and build the png2pnm application there.
...@@ -5,27 +5,82 @@ ...@@ -5,27 +5,82 @@
CC=gcc CC=gcc
LD=$(CC) LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f RM=rm -f
COPY=cp
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. -O1
-DdeflateParams\(a,b,c\)=Z_OK -I. -O1
C=.c C=.c
O=.o O=.o
L=.a L=.a
E= E=
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/pngminus
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS = adler32$(C) crc32$(C) \
inffast$(C) inflate$(C) inftrees$(C) \
zutil$(C)
# Standard headers
ZH = zlib.h crc32.h inffast.h inffixed.h \
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
ZOBJS = adler32$(O) crc32$(O) \ ZOBJS = adler32$(O) crc32$(O) \
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ inffast$(O) inflate$(O) inftrees$(O) \
trees$(O) uncompr$(O) zutil$(O) zutil$(O)
# libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ # Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
pngset$(O) pngtrans$(O) $(ZOBJS) pngset$(O) pngtrans$(O)
PROGSRCS= pngm2pnm$(C)
PROGHDRS=
PROGDOCS=
PROGOBJS= pngm2pnm$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules ------------------------------------------------------- # implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h # note: dependencies do not work on implicit rule lines
.c$(O):
$(CC) -c $(CFLAGS) $< $(CC) -c $(CFLAGS) $<
# dependencies # dependencies
...@@ -34,11 +89,62 @@ all: pngm2pnm$(E) ...@@ -34,11 +89,62 @@ all: pngm2pnm$(E)
pngm2pnm$(E): $(OBJS) pngm2pnm$(E): $(OBJS)
$(LD) -o pngm2pnm$(E) $(OBJS) $(LD) -o pngm2pnm$(E) $(OBJS)
strip pngm2pnm$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean: clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) pngm2pnm$(O) $(RM) pngm2pnm$(O)
$(RM) pngm2pnm$(E) $(RM) pngm2pnm$(E)
$(RM) $(OBJS) $(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
pngm2pnm.c: $(PROGSRC)/png2pnm.c
$(RM) $@
$(COPY) $(PROGSRC)/png2pnm.c $@
# End of makefile for pngm2pnm # End of makefile for pngm2pnm
/* minrdpngconf.h: headers to make a minimal png-read-only library /* minrdpngconf.h: headers to make a minimal png-read-only library
* *
* Copyright (c) 2007, 2009 Glenn Randers-Pehrson * Copyright (c) 2007, 2010-2011 Glenn Randers-Pehrson
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * For conditions of distribution and use, see the disclaimer
...@@ -12,64 +12,12 @@ ...@@ -12,64 +12,12 @@
#ifndef MINRDPNGCONF_H #ifndef MINRDPNGCONF_H
#define MINRDPNGCONF_H #define MINRDPNGCONF_H
#define PNG_NO_WARNINGS /* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
#define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) ""
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_READ_BGR
#define PNG_NO_READ_GAMMA
#define PNG_NO_READ_BACKGROUND
#define PNG_NO_READ_QUANTIZE
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_bKGD
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_gAMA
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_sRGB
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED /* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_INFO_IMAGE #define PNG_NO_WARNINGS
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_PROGRESSIVE_READ
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1123
#endif /* MINRDPNGCONF_H */ #endif /* MINRDPNGCONF_H */
This demonstrates the use of PNG_USER_CONFIG and pngusr.h This demonstrates the use of PNG_USER_CONFIG and pngusr.h
To build a minimal write-only decoder with embedded libpng and zlib, run The makefile builds a minimal write-only decoder with embedded libpng
and zlib.
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
gather.sh # to collect needed files from pngminus, libpng, and zlib
make
If you prefer to use the shared libraries, go to contrib/pngminus If you prefer to use the shared libraries, go to contrib/pngminus
and build the pnm2png application there. and build the pnm2png application there.
...@@ -5,7 +5,14 @@ ...@@ -5,7 +5,14 @@
CC=gcc CC=gcc
LD=$(CC) LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f RM=rm -f
COPY=cp
CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1
...@@ -14,16 +21,65 @@ O=.o ...@@ -14,16 +21,65 @@ O=.o
L=.a L=.a
E= E=
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/pngminus
# Zlib
ZSRCS = adler32$(C) compress$(C) crc32$(C) deflate$(C) \
trees$(C) zutil$(C)
# Standard headers
#ZH = zlib.h crc32.h deflate.h trees.h zutil.h
ZH = zlib.h crc32.h deflate.h trees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
# compress is not required; it is needed to link the zlib
# code because deflate defines an unused API function deflateBound
# which itself calls compressBound from compress.
ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) \ ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) \
trees$(O) zutil$(O) trees$(O) zutil$(O)
OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ # libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngset$(C) pngtrans$(C) pngwio$(C) pngwrite$(C) \
pngwtran$(C) pngwutil$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
# Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \ pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \
pngwtran$(O) pngwutil$(O) $(ZOBJS) pngwtran$(O) pngwutil$(O)
PROGSRCS= pnm2pngm$(C)
PROGHDRS=
PROGDOCS=
PROGOBJS= pnm2pngm$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules ------------------------------------------------------- # implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h .c$(O):
$(CC) -c $(CFLAGS) $< $(CC) -c $(CFLAGS) $<
# dependencies # dependencies
...@@ -32,11 +88,62 @@ all: pnm2pngm$(E) ...@@ -32,11 +88,62 @@ all: pnm2pngm$(E)
pnm2pngm$(E): $(OBJS) pnm2pngm$(E): $(OBJS)
$(LD) -o pnm2pngm$(E) $(OBJS) $(LD) -o pnm2pngm$(E) $(OBJS)
strip pnm2pngm$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean: clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) pnm2pngm$(O) $(RM) pnm2pngm$(O)
$(RM) pnm2pngm$(E) $(RM) pnm2pngm$(E)
$(RM) $(OBJS) $(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
pnm2pngm.c: $(PROGSRC)/pnm2png.c
$(RM) $@
$(COPY) $(PROGSRC)/pnm2png.c $@
# End of makefile for pnm2pngm # End of makefile for pnm2pngm
/* minwrpngconf.h: headers to make a minimal png-write-only library /* minwrpngconf.h: headers to make a minimal png-write-only library
* *
* Copyright (c) 2007, 2009 Glenn Randers-Pehrson * Copyright (c) 2007, 2010-2011 Glenn Randers-Pehrson
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * For conditions of distribution and use, see the disclaimer
...@@ -12,65 +12,12 @@ ...@@ -12,65 +12,12 @@
#ifndef MINWRPNGCONF_H #ifndef MINWRPNGCONF_H
#define MINWRPNGCONF_H #define MINWRPNGCONF_H
#define PNG_NO_READ_SUPPORTED /* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
#define PNG_NO_WARNINGS /* List options to turn off features of the build that do not
#define png_warning(s1,s2) "" * affect the API (so are not recorded in pnglibconf.h)
#define png_chunk_warning(s1,s2) "" */
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_WRITE_BACKGROUND
#define PNG_NO_WRITE_BGR
#define PNG_NO_WRITE_GAMMA
#define PNG_NO_WRITE_QUANTIZE
#define PNG_NO_WRITE_INVERT
#define PNG_NO_WRITE_SHIFT
#define PNG_NO_WRITE_PACK
#define PNG_NO_WRITE_PACKSWAP
#define PNG_NO_WRITE_FILLER
#define PNG_NO_WRITE_SWAP
#define PNG_NO_WRITE_SWAP_ALPHA
#define PNG_NO_WRITE_INVERT_ALPHA
#define PNG_NO_WRITE_RGB_TO_GRAY
#define PNG_NO_WRITE_USER_TRANSFORM
#define PNG_NO_WRITE_bKGD
#define PNG_NO_WRITE_cHRM
#define PNG_NO_WRITE_gAMA
#define PNG_NO_WRITE_hIST
#define PNG_NO_WRITE_iCCP
#define PNG_NO_WRITE_oFFs
#define PNG_NO_WRITE_pCAL
#define PNG_NO_WRITE_pHYs
#define PNG_NO_WRITE_sBIT
#define PNG_NO_WRITE_sCAL
#define PNG_NO_WRITE_sPLT
#define PNG_NO_WRITE_sRGB
#define PNG_NO_WRITE_TEXT
#define PNG_NO_WRITE_tIME
#define PNG_NO_WRITE_UNKNOWN_CHUNKS
#define PNG_NO_WRITE_USER_CHUNKS
#define PNG_NO_WRITE_EMPTY_PLTE
#define PNG_NO_WRITE_OPT_PLTE
#define PNG_NO_WRITE_FILTER
#define PNG_NO_WRITE_WEIGHTED_FILTER
#define PNG_NO_WRITE_INTERLACING_SUPPORTED
#define PNG_NO_WRITE_FLUSH
#define PNG_NO_INFO_IMAGE #define PNG_NO_WARNINGS
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1143
#endif /* MINWRPNGCONF_H */ #endif /* MINWRPNGCONF_H */
This demonstrates the use of PNG_USER_CONFIG and pngusr.h This demonstrates the use of PNG_USER_CONFIG and pngusr.h
To build a minimal read-only progressive decoder embedded libpng and The makefile builds a minimal read-only progressive decoder with
zlib and with your system's X library, run embedded libpng, zlib and your system's X library.
gather.sh # to collect needed files from gregbook, libpng, and zlib Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
Edit makefile if required, to find your X library and include files, Edit makefile if required, to find your X library and include files,
then then
make make ZLIBSRC=directory
If you prefer to use the shared libraries, go to contrib/gregbook If you prefer to use the shared libraries, go to contrib/gregbook
and build the rpng2-x application there. and build the rpng2-x application there.
...@@ -5,7 +5,14 @@ ...@@ -5,7 +5,14 @@
CC=gcc CC=gcc
LD=$(CC) LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f RM=rm -f
COPY=cp
#XINC = -I/usr/include # old-style, stock X distributions #XINC = -I/usr/include # old-style, stock X distributions
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX) #XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
...@@ -23,38 +30,136 @@ XLIB = -L/usr/X11R6/lib -lX11 ...@@ -23,38 +30,136 @@ XLIB = -L/usr/X11R6/lib -lX11
#LIBS = $(XLIB) #LIBS = $(XLIB)
LIBS = $(XLIB) -lm #platforms that need libm LIBS = $(XLIB) -lm #platforms that need libm
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. $(XINC) -O1
-DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1
C=.c C=.c
O=.o O=.o
L=.a L=.a
E= E=
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/gregbook
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS = adler32$(C) crc32$(C) \
inffast$(C) inflate$(C) inftrees$(C) \
zutil$(C)
# Standard headers
ZH = zlib.h crc32.h inffast.h inffixed.h \
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
ZOBJS = adler32$(O) crc32$(O) \ ZOBJS = adler32$(O) crc32$(O) \
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ inffast$(O) inflate$(O) inftrees$(O) \
trees$(O) uncompr$(O) zutil$(O) zutil$(O)
# libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngpread$(C) pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ # Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
# Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
pngset$(O) pngtrans$(O) $(ZOBJS) pngset$(O) pngtrans$(O)
PROGSRCS= rpng2-x$(C) readpng2$(C)
PROGHDRS= readpng2.h
PROGDOCS= COPYING LICENSE
PROGOBJS= rpng2-x$(O) readpng2$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules ------------------------------------------------------- # implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h .c$(O):
$(CC) -c $(CFLAGS) $< $(CC) -c $(CFLAGS) $<
# dependencies # dependencies
all: rpng2-x$(E) all: $(PROGDOCS) rpng2-x$(E)
rpng2-x$(E): $(OBJS) rpng2-x$(E): $(OBJS)
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS) $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
strip rpng2-x$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean: clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) rpng2-x$(O) $(RM) rpng2-x$(O)
$(RM) rpng2-x$(E) $(RM) rpng2-x$(E)
$(RM) $(OBJS) $(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
$(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@
$(RM) $@
$(COPY) $(PROGSRC)/$@ $@
# End of makefile for rpng2-x # End of makefile for rpng2-x
/* minrdpngconf.h: headers to make a minimal png-read-only library /* minrdpngconf.h: headers to make a minimal png-read-only library
* *
* Copyright (c) 2009 Glenn Randers-Pehrson * Copyright (c) 2009, 2010-2011 Glenn Randers-Pehrson
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * For conditions of distribution and use, see the disclaimer
...@@ -12,57 +12,12 @@ ...@@ -12,57 +12,12 @@
#ifndef MINPRDPNGCONF_H #ifndef MINPRDPNGCONF_H
#define MINPRDPNGCONF_H #define MINPRDPNGCONF_H
#define PNG_NO_WARNINGS /* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
#define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) ""
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_READ_BGR
#define PNG_NO_READ_DITHER
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED /* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_INFO_IMAGE #define PNG_NO_WARNINGS
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1143
#endif /* MINPRDPNGCONF_H */ #endif /* MINPRDPNGCONF_H */
...@@ -8,9 +8,9 @@ LD=$(CC) ...@@ -8,9 +8,9 @@ LD=$(CC)
RM=rm -f RM=rm -f
#PNGPATH = /usr/local #PNGPATH = /usr/local
#PNGINC = -I$(PNGPATH)/include/libpng12 #PNGINC = -I$(PNGPATH)/include/libpng15
#PNGLIB = -L$(PNGPATH)/lib -lpng12 #PNGLIB = -L$(PNGPATH)/lib -lpng15
#PNGLIBS = $(PNGPATH)/lib/libpng12.a #PNGLIBS = $(PNGPATH)/lib/libpng15.a
PNGINC = -I../.. PNGINC = -I../..
PNGLIB = -L../.. -lpng PNGLIB = -L../.. -lpng
PNGLIBS = ../../libpng.a PNGLIBS = ../../libpng.a
...@@ -23,9 +23,9 @@ ZINC = -I../../../zlib ...@@ -23,9 +23,9 @@ ZINC = -I../../../zlib
ZLIB = -L../../../zlib -lz ZLIB = -L../../../zlib -lz
ZLIBS = ../../../zlib/libz.a ZLIBS = ../../../zlib/libz.a
CFLAGS=-O3 $(PNGINC) $(ZINC) CFLAGS=$(PNGINC) $(ZINC)
LDFLAGS=$(PNGLIB) $(ZLIB) LDLIBS=$(PNGLIB) $(ZLIB)
LDFLAGSS=$(PNGLIBS) $(ZLIBS) LDLIBSS=$(PNGLIBS) $(ZLIBS)
C=.c C=.c
O=.o O=.o
L=.a L=.a
...@@ -40,19 +40,19 @@ png2pnm$(O): png2pnm$(C) ...@@ -40,19 +40,19 @@ png2pnm$(O): png2pnm$(C)
$(CC) -c $(CFLAGS) png2pnm$(C) $(CC) -c $(CFLAGS) png2pnm$(C)
png2pnm$(E): png2pnm$(O) png2pnm$(E): png2pnm$(O)
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm $(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm
png2pnm-static$(E): png2pnm$(O) png2pnm-static$(E): png2pnm$(O)
$(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm $(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm
pnm2png$(O): pnm2png$(C) pnm2png$(O): pnm2png$(C)
$(CC) -c $(CFLAGS) pnm2png$(C) $(CC) -c $(CFLAGS) pnm2png$(C)
pnm2png$(E): pnm2png$(O) pnm2png$(E): pnm2png$(O)
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm $(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm
pnm2png-static$(E): pnm2png$(O) pnm2png-static$(E): pnm2png$(O)
$(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm $(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm
clean: clean:
$(RM) png2pnm$(O) $(RM) png2pnm$(O)
......
...@@ -144,7 +144,7 @@ int main(int argc, char *argv[]) ...@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
if (png2pnm (fp_rd, fp_wr, fp_al, raw, alpha) == FALSE) if (png2pnm (fp_rd, fp_wr, fp_al, raw, alpha) == FALSE)
{ {
fprintf (stderr, "PNG2PNM\n"); fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, "Error: unsuccessful convertion of PNG-image\n"); fprintf (stderr, "Error: unsuccessful conversion of PNG-image\n");
exit(1); exit(1);
} }
...@@ -188,7 +188,7 @@ void usage() ...@@ -188,7 +188,7 @@ void usage()
BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha) BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha)
{ {
png_struct *png_ptr = NULL; png_struct *png_ptr = NULL;
png_info *info_ptr = NULL; png_info *info_ptr = NULL;
png_byte buf[8]; png_byte buf[8];
png_byte *png_pixels = NULL; png_byte *png_pixels = NULL;
png_byte **row_pointers = NULL; png_byte **row_pointers = NULL;
...@@ -381,7 +381,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a ...@@ -381,7 +381,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
fputc ((int) *pix_ptr++ , pnm_file); fputc ((int) *pix_ptr++ , pnm_file);
else else
if (bit_depth == 16){ if (bit_depth == 16){
dep_16 = (long) *pix_ptr++; dep_16 = (long) *pix_ptr++;
fprintf (pnm_file, "%ld ", (dep_16 << 8) + ((long) *pix_ptr++)); fprintf (pnm_file, "%ld ", (dep_16 << 8) + ((long) *pix_ptr++));
} }
else else
...@@ -401,9 +401,9 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a ...@@ -401,9 +401,9 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
fputc ((int) *pix_ptr++ , alpha_file); fputc ((int) *pix_ptr++ , alpha_file);
else else
if (bit_depth == 16){ if (bit_depth == 16){
dep_16 = (long) *pix_ptr++; dep_16 = (long) *pix_ptr++;
fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++); fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
} }
else else
fprintf (alpha_file, "%ld ", (long) *pix_ptr++); fprintf (alpha_file, "%ld ", (long) *pix_ptr++);
} }
......
//------------------------------------------ /*------------------------------------------*/
// PNGFILE.H -- Header File for pngfile.c /* PNGFILE.H -- Header File for pngfile.c*/
//------------------------------------------ /*------------------------------------------*/
// Copyright 2000, Willem van Schaik. /* Copyright 2000, Willem van Schaik.*/
// This code is released under the libpng license. /* This code is released under the libpng license.*/
// For conditions of distribution and use, see the disclaimer /* For conditions of distribution and use, see the disclaimer*/
// and license in png.h /* and license in png.h*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -8,8 +8,8 @@ For conditions of distribution and use, see the disclaimer ...@@ -8,8 +8,8 @@ For conditions of distribution and use, see the disclaimer
and license in png.h and license in png.h
As a PNG .dll demo VisualPng is finished. More features would only hinder As a PNG .dll demo VisualPng is finished. More features would only hinder
the program's objective. However, further extensions (like support for other the program's objective. However, further extensions (like support for other
graphics formats) are in development. To get these, or for pre-compiled graphics formats) are in development. To get these, or for pre-compiled
binaries, go to "http://www.schaik.com/png/visualpng.html". binaries, go to "http://www.schaik.com/png/visualpng.html".
------------------------------------------------------------------------ ------------------------------------------------------------------------
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define IDM_HELP_ABOUT 40008 #define IDM_HELP_ABOUT 40008
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 113 #define _APS_NEXT_RESOURCE_VALUE 113
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
#if 0 /* in case someone actually tries to compile this */ #if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng /* example.c - an example of using libpng
* Last changed in libpng 1.4.2 [May 6, 2010] * Last changed in libpng 1.5.4 [July 7, 2011]
* This file has been placed in the public domain by the authors. * This file has been placed in the public domain by the authors.
* Maintained 1998-2010 Glenn Randers-Pehrson * Maintained 1998-2011 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger) * Maintained 1996, 1997 Andreas Dilger)
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/ */
/* This is an example of how to use libpng to read and write PNG files. /* This is an example of how to use libpng to read and write PNG files.
* The file libpng.txt is much more verbose then this. If you have not * The file libpng-manual.txt is much more verbose then this. If you have not
* read it, do so first. This was designed to be a starting point of an * read it, do so first. This was designed to be a starting point of an
* implementation. This is not officially part of libpng, is hereby placed * implementation. This is not officially part of libpng, is hereby placed
* in the public domain, and therefore does not require a copyright notice. * in the public domain, and therefore does not require a copyright notice.
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
* see also the programs in the contrib directory. * see also the programs in the contrib directory.
*/ */
#define _POSIX_SOURCE 1 /* libpng and zlib are POSIX-compliant. You may
* change this if your application uses non-POSIX
* extensions. */
#include "png.h" #include "png.h"
/* The png_jmpbuf() macro, used in error handling, became available in /* The png_jmpbuf() macro, used in error handling, became available in
...@@ -31,7 +35,7 @@ ...@@ -31,7 +35,7 @@
*/ */
#ifndef png_jmpbuf #ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) # define png_jmpbuf(png_ptr) ((png_ptr)->png_jmpbuf)
#endif #endif
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp() /* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
...@@ -183,8 +187,15 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ ...@@ -183,8 +187,15 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
* are mutually exclusive. * are mutually exclusive.
*/ */
/* Tell libpng to strip 16 bit/color files down to 8 bits/color */ /* Tell libpng to strip 16 bit/color files down to 8 bits/color.
* Use accurate scaling if it's available, otherwise just chop off the
* low byte.
*/
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
#else
png_set_strip_16(png_ptr); png_set_strip_16(png_ptr);
#endif
/* Strip alpha bytes from the input data without combining with the /* Strip alpha bytes from the input data without combining with the
* background (not recommended). * background (not recommended).
...@@ -286,7 +297,6 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ ...@@ -286,7 +297,6 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* An array of colors to which the image should be quantized */ /* An array of colors to which the image should be quantized */
png_color std_color_cube[MAX_SCREEN_COLORS]; png_color std_color_cube[MAX_SCREEN_COLORS];
/* Prior to libpng-1.4.2, this was png_set_dither(). */
png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS, png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
MAX_SCREEN_COLORS, NULL, 0); MAX_SCREEN_COLORS, NULL, 0);
} }
...@@ -656,14 +666,18 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -656,14 +666,18 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Optional significant bit (sBIT) chunk */ /* Optional significant bit (sBIT) chunk */
png_color_8 sig_bit; png_color_8 sig_bit;
/* If we are dealing with a grayscale image then */ /* If we are dealing with a grayscale image then */
sig_bit.gray = true_bit_depth; sig_bit.gray = true_bit_depth;
/* Otherwise, if we are dealing with a color image then */ /* Otherwise, if we are dealing with a color image then */
sig_bit.red = true_red_bit_depth; sig_bit.red = true_red_bit_depth;
sig_bit.green = true_green_bit_depth; sig_bit.green = true_green_bit_depth;
sig_bit.blue = true_blue_bit_depth; sig_bit.blue = true_blue_bit_depth;
/* If the image has an alpha channel then */ /* If the image has an alpha channel then */
sig_bit.alpha = true_alpha_bit_depth; sig_bit.alpha = true_alpha_bit_depth;
png_set_sBIT(png_ptr, info_ptr, &sig_bit); png_set_sBIT(png_ptr, info_ptr, &sig_bit);
...@@ -676,20 +690,21 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -676,20 +690,21 @@ void write_png(char *file_name /* , ... other image information ... */)
text_ptr[0].key = "Title"; text_ptr[0].key = "Title";
text_ptr[0].text = "Mona Lisa"; text_ptr[0].text = "Mona Lisa";
text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
text_ptr[0].itxt_length = 0;
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
text_ptr[1].key = "Author"; text_ptr[1].key = "Author";
text_ptr[1].text = "Leonardo DaVinci"; text_ptr[1].text = "Leonardo DaVinci";
text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE;
text_ptr[1].itxt_length = 0;
text_ptr[1].lang = NULL;
text_ptr[1].lang_key = NULL;
text_ptr[2].key = "Description"; text_ptr[2].key = "Description";
text_ptr[2].text = "<long text>"; text_ptr[2].text = "<long text>";
text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt;
#ifdef PNG_iTXt_SUPPORTED text_ptr[2].itxt_length = 0;
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
text_ptr[1].lang = NULL;
text_ptr[1].lang_key = NULL;
text_ptr[2].lang = NULL; text_ptr[2].lang = NULL;
text_ptr[2].lang_key = NULL; text_ptr[2].lang_key = NULL;
#endif
png_set_text(png_ptr, info_ptr, text_ptr, 3); png_set_text(png_ptr, info_ptr, text_ptr, 3);
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */ /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */
...@@ -754,6 +769,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -754,6 +769,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Turn on interlace handling if you are not using png_write_image() */ /* Turn on interlace handling if you are not using png_write_image() */
if (interlacing) if (interlacing)
number_passes = png_set_interlace_handling(png_ptr); number_passes = png_set_interlace_handling(png_ptr);
else else
number_passes = 1; number_passes = 1;
......
...@@ -104,8 +104,8 @@ while test $# -gt 0; do ...@@ -104,8 +104,8 @@ while test $# -gt 0; do
;; ;;
--ldopts) --ldopts)
echo ${ldopts} echo ${ldopts}
;; ;;
--ldflags) --ldflags)
echo ${ldopts} ${L_opts} ${R_opts} ${libs} echo ${ldopts} ${L_opts} ${R_opts} ${libs}
...@@ -113,7 +113,7 @@ while test $# -gt 0; do ...@@ -113,7 +113,7 @@ while test $# -gt 0; do
--static) --static)
R_opts="" R_opts=""
libs=${all_libs} libs=${all_libs}
;; ;;
*) *)
......
This diff is collapsed.
This diff is collapsed.
.TH PNG 5 "September 23, 2010" .TH PNG 5 "September 22, 2011"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
*
* Copyright (c) 1998-2011 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.)
*
* Last changed in libpng 1.5.0 [January 6, 2011]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
* libpng yet, but more support will be added as needed.
*
* png_debug[1-2]?(level, message ,arg{0-2})
* Expands to a statement (either a simple expression or a compound
* do..while(0) statement) that outputs a message with parameter
* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG
* is undefined, 0 or 1 every png_debug expands to a simple expression
* (actually ((void)0)).
*
* level: level of detail of message, starting at 0. A level 'n'
* message is preceded by 'n' tab characters (not implemented
* on Microsoft compilers unless PNG_DEBUG_FILE is also
* defined, to allow debug DLL compilation with no standard IO).
* message: a printf(3) style text string. A trailing '\n' is added
* to the message.
* arg: 0 to 2 arguments for printf(3) style substitution in message.
*/
#ifndef PNGDEBUG_H
#define PNGDEBUG_H
/* These settings control the formatting of messages in png.c and pngerror.c */
/* Moved to pngdebug.h at 1.5.0 */
# ifndef PNG_LITERAL_SHARP
# define PNG_LITERAL_SHARP 0x23
# endif
# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET
# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b
# endif
# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET
# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d
# endif
# ifndef PNG_STRING_NEWLINE
# define PNG_STRING_NEWLINE "\n"
# endif
#ifdef PNG_DEBUG
# if (PNG_DEBUG > 0)
# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
# include <crtdbg.h>
# if (PNG_DEBUG > 1)
# ifndef _DEBUG
# define _DEBUG
# endif
# ifndef png_debug
# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
# endif
# endif
# else /* PNG_DEBUG_FILE || !_MSC_VER */
# ifndef PNG_STDIO_SUPPORTED
# include <stdio.h> /* not included yet */
# endif
# ifndef PNG_DEBUG_FILE
# define PNG_DEBUG_FILE stderr
# endif /* PNG_DEBUG_FILE */
# if (PNG_DEBUG > 1)
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers
*/
# ifdef __STDC__
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
} while (0)
# endif
# else /* __STDC __ */
# ifndef png_debug
# define png_debug(l,m) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format); \
} while (0)
# endif
# ifndef png_debug1
# define png_debug1(l,m,p1) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1); \
} while (0)
# endif
# ifndef png_debug2
# define png_debug2(l,m,p1,p2) \
do { \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1,p2); \
} while (0)
# endif
# endif /* __STDC __ */
# endif /* (PNG_DEBUG > 1) */
# endif /* _MSC_VER */
# endif /* (PNG_DEBUG > 0) */
#endif /* PNG_DEBUG */
#ifndef png_debug
# define png_debug(l, m) ((void)0)
#endif
#ifndef png_debug1
# define png_debug1(l, m, p1) ((void)0)
#endif
#ifndef png_debug2
# define png_debug2(l, m, p1, p2) ((void)0)
#endif
#endif /* PNGDEBUG_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
source/Irrlicht/libpng/pngtest.png

8.41 KB | W: | H:

source/Irrlicht/libpng/pngtest.png

8.49 KB | W: | H:

source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -37,9 +37,9 @@ To use: ...@@ -37,9 +37,9 @@ To use:
This project builds the libpng binaries as follows: This project builds the libpng binaries as follows:
* Win32_DLL_Release\libpng14.dll DLL build * Win32_DLL_Release\libpng15.dll DLL build
* Win32_DLL_Debug\libpng14d.dll DLL build (debug version) * Win32_DLL_Debug\libpng15d.dll DLL build (debug version)
* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall * Win32_DLL_VB\libpng15vb.dll DLL build for Visual Basic, using stdcall
* Win32_LIB_Release\libpng.lib static build * Win32_LIB_Release\libpng.lib static build
* Win32_LIB_Debug\libpngd.lib static build (debug version) * Win32_LIB_Debug\libpngd.lib static build (debug version)
......
...@@ -130,7 +130,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png" ...@@ -130,7 +130,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
Name="VCLinkerTool" Name="VCLinkerTool"
OutputFile="$(OutDir)/pngtest.exe" OutputFile="$(OutDir)/pngtest.exe"
LinkIncremental="1" LinkIncremental="1"
IgnoreDefaultLibraryNames="$(IntDir)\libpng14b.lib" IgnoreDefaultLibraryNames="$(IntDir)\libpng15b.lib"
SubSystem="1" SubSystem="1"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
......
This diff is collapsed.
This diff is collapsed.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# Modeled after libxml-config. # Modeled after libxml-config.
version=1.4.4 version=1.5.5
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment