mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Imported from libpng-1.6.3beta06.tar
This commit is contained in:
parent
61dbc4c608
commit
afd6cecb76
13
ANNOUNCE
13
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.6.3beta06 - May 10, 2013
|
Libpng 1.6.3beta06 - May 12, 2013
|
||||||
|
|
||||||
This is not intended to be a public release. It will be replaced
|
This is not intended to be a public release. It will be replaced
|
||||||
within a few weeks by a public version or by another test version.
|
within a few weeks by a public version or by another test version.
|
||||||
@ -69,12 +69,13 @@ Version 1.6.3beta05 [May 9, 2013]
|
|||||||
Added information in the documentation about problems with and fixes for
|
Added information in the documentation about problems with and fixes for
|
||||||
the bad CRC and bad iTXt chunk situations.
|
the bad CRC and bad iTXt chunk situations.
|
||||||
|
|
||||||
Version 1.6.3beta06 [May 10, 2013]
|
Version 1.6.3beta06 [May 12, 2013]
|
||||||
Allow contrib/pnminus/pnm2png.c to compile without WRITE_INVERT and WRITE_PACK
|
Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and
|
||||||
supported (writes error message that it can't read P1 or P4 PBM files).
|
WRITE_PACK supported (writes error message that it can't read P1 or
|
||||||
Improved png-fix-too-far-back usage message, added --suffix option.
|
Improved png-fix-too-far-back usage message, added --suffix option.
|
||||||
Revised contrib/pngminim/*/makefile to generated pnglibconf.h with the
|
Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the
|
||||||
right ZLIB_VERNUM.
|
right zlib header files.
|
||||||
|
Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
12
CHANGES
12
CHANGES
@ -4552,12 +4552,14 @@ Version 1.6.3beta05 [May 9, 2013]
|
|||||||
Added information in the documentation about problems with and fixes for
|
Added information in the documentation about problems with and fixes for
|
||||||
the bad CRC and bad iTXt chunk situations.
|
the bad CRC and bad iTXt chunk situations.
|
||||||
|
|
||||||
Version 1.6.3beta06 [May 10, 2013]
|
Version 1.6.3beta06 [May 12, 2013]
|
||||||
Allow contrib/pnminus/pnm2png.c to compile without WRITE_INVERT and WRITE_PACK
|
Allow contrib/pngminus/pnm2png.c to compile without WRITE_INVERT and
|
||||||
supported (writes error message that it can't read P1 or P4 PBM files).
|
WRITE_PACK supported (writes error message that it can't read P1 or
|
||||||
|
P4 PBM files).
|
||||||
Improved png-fix-too-far-back usage message, added --suffix option.
|
Improved png-fix-too-far-back usage message, added --suffix option.
|
||||||
Revised contrib/pngminim/*/makefile to generated pnglibconf.h with the
|
Revised contrib/pngminim/*/makefile to generate pnglibconf.h with the
|
||||||
right ZLIB_VERNUM.
|
right zlib header files.
|
||||||
|
Separated CPPFLAGS and CFLAGS in contrib/pngminim/*/makefile
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
4
LICENSE
4
LICENSE
@ -10,7 +10,7 @@ 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.6.3beta06, May 9, 2013, are
|
libpng versions 1.2.6, August 15, 2004, through 1.6.3beta06, May 12, 2013, are
|
||||||
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
|
Copyright (c) 2004, 2006-2012 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.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
May 9, 2013
|
May 12, 2013
|
||||||
|
|||||||
2
README
2
README
@ -1,4 +1,4 @@
|
|||||||
README for libpng version 1.6.3beta06 - May 9, 2013 (shared library 16.0)
|
README for libpng version 1.6.3beta06 - May 12, 2013 (shared library 16.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.
|
||||||
|
|||||||
@ -13,8 +13,9 @@ everything = off
|
|||||||
# Switch on the write code - this makes a minimalist encoder
|
# Switch on the write code - this makes a minimalist encoder
|
||||||
|
|
||||||
option WRITE on
|
option WRITE on
|
||||||
option WRITE_INVERT on
|
# These 2 options are required if you need to read PGM (P1 or P4) PGM files.
|
||||||
option WRITE_PACK on
|
# option WRITE_INVERT on
|
||||||
|
# option WRITE_PACK on
|
||||||
|
|
||||||
# You must choose fixed or floating point arithmetic:
|
# You must choose fixed or floating point arithmetic:
|
||||||
# option FLOATING_POINT on
|
# option FLOATING_POINT on
|
||||||
|
|||||||
@ -210,7 +210,9 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
int alpha_present;
|
int alpha_present;
|
||||||
int row, col;
|
int row, col;
|
||||||
BOOL raw, alpha_raw = FALSE;
|
BOOL raw, alpha_raw = FALSE;
|
||||||
|
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
||||||
BOOL packed_bitmap = FALSE;
|
BOOL packed_bitmap = FALSE;
|
||||||
|
#endif
|
||||||
png_uint_32 tmp16;
|
png_uint_32 tmp16;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -223,6 +225,7 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
}
|
}
|
||||||
else if ((type_token[1] == '1') || (type_token[1] == '4'))
|
else if ((type_token[1] == '1') || (type_token[1] == '4'))
|
||||||
{
|
{
|
||||||
|
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
||||||
raw = (type_token[1] == '4');
|
raw = (type_token[1] == '4');
|
||||||
color_type = PNG_COLOR_TYPE_GRAY;
|
color_type = PNG_COLOR_TYPE_GRAY;
|
||||||
get_token(pnm_file, width_token);
|
get_token(pnm_file, width_token);
|
||||||
@ -233,6 +236,10 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
height = (png_uint_32) ul_height;
|
height = (png_uint_32) ul_height;
|
||||||
bit_depth = 1;
|
bit_depth = 1;
|
||||||
packed_bitmap = TRUE;
|
packed_bitmap = TRUE;
|
||||||
|
#else
|
||||||
|
fprintf (stderr, "PNM2PNG built without PNG_WRITE_INVERT_SUPPORTED and \n");
|
||||||
|
fprintf (stderr, "PNG_WRITE_PACK_SUPPORTED can't read PBM (P1,P4) files\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if ((type_token[1] == '2') || (type_token[1] == '5'))
|
else if ((type_token[1] == '2') || (type_token[1] == '5'))
|
||||||
{
|
{
|
||||||
@ -351,10 +358,12 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
|
|
||||||
alpha_present = (channels - 1) % 2;
|
alpha_present = (channels - 1) % 2;
|
||||||
|
|
||||||
|
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
||||||
if (packed_bitmap)
|
if (packed_bitmap)
|
||||||
/* row data is as many bytes as can fit width x channels x bit_depth */
|
/* row data is as many bytes as can fit width x channels x bit_depth */
|
||||||
row_bytes = (width * channels * bit_depth + 7) / 8;
|
row_bytes = (width * channels * bit_depth + 7) / 8;
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
/* row_bytes is the width x number of channels x (bit-depth / 8) */
|
/* row_bytes is the width x number of channels x (bit-depth / 8) */
|
||||||
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
|
row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
|
||||||
|
|
||||||
@ -366,11 +375,14 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
|
|
||||||
for (row = 0; row < height; row++)
|
for (row = 0; row < height; row++)
|
||||||
{
|
{
|
||||||
|
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
||||||
if (packed_bitmap) {
|
if (packed_bitmap) {
|
||||||
for (i = 0; i < row_bytes; i++)
|
for (i = 0; i < row_bytes; i++)
|
||||||
/* png supports this format natively so no conversion is needed */
|
/* png supports this format natively so no conversion is needed */
|
||||||
*pix_ptr++ = get_data (pnm_file, 8);
|
*pix_ptr++ = get_data (pnm_file, 8);
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
for (col = 0; col < width; col++)
|
for (col = 0; col < width; col++)
|
||||||
{
|
{
|
||||||
for (i = 0; i < (channels - alpha_present); i++)
|
for (i = 0; i < (channels - alpha_present); i++)
|
||||||
@ -421,11 +433,13 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
|
||||||
if (packed_bitmap == TRUE)
|
if (packed_bitmap == TRUE)
|
||||||
{
|
{
|
||||||
png_set_packing (png_ptr);
|
png_set_packing (png_ptr);
|
||||||
png_set_invert_mono (png_ptr);
|
png_set_invert_mono (png_ptr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* setjmp() must be called in every function that calls a PNG-reading libpng function */
|
/* setjmp() must be called in every function that calls a PNG-reading libpng function */
|
||||||
if (setjmp (png_jmpbuf(png_ptr)))
|
if (setjmp (png_jmpbuf(png_ptr)))
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#define PROGRAM_NAME "png-fix-too-far-back"
|
||||||
|
|
||||||
/* Define the following to use this program against your installed libpng,
|
/* Define the following to use this program against your installed libpng,
|
||||||
* rather than the one being built here:
|
* rather than the one being built here:
|
||||||
*/
|
*/
|
||||||
@ -822,7 +824,7 @@ fix_file(FILE *fp, const char *file, png_uint_32 max_IDAT, int inplace,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* With no arguments just check this file */
|
/* With no arguments just check this file */
|
||||||
if (optimize == 0 && strip == 0 && output == NULL)
|
if (optimize == 0 && strip == 0 && inplace == 0 && output == NULL)
|
||||||
return !read_png(fpIn);
|
return !read_png(fpIn);
|
||||||
|
|
||||||
/* Otherwise, maybe, fix it */
|
/* Otherwise, maybe, fix it */
|
||||||
@ -981,77 +983,109 @@ fix_file(FILE *fp, const char *file, png_uint_32 max_IDAT, int inplace,
|
|||||||
static void
|
static void
|
||||||
usage(const char *prog, int rc)
|
usage(const char *prog, int rc)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
/* ANSI C-90 limits strings to 509 characters, so use a string array: */
|
||||||
"Usage: %s {[options] png-file}\n", prog);
|
size_t i;
|
||||||
fprintf(stderr,
|
static const char *usage_string[] = {
|
||||||
" Tests, optimizes and fixes the zlib header in PNG files.\n"
|
" Tests, optimizes and optionally fixes the zlib header in PNG files.\n",
|
||||||
" Optionally, when fixing, strips ancilliary chunks from the file.\n");
|
" Optionally, when fixing, strips ancilliary chunks from the file.\n",
|
||||||
fprintf(stderr,
|
"\n",
|
||||||
"\nOptions:\n"
|
"OPTIONS\n",
|
||||||
# ifdef PNG_MAXIMUM_INFLATE_WINDOW
|
" OPERATION\n",
|
||||||
" --test: Test the PNG_MAXIMUM_INFLATE_WINDOW option.\n"
|
" By default files are just checked for readability.\n",
|
||||||
# endif
|
" --optimize (-o):\n",
|
||||||
" --optimize (-o): Find the smallest deflate window size for the file.\n"
|
" Find the smallest deflate window size for the file, also outputs\n",
|
||||||
" Also outputs a summary for each file.\n"
|
" a summary of the result for each file.\n",
|
||||||
" --strip (-s): Remove chunks except for IHDR, PLTE, IEND, tRNS, gAMA,\n"
|
" --strip (-s):\n",
|
||||||
" sRGB. If given twice remove gAMA and sRGB as well.\n"
|
" Remove chunks except for IHDR, PLTE, IEND, tRNS, gAMA, sRGB. If\n",
|
||||||
" --errors (-e): Output errors from libpng (except too-far-back).\n");
|
" given twice remove gAMA and sRGB as well.\n",
|
||||||
fprintf(stderr,
|
" --max=<number>:\n",
|
||||||
" --warnings (-w): Output warnings from libpng.\n"
|
" Use IDAT chunks sized <number>. If not given the the IDAT\n",
|
||||||
" --verbose (-v): Output more verbose messages.\n"
|
" chunks will be the maximum size permitted; 2^31-1 bytes.\n",
|
||||||
" --max=<number>: Output IDAT chunks sized <number>. If not given the\n"
|
" MESSAGES\n",
|
||||||
" the IDAT chunks will be the maximum size permitted\n"
|
" By default the program is silent.\n",
|
||||||
" (2^31-1 bytes.)\n"
|
" --errors (-e):\n",
|
||||||
" --out=<file>: Save the result for the next PNG to <file>.\n"
|
" Output errors from libpng (except too-far-back).\n",
|
||||||
" --inplace (-i): Modify the file in place.\n");
|
" --warnings (-w):\n",
|
||||||
fprintf(stderr,
|
" Output warnings from libpng.\n",
|
||||||
"\nExit codes:\n"
|
" --verbose (-v):\n",
|
||||||
" 0: Success, all files pass the test, all output written ok.\n"
|
" Describe program progress (refer to the source).\n",
|
||||||
" 1: At least one file had a read error, all files checked.\n"
|
" OUTPUT\n",
|
||||||
" 2: A file had an unrecoverable error (integer overflow, bad format),\n"
|
" By default nothing is written.\n",
|
||||||
" the program exited immediately, without processing further files.\n"
|
" --out=<file>:\n",
|
||||||
" 3: An IO or out of memory error, or a file could not be opened.h\n");
|
" Write the optimized/corrected version of the next PNG to\n",
|
||||||
fprintf(stderr,
|
" <file>. This overrides the following two options\n",
|
||||||
"\nDescription:\n"
|
" --suffix=<suffix>:\n",
|
||||||
" %s checks each PNG file on the command line for errors.\n"
|
" Set --out=<name><suffix> for all following files, unless\n",
|
||||||
" By default it is silent and just exits with an error code (as above)\n"
|
" overridden on a per-file basis by explicit --out. If no\n",
|
||||||
" if any error is detected. With --optimize, --strip or --out,\n"
|
" --suffix= value is given behaves as --inplace.\n",
|
||||||
" however, the zlib \"invalid distance too far back\" error is fixed\n"
|
" --inplace (-i):\n",
|
||||||
" and the program exits with a 0 success code unless some other error\n"
|
" Modify the file in place. THIS IS DANGEROUS - please keep a\n",
|
||||||
" is encountered.\n"
|
" backup of the file because a program interrupt or bug will\n",
|
||||||
"\n", prog);
|
" result in a corrupted file.\n",
|
||||||
fprintf(stderr,
|
#ifdef PNG_MAXIMUM_INFLATE_WINDOW
|
||||||
" Use --errors to display the other errors, use --optimize to test\n"
|
" INTERNAL OPTIONS\n",
|
||||||
" different values for the deflate \"window bits\" parameter and find\n"
|
" --test:\n",
|
||||||
" the smallest that works.\n"
|
" Test the PNG_MAXIMUM_INFLATE_WINDOW option. Setting this\n",
|
||||||
"\n"
|
" disables output as this would produce a broken file.\n",
|
||||||
" Notice that some PNG files with the zlib header problem can still be\n"
|
#endif
|
||||||
" read by libpng. This program will still detect the error.\n"
|
"\n",
|
||||||
"\n");
|
"EXIT CODES\n",
|
||||||
fprintf(stderr,
|
" 0: Success, all files pass the test, any output written ok.\n",
|
||||||
" The output produced with --optimize is as follows:\n"
|
" 1: At least one file had a read error, all files checked.\n",
|
||||||
"\n"
|
" 2: A file had an unrecoverable error (integer overflow, bad format),\n",
|
||||||
" opt-bits curr-bits image-bits opt-flag opt-type change file\n"
|
" the program exited immediately, without processing further files.\n",
|
||||||
"\n"
|
" 3: An IO or out of memory error, or a file could not be opened.h\n",
|
||||||
" opt-bits: The minimum window bits (8-15) that works, if the file\n"
|
"\n",
|
||||||
" is written this is the value that will be stored.\n"
|
"DESCRIPTION\n",
|
||||||
" curr-bits: The value currently stored in the file.\n");
|
" " PROGRAM_NAME " checks each PNG file on the command line\n",
|
||||||
fprintf(stderr,
|
" for errors. By default it is silent and just returns an exit code\n",
|
||||||
" image-bits: The window bits value corresponding to the size of the\n"
|
" (as above). Options allow the zlib error:\n",
|
||||||
" uncompressed PNG image data. When --optimize is not\n"
|
"\n",
|
||||||
" given but --strip is, this value will be used if lower\n"
|
" \"invalid distance too far back\"\n",
|
||||||
" than the current value.\n"
|
"\n",
|
||||||
" opt-flag: < if the optimized bit value is less than that implied by\n"
|
" to be fixed during the read and therefore test the file for other\n",
|
||||||
" the PNG image size (opt-bits < image-bits)\n"
|
" errors that may prevent reading.\n",
|
||||||
" = if optimization is not possible (opt-bits = image-bits)\n"
|
"\n",
|
||||||
" opt-type: reduce if opts-bits < curr-bits\n");
|
" Setting one of the \"OUTPUT\" options causes the possibly modified\n",
|
||||||
fprintf(stderr,
|
" file to be written to a new file or, with --inplace, to the existing\n",
|
||||||
" ok if opt-bits = curr-bits (no change required)\n"
|
" file.\n",
|
||||||
" INCREASE if opt-bits > curr-bits (the file has the bug)\n"
|
"\n",
|
||||||
" change: opt-bits - curr-bits, so negative if optimization is\n"
|
" IMPORTANT: --inplace will overwrite the original file, if you use it\n",
|
||||||
" possible, 0 if no change is required, positive if the\n"
|
" be sure to keep a backup of the original file, this program can fail\n",
|
||||||
" bug is present.\n"
|
" during the write and has been known to have serious bugs! A failure\n",
|
||||||
" file: The file name.\n");
|
" during write will certainly damage the original file.\n",
|
||||||
|
"\n",
|
||||||
|
" Notice that some PNG files with the zlib header problem can still be\n",
|
||||||
|
" read by libpng under some circumstances. This program will still\n",
|
||||||
|
" detect and, if requested, correct the error.\n",
|
||||||
|
"\n",
|
||||||
|
" The output produced with --optimize is as follows:\n",
|
||||||
|
"\n",
|
||||||
|
" opt-bits curr-bits image-bits opt-flag opt-type change file\n",
|
||||||
|
"\n",
|
||||||
|
" opt-bits: The minimum window bits (8-15) that works, if the file\n",
|
||||||
|
" is written this is the value that will be stored.\n",
|
||||||
|
" curr-bits: The value currently stored in the file.\n",
|
||||||
|
" image-bits: The window bits value corresponding to the size of the\n",
|
||||||
|
" uncompressed PNG image data. When --optimize is not\n",
|
||||||
|
" given but --strip is, this value will be used if lower\n",
|
||||||
|
" than the current value.\n",
|
||||||
|
" opt-flag: < if the optimized bit value is less than that implied by\n",
|
||||||
|
" the PNG image size (opt-bits < image-bits)\n",
|
||||||
|
" = if optimization is not possible (opt-bits = image-bits)\n",
|
||||||
|
" opt-type: reduce if opts-bits < curr-bits\n",
|
||||||
|
" ok if opt-bits = curr-bits (no change required)\n",
|
||||||
|
" INCREASE if opt-bits > curr-bits (the file has the bug)\n",
|
||||||
|
" change: opt-bits - curr-bits, so negative if optimization is\n",
|
||||||
|
" possible, 0 if no change is required, positive if the\n",
|
||||||
|
" bug is present.\n",
|
||||||
|
" file: The file name.\n",
|
||||||
|
};
|
||||||
|
|
||||||
|
fprintf(stderr, "Usage: %s {[options] png-file}\n", prog);
|
||||||
|
|
||||||
|
for (i=0; i < (sizeof usage_string)/(sizeof usage_string[0]); ++i)
|
||||||
|
fputs(usage_string[i], stderr);
|
||||||
|
|
||||||
exit(rc);
|
exit(rc);
|
||||||
}
|
}
|
||||||
@ -1063,6 +1097,7 @@ main(int argc, const char **argv)
|
|||||||
png_uint_32 max_IDAT = 0x7fffffff;
|
png_uint_32 max_IDAT = 0x7fffffff;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
const char *outfile = NULL;
|
const char *outfile = NULL;
|
||||||
|
const char *suffix = NULL;
|
||||||
const char *prog = *argv;
|
const char *prog = *argv;
|
||||||
static const png_byte idat_bytes[4] = { 73, 68, 65, 84 };
|
static const png_byte idat_bytes[4] = { 73, 68, 65, 84 };
|
||||||
static const png_byte iend_bytes[4] = { 73, 69, 78, 68 };
|
static const png_byte iend_bytes[4] = { 73, 69, 78, 68 };
|
||||||
@ -1111,6 +1146,9 @@ main(int argc, const char **argv)
|
|||||||
else if (strncmp(*argv, "--out=", 6) == 0)
|
else if (strncmp(*argv, "--out=", 6) == 0)
|
||||||
outfile = 6+*argv;
|
outfile = 6+*argv;
|
||||||
|
|
||||||
|
else if (strncmp(*argv, "--suffix=", 9) == 0)
|
||||||
|
suffix = 9+*argv;
|
||||||
|
|
||||||
else if (strcmp(*argv, "--strip") == 0 || strcmp(*argv, "-s") == 0)
|
else if (strcmp(*argv, "--strip") == 0 || strcmp(*argv, "-s") == 0)
|
||||||
++strip;
|
++strip;
|
||||||
|
|
||||||
@ -1133,10 +1171,43 @@ main(int argc, const char **argv)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int ret;
|
int ret, overwrite;
|
||||||
|
|
||||||
|
if (outfile != NULL)
|
||||||
|
overwrite = 0;
|
||||||
|
|
||||||
|
else if (suffix != NULL)
|
||||||
|
{
|
||||||
|
if (*suffix == 0)
|
||||||
|
overwrite = 1;
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static char temp_name[FILENAME_MAX];
|
||||||
|
size_t filelen = strlen(*argv);
|
||||||
|
size_t suffixlen = strlen(suffix);
|
||||||
|
|
||||||
|
if (filelen + suffixlen >= FILENAME_MAX)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: output file name too long: %s%s\n", prog,
|
||||||
|
*argv, suffix);
|
||||||
|
exit(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(temp_name, *argv, filelen);
|
||||||
|
memcpy(temp_name+filelen, suffix, suffixlen);
|
||||||
|
temp_name[filelen+suffixlen] = 0;
|
||||||
|
|
||||||
|
outfile = temp_name;
|
||||||
|
overwrite = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
overwrite = inplace;
|
||||||
|
|
||||||
err +=
|
err +=
|
||||||
fix_file(fp, *argv, max_IDAT, inplace, strip, optimize, outfile);
|
fix_file(fp, *argv, max_IDAT, overwrite, strip, optimize, outfile);
|
||||||
|
|
||||||
if (fpIn != NULL)
|
if (fpIn != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
libpng-manual.txt - A description on how to use and modify libpng
|
libpng-manual.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.6.3beta06 - May 9, 2013
|
libpng version 1.6.3beta06 - May 12, 2013
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp at users.sourceforge.net>
|
<glennrp at users.sourceforge.net>
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||||||
|
|
||||||
Based on:
|
Based on:
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.6.3beta06 - May 9, 2013
|
libpng versions 0.97, January 1998, through 1.6.3beta06 - May 12, 2013
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
|
|
||||||
@ -5212,7 +5212,7 @@ Other rules can be inferred by inspecting the libpng source.
|
|||||||
|
|
||||||
XVI. Y2K Compliance in libpng
|
XVI. Y2K Compliance in libpng
|
||||||
|
|
||||||
May 9, 2013
|
May 12, 2013
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|||||||
14
libpng.3
14
libpng.3
@ -1,4 +1,4 @@
|
|||||||
.TH LIBPNG 3 "May 9, 2013"
|
.TH LIBPNG 3 "May 12, 2013"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.3beta06
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.3beta06
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -504,7 +504,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng-manual.txt - A description on how to use and modify libpng
|
libpng-manual.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.6.3beta06 - May 9, 2013
|
libpng version 1.6.3beta06 - May 12, 2013
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp at users.sourceforge.net>
|
<glennrp at users.sourceforge.net>
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
@ -515,7 +515,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||||||
|
|
||||||
Based on:
|
Based on:
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.6.3beta06 - May 9, 2013
|
libpng versions 0.97, January 1998, through 1.6.3beta06 - May 12, 2013
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
|
|
||||||
@ -5717,7 +5717,7 @@ Other rules can be inferred by inspecting the libpng source.
|
|||||||
|
|
||||||
.SH XVI. Y2K Compliance in libpng
|
.SH XVI. Y2K Compliance in libpng
|
||||||
|
|
||||||
May 9, 2013
|
May 12, 2013
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
@ -5994,7 +5994,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.6.3beta06 - May 9, 2013:
|
Libpng version 1.6.3beta06 - May 12, 2013:
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||||
|
|
||||||
@ -6017,7 +6017,7 @@ 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.6.3beta06, May 9, 2013, are
|
libpng versions 1.2.6, August 15, 2004, through 1.6.3beta06, May 12, 2013, are
|
||||||
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
Copyright (c) 2004,2006-2007 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
|
||||||
@ -6116,7 +6116,7 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
May 9, 2013
|
May 12, 2013
|
||||||
|
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
.TH LIBPNGPF 3 "May 9, 2013"
|
.TH LIBPNGPF 3 "May 12, 2013"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.3beta06
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.3beta06
|
||||||
(private functions)
|
(private functions)
|
||||||
|
|||||||
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "May 9, 2013"
|
.TH PNG 5 "May 12, 2013"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
|||||||
4
png.c
4
png.c
@ -768,13 +768,13 @@ png_get_copyright(png_const_structrp png_ptr)
|
|||||||
#else
|
#else
|
||||||
# ifdef __STDC__
|
# ifdef __STDC__
|
||||||
return PNG_STRING_NEWLINE \
|
return PNG_STRING_NEWLINE \
|
||||||
"libpng version 1.6.3beta06 - May 9, 2013" PNG_STRING_NEWLINE \
|
"libpng version 1.6.3beta06 - May 12, 2013" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE;
|
PNG_STRING_NEWLINE;
|
||||||
# else
|
# else
|
||||||
return "libpng version 1.6.3beta06 - May 9, 2013\
|
return "libpng version 1.6.3beta06 - May 12, 2013\
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||||
|
|||||||
10
png.h
10
png.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.6.3beta06 - May 9, 2013
|
* libpng version 1.6.3beta06 - May 12, 2013
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@ -11,7 +11,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.6.3beta06 - May 9, 2013: Glenn
|
* libpng versions 0.97, January 1998, through 1.6.3beta06 - May 12, 2013: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -207,7 +207,7 @@
|
|||||||
*
|
*
|
||||||
* 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.6.3beta06, May 9, 2013, are
|
* libpng versions 1.2.6, August 15, 2004, through 1.6.3beta06, May 12, 2013, are
|
||||||
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2004, 2006-2013 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:
|
||||||
@ -319,7 +319,7 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* May 9, 2013
|
* May 12, 2013
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
@ -387,7 +387,7 @@
|
|||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.6.3beta06"
|
#define PNG_LIBPNG_VER_STRING "1.6.3beta06"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.6.3beta06 - May 9, 2013\n"
|
" libpng version 1.6.3beta06 - May 12, 2013\n"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 16
|
#define PNG_LIBPNG_VER_SONUM 16
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.6.3beta06 - May 9, 2013
|
* libpng version 1.6.3beta06 - May 12, 2013
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
VisualStudio instructions
|
VisualStudio instructions
|
||||||
|
|
||||||
libpng version 1.6.3beta06 - May 9, 2013
|
libpng version 1.6.3beta06 - May 12, 2013
|
||||||
|
|
||||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* zlib.props - location of zlib source
|
* zlib.props - location of zlib source
|
||||||
*
|
*
|
||||||
* libpng version 1.6.3beta06 - May 9, 2013
|
* libpng version 1.6.3beta06 - May 12, 2013
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Makefiles for libpng version 1.6.3beta06 - May 9, 2013
|
Makefiles for libpng version 1.6.3beta06 - May 12, 2013
|
||||||
|
|
||||||
pnglibconf.h.prebuilt => Stores configuration settings
|
pnglibconf.h.prebuilt => Stores configuration settings
|
||||||
makefile.linux => Linux/ELF makefile
|
makefile.linux => Linux/ELF makefile
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/* pnglibconf.h - library build configuration */
|
/* pnglibconf.h - library build configuration */
|
||||||
|
|
||||||
/* Libpng version 1.6.3beta06 - May 9, 2013 */
|
/* Libpng version 1.6.3beta06 - May 12, 2013 */
|
||||||
|
|
||||||
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
|
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user