mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from pngcrush-1.6.14.tar
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
Change log:
|
||||
|
||||
Version 1.6.13 (built with libpng-1.2.34 and zlib-1.2.3.2)
|
||||
Added "-time_stamp" directive, to cause pngcrush to write
|
||||
a new timestamp on the output file instead of replicating
|
||||
the timestame from the input file.
|
||||
Version 1.6.14 (built with libpng-1.2.35 and zlib-1.2.3.2)
|
||||
|
||||
Version 1.6.12 (built with libpng-1.2.34 and zlib-1.2.3.2)
|
||||
|
||||
|
||||
12
example.c
12
example.c
@@ -2,9 +2,9 @@
|
||||
#if 0 /* in case someone actually tries to compile this */
|
||||
|
||||
/* example.c - an example of using libpng
|
||||
* Last changed in libpng 1.2.33 [December 18, 2008]
|
||||
* Last changed in libpng 1.2.35 [February 14, 2009]
|
||||
* This file has been placed in the public domain by the authors.
|
||||
* Maintained 1998-2008 Glenn Randers-Pehrson
|
||||
* Maintained 1998-2009 Glenn Randers-Pehrson
|
||||
* Maintained 1996, 1997 Andreas Dilger)
|
||||
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -342,11 +342,13 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
||||
/* The easiest way to read the image: */
|
||||
png_bytep row_pointers[height];
|
||||
|
||||
/* Clear the pointer array */
|
||||
for (row = 0; row < height; row++)
|
||||
row_pointers[row] = NULL;
|
||||
|
||||
for (row = 0; row < height; row++)
|
||||
{
|
||||
row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
|
||||
info_ptr));
|
||||
}
|
||||
|
||||
/* Now it's time to read the image. One of these methods is REQUIRED */
|
||||
#ifdef entire /* Read the entire image in one go */
|
||||
@@ -771,9 +773,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
||||
|
||||
/* If you are only writing one row at a time, this works */
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
png_write_rows(png_ptr, &row_pointers[y], 1);
|
||||
}
|
||||
}
|
||||
#endif no_entire /* use only one output method */
|
||||
|
||||
|
||||
4
png.c
4
png.c
@@ -13,7 +13,7 @@
|
||||
#include "png.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_34 Your_png_h_is_not_version_1_2_34;
|
||||
typedef version_1_2_35 Your_png_h_is_not_version_1_2_35;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
@@ -694,7 +694,7 @@ png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) "\n libpng version 1.2.34 - December 18, 2008\n\
|
||||
return ((png_charp) "\n libpng version 1.2.35 - February 14, 2009\n\
|
||||
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
|
||||
27
png.h
27
png.h
@@ -1,14 +1,14 @@
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.2.34 - December 18, 2008
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* libpng version 1.2.35 - February 14, 2009
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@@ -217,6 +217,11 @@
|
||||
* 1.2.34rc01 13 10234 12.so.0.34[.0]
|
||||
* 1.0.42 10 10042 10.so.0.42[.0]
|
||||
* 1.2.34 13 10234 12.so.0.34[.0]
|
||||
* 1.2.35beta01-03 13 10235 12.so.0.35[.0]
|
||||
* 1.0.43rc01-02 10 10043 10.so.0.43[.0]
|
||||
* 1.2.35rc01-02 13 10235 12.so.0.35[.0]
|
||||
* 1.0.43 10 10043 10.so.0.43[.0]
|
||||
* 1.2.35 13 10235 12.so.0.35[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@@ -246,7 +251,7 @@
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
|
||||
* Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
|
||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
* with the following individual added to the list of Contributing Authors:
|
||||
@@ -358,13 +363,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* December 18, 2008
|
||||
* February 14, 2009
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.2.34 are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.2.35 are Y2K compliant. It is my belief that earlier
|
||||
* versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
@@ -420,9 +425,9 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.34"
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.35"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.2.34 - December 18, 2008\n"
|
||||
" libpng version 1.2.35 - February 14, 2009\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 0
|
||||
#define PNG_LIBPNG_VER_DLLNUM 13
|
||||
@@ -430,7 +435,7 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 2
|
||||
#define PNG_LIBPNG_VER_RELEASE 34
|
||||
#define PNG_LIBPNG_VER_RELEASE 35
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||
|
||||
@@ -458,7 +463,7 @@
|
||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
|
||||
#define PNG_LIBPNG_VER 10234 /* 1.2.34 */
|
||||
#define PNG_LIBPNG_VER 10235 /* 1.2.35 */
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
/* include the compression library's header */
|
||||
@@ -1482,7 +1487,7 @@ struct png_struct_def
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef png_structp version_1_2_34;
|
||||
typedef png_structp version_1_2_35;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.2.34 - December 18, 2008
|
||||
* libpng version 1.2.35 - February 14, 2009
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
@@ -235,6 +235,8 @@
|
||||
# include <windows.h>
|
||||
/* Console I/O functions are not supported on WindowsCE */
|
||||
# define PNG_NO_CONSOLE_IO
|
||||
/* abort() may not be supported on some/all Windows CE platforms */
|
||||
# define PNG_ABORT() exit(-1)
|
||||
# ifdef PNG_DEBUG
|
||||
# undef PNG_DEBUG
|
||||
# endif
|
||||
|
||||
15
pngcrush.c
15
pngcrush.c
@@ -1,5 +1,5 @@
|
||||
/* pngcrush.c - recompresses png files
|
||||
* Copyright (C) 1998-2002,2006-2008 Glenn Randers-Pehrson (glennrp@users.sf.net)
|
||||
* Copyright (C) 1998-2002,2006-2009 Glenn Randers-Pehrson (glennrp@users.sf.net)
|
||||
* Copyright (C) 2005 Greg Roelofs
|
||||
*
|
||||
* The most recent version of pngcrush can be found at SourceForge in
|
||||
@@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define PNGCRUSH_VERSION "1.6.13"
|
||||
#define PNGCRUSH_VERSION "1.6.14"
|
||||
|
||||
/*
|
||||
#define PNGCRUSH_COUNT_COLORS
|
||||
@@ -38,7 +38,7 @@
|
||||
* If you have modified this source, you may insert additional notices
|
||||
* immediately after this sentence.
|
||||
*
|
||||
* Copyright (C) 1998-2002,2006-2008 Glenn Randers-Pehrson (glennrp@users.sf.net)
|
||||
* Copyright (C) 1998-2002,2006-2009 Glenn Randers-Pehrson (glennrp@users.sf.net)
|
||||
* Copyright (C) 2005 Greg Roelofs
|
||||
*
|
||||
* The pngcrush computer program is supplied "AS IS". The Author disclaims all
|
||||
@@ -5485,7 +5485,7 @@ void print_version_info(void)
|
||||
" | pngcrush %s\n"
|
||||
/* If you have modified this source, you may insert additional notices
|
||||
* immediately after this sentence: */
|
||||
" | Copyright (C) 1998-2002,2006-2008 Glenn Randers-Pehrson\n"
|
||||
" | Copyright (C) 1998-2002,2006-2009 Glenn Randers-Pehrson\n"
|
||||
" | Copyright (C) 2005 Greg Roelofs\n"
|
||||
" | This is a free, open-source program. Permission is irrevocably\n"
|
||||
" | granted to everyone to use this version of pngcrush without\n"
|
||||
@@ -5493,7 +5493,7 @@ void print_version_info(void)
|
||||
" | Executable name is %s\n"
|
||||
" | It was built with libpng version %s, and is\n"
|
||||
" | running with %s"
|
||||
" | Copyright (C) 1998-2004,2006-2008 Glenn Randers-Pehrson,\n"
|
||||
" | Copyright (C) 1998-2004,2006-2009 Glenn Randers-Pehrson,\n"
|
||||
" | Copyright (C) 1996, 1997 Andreas Dilger,\n"
|
||||
" | Copyright (C) 1995, Guy Eric Schalnat, Group 42 Inc.,\n"
|
||||
" | and zlib version %s, Copyright (C) 1998-2002 (or later),\n"
|
||||
@@ -5531,7 +5531,7 @@ static const char *pngcrush_legal[] = {
|
||||
"",
|
||||
/* If you have modified this source, you may insert additional notices
|
||||
* immediately after this sentence: */
|
||||
"Copyright (C) 1998-2002,2006-2008 Glenn Randers-Pehrson (glennrp@users.sf.net)",
|
||||
"Copyright (C) 1998-2002,2006-2009 Glenn Randers-Pehrson (glennrp@users.sf.net)",
|
||||
"Copyright (C) 2005 Greg Roelofs",
|
||||
"",
|
||||
"DISCLAIMER: The pngcrush computer program is supplied \"AS IS\".",
|
||||
@@ -5838,8 +5838,7 @@ struct options_help pngcrush_options[] = {
|
||||
|
||||
{0, " -time_stamp"},
|
||||
{2, ""},
|
||||
{2, " Reset file modification time. Default is to"},
|
||||
{2, " reproduce the input file modification time."},
|
||||
{2, " Reset file modification time."},
|
||||
{2, ""},
|
||||
|
||||
#ifdef PNG_tRNS_SUPPORTED
|
||||
|
||||
2
pngget.c
2
pngget.c
@@ -883,7 +883,7 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
/* these functions were added to libpng 1.2.6 */
|
||||
/* These functions were added to libpng 1.2.6 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_user_width_max (png_structp png_ptr)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* Last changed in libpng 1.2.35 [February 14, 2009]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -1437,11 +1437,11 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_ROWS;
|
||||
#endif
|
||||
png_memset(info_ptr->row_pointers, 0, info_ptr->height
|
||||
* png_sizeof(png_bytep));
|
||||
for (row = 0; row < (int)info_ptr->height; row++)
|
||||
{
|
||||
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
|
||||
png_get_rowbytes(png_ptr, info_ptr));
|
||||
}
|
||||
}
|
||||
|
||||
png_read_image(png_ptr, info_ptr->row_pointers);
|
||||
|
||||
21
pngrtran.c
21
pngrtran.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* Last changed in libpng 1.2.35 [February 14, 2009]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -309,9 +309,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
||||
|
||||
hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
|
||||
png_sizeof(png_dsortp)));
|
||||
for (i = 0; i < 769; i++)
|
||||
hash[i] = NULL;
|
||||
/* png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); */
|
||||
png_memset(hash, 0, 769 * png_sizeof(png_dsortp));
|
||||
|
||||
num_new_palette = num_palette;
|
||||
|
||||
@@ -684,7 +682,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
}
|
||||
png_ptr->rgb_to_gray_red_coeff = red_int;
|
||||
png_ptr->rgb_to_gray_green_coeff = green_int;
|
||||
png_ptr->rgb_to_gray_blue_coeff =
|
||||
png_ptr->rgb_to_gray_blue_coeff =
|
||||
(png_uint_16)(32768 - red_int - green_int);
|
||||
}
|
||||
}
|
||||
@@ -1329,7 +1327,7 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
if (rgb_error)
|
||||
{
|
||||
png_ptr->rgb_to_gray_status=1;
|
||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
PNG_RGB_TO_GRAY_WARN)
|
||||
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
@@ -3836,7 +3834,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
dp = row + (row_info->rowbytes << 1) - 1;
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if (*(sp - 1) == gray_high && *(sp) == gray_low)
|
||||
if (*(sp - 1) == gray_high && *(sp) == gray_low)
|
||||
{
|
||||
*dp-- = 0;
|
||||
*dp-- = 0;
|
||||
@@ -4133,6 +4131,8 @@ png_build_gamma_table(png_structp png_ptr)
|
||||
double fin, fout;
|
||||
png_uint_32 last, max;
|
||||
|
||||
png_memset(png_ptr->gamma_16_table, 0, num * png_sizeof(png_uint_16p));
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
|
||||
@@ -4188,6 +4188,8 @@ png_build_gamma_table(png_structp png_ptr)
|
||||
png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr,
|
||||
(png_uint_32)(num * png_sizeof(png_uint_16p )));
|
||||
|
||||
png_memset(png_ptr->gamma_16_to_1, 0, num * png_sizeof(png_uint_16p));
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr,
|
||||
@@ -4211,6 +4213,9 @@ png_build_gamma_table(png_structp png_ptr)
|
||||
png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr,
|
||||
(png_uint_32)(num * png_sizeof(png_uint_16p)));
|
||||
|
||||
png_memset(png_ptr->gamma_16_from_1, 0,
|
||||
num * png_sizeof(png_uint_16p));
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr,
|
||||
|
||||
12
pngrutil.c
12
pngrutil.c
@@ -1118,6 +1118,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_sPLT");
|
||||
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before sPLT");
|
||||
else if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||
@@ -1904,6 +1905,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_tEXt");
|
||||
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before tEXt");
|
||||
|
||||
@@ -1920,6 +1922,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
#endif
|
||||
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
@@ -1937,6 +1940,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
key = png_ptr->chunkdata;
|
||||
|
||||
key[slength] = 0x00;
|
||||
|
||||
for (text = key; *text; text++)
|
||||
@@ -1986,6 +1990,8 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_size_t slength, prefix_len, data_len;
|
||||
|
||||
png_debug(1, "in png_handle_zTXt");
|
||||
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before zTXt");
|
||||
|
||||
@@ -2090,6 +2096,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_iTXt");
|
||||
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before iTXt");
|
||||
|
||||
@@ -2216,6 +2223,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_unknown");
|
||||
|
||||
|
||||
if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
@@ -3204,9 +3212,9 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
png_debug1(3, "width = %lu,", png_ptr->width);
|
||||
png_debug1(3, "height = %lu,", png_ptr->height);
|
||||
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
|
||||
png_debug1(3, "num_rows = %lu", png_ptr->num_rows);
|
||||
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
|
||||
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
|
||||
png_debug1(3, "irowbytes = %lu,", png_ptr->irowbytes);
|
||||
png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes);
|
||||
|
||||
png_ptr->flags |= PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
|
||||
19
pngset.c
19
pngset.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.2.34 [December 18, 2008]
|
||||
* Last changed in libpng 1.2.35 [February 14, 2009]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -61,7 +61,8 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_cHRM;
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_FLOATING_POINT_SUPPORTED */
|
||||
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
@@ -382,7 +383,11 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
return;
|
||||
}
|
||||
|
||||
info_ptr->pcal_params[nparams] = NULL;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_PCAL;
|
||||
#endif
|
||||
|
||||
png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp));
|
||||
|
||||
for (i = 0; i < nparams; i++)
|
||||
{
|
||||
@@ -399,9 +404,6 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
}
|
||||
|
||||
info_ptr->valid |= PNG_INFO_pCAL;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_PCAL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -635,7 +637,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
}
|
||||
#endif /* cHRM */
|
||||
}
|
||||
#endif
|
||||
#endif /* sRGB */
|
||||
|
||||
|
||||
#if defined(PNG_iCCP_SUPPORTED)
|
||||
@@ -959,6 +961,7 @@ png_set_sPLT(png_structp png_ptr,
|
||||
|
||||
png_memcpy(np, info_ptr->splt_palettes,
|
||||
info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
|
||||
|
||||
png_free(png_ptr, info_ptr->splt_palettes);
|
||||
info_ptr->splt_palettes=NULL;
|
||||
|
||||
|
||||
@@ -1216,7 +1216,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
#ifndef SINGLE_ROWBUF_ALLOC
|
||||
png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass, y);
|
||||
png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y);
|
||||
row_buf = (png_bytep)png_malloc(read_ptr,
|
||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||
png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf,
|
||||
@@ -1685,4 +1685,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_34 your_png_h_is_not_version_1_2_34;
|
||||
typedef version_1_2_35 your_png_h_is_not_version_1_2_35;
|
||||
|
||||
6
pngwio.c
6
pngwio.c
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* Last changed in libpng 1.2.35 [February 14, 2009]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -137,7 +137,7 @@ png_default_flush(png_structp png_ptr)
|
||||
if (png_ptr == NULL) return;
|
||||
#if !defined(_WIN32_WCE)
|
||||
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
|
||||
if (io_ptr != NULL)
|
||||
if (io_ptr != NULL && fileno(io_ptr) != -1)
|
||||
fflush(io_ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.31 [August 19, 2008]
|
||||
* Last changed in libpng 1.2.34 [December 18, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
||||
Reference in New Issue
Block a user