Imported from libpng-1.0.1a.tar
This commit is contained in:
parent
f9f2fe0ce7
commit
896239be20
26
ANNOUNCE
Normal file
26
ANNOUNCE
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
Libpng 1.0.1a April 21, 1998
|
||||
|
||||
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.
|
||||
|
||||
Changes since the last release:
|
||||
|
||||
Optimized Paeth calculations by replacing abs() function calls with intrinsics
|
||||
plus other loop optimizations. Improves avg decoding speed by about 20 percent.
|
||||
Commented out i386istic "align" compiler flags in makefile.lnx.
|
||||
Reduced the default warning level in some makefiles, to make them consistent.
|
||||
Removed references to IJG and JPEG in the ansi2knr.c copyright statement.
|
||||
Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation.
|
||||
Added grayscale and 16-bit capability to png_do_read_filler().
|
||||
Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes
|
||||
too large when writing an image with bit_depth < 8 (Bob Dellaca).
|
||||
Corrected some bugs in the experimental weighted filtering heuristics.
|
||||
Moved a misplaced pngrutil code block that truncates tRNS if it has more
|
||||
than num_palette entries -- test was done before num_palette was defined.
|
||||
Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins).
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@dworkin.wustl.edu or to randeg@alumni.rpi.edu
|
||||
|
||||
Glenn R-P
|
519
CHANGES
519
CHANGES
@ -1,288 +1,303 @@
|
||||
CHANGES - changes for libpng
|
||||
|
||||
version 0.2
|
||||
added reader into png.h
|
||||
fixed small problems in stub file
|
||||
added reader into png.h
|
||||
fixed small problems in stub file
|
||||
version 0.3
|
||||
added pull reader
|
||||
split up pngwrite.c to several files
|
||||
added pnglib.txt
|
||||
added example.c
|
||||
cleaned up writer, adding a few new tranformations
|
||||
fixed some bugs in writer
|
||||
interfaced with zlib 0.5
|
||||
added K&R support
|
||||
added check for 64 KB blocks for 16 bit machines
|
||||
added pull reader
|
||||
split up pngwrite.c to several files
|
||||
added pnglib.txt
|
||||
added example.c
|
||||
cleaned up writer, adding a few new tranformations
|
||||
fixed some bugs in writer
|
||||
interfaced with zlib 0.5
|
||||
added K&R support
|
||||
added check for 64 KB blocks for 16 bit machines
|
||||
version 0.4
|
||||
cleaned up code and commented code
|
||||
simplified time handling into png_time
|
||||
created png_color_16 and png_color_8 to handle color needs
|
||||
cleaned up color type defines
|
||||
fixed various bugs
|
||||
made various names more consistant
|
||||
interfaced with zlib 0.71
|
||||
cleaned up zTXt reader and writer (using zlib's Reset functions)
|
||||
split transformations into pngrtran.c and pngwtran.c
|
||||
cleaned up code and commented code
|
||||
simplified time handling into png_time
|
||||
created png_color_16 and png_color_8 to handle color needs
|
||||
cleaned up color type defines
|
||||
fixed various bugs
|
||||
made various names more consistant
|
||||
interfaced with zlib 0.71
|
||||
cleaned up zTXt reader and writer (using zlib's Reset functions)
|
||||
split transformations into pngrtran.c and pngwtran.c
|
||||
version 0.5
|
||||
interfaced with zlib 0.8
|
||||
fixed many reading and writing bugs
|
||||
saved using 3 spaces instead of tabs
|
||||
interfaced with zlib 0.8
|
||||
fixed many reading and writing bugs
|
||||
saved using 3 spaces instead of tabs
|
||||
version 0.6
|
||||
added png_large_malloc() and png_large_free()
|
||||
added png_size_t
|
||||
cleaned up some compiler warnings
|
||||
added png_start_read_image()
|
||||
added png_large_malloc() and png_large_free()
|
||||
added png_size_t
|
||||
cleaned up some compiler warnings
|
||||
added png_start_read_image()
|
||||
version 0.7
|
||||
cleaned up lots of bugs
|
||||
finished dithering and other stuff
|
||||
added test program
|
||||
changed name from pnglib to libpng
|
||||
cleaned up lots of bugs
|
||||
finished dithering and other stuff
|
||||
added test program
|
||||
changed name from pnglib to libpng
|
||||
version 0.71 [June, 1995]
|
||||
changed pngtest.png for zlib 0.93
|
||||
fixed error in libpng.txt and example.c
|
||||
changed pngtest.png for zlib 0.93
|
||||
fixed error in libpng.txt and example.c
|
||||
version 0.8
|
||||
cleaned up some bugs
|
||||
added png_set_filler()
|
||||
split up pngstub.c into pngmem.c, pngio.c, and pngerror.c
|
||||
added #define's to remove unwanted code
|
||||
moved png_info_init() to png.c
|
||||
added old_size into png_realloc()
|
||||
added functions to manually set filtering and compression info
|
||||
changed compression parameters based on image type
|
||||
optimized filter selection code
|
||||
added version info
|
||||
changed external functions passing floats to doubles (k&r problems?)
|
||||
put all the configurable stuff in pngconf.h
|
||||
enabled png_set_shift to work with paletted images on read
|
||||
added png_read_update_info() - updates info structure with
|
||||
transformations
|
||||
cleaned up some bugs
|
||||
added png_set_filler()
|
||||
split up pngstub.c into pngmem.c, pngio.c, and pngerror.c
|
||||
added #define's to remove unwanted code
|
||||
moved png_info_init() to png.c
|
||||
added old_size into png_realloc()
|
||||
added functions to manually set filtering and compression info
|
||||
changed compression parameters based on image type
|
||||
optimized filter selection code
|
||||
added version info
|
||||
changed external functions passing floats to doubles (k&r problems?)
|
||||
put all the configurable stuff in pngconf.h
|
||||
enabled png_set_shift to work with paletted images on read
|
||||
added png_read_update_info() - updates info structure with
|
||||
transformations
|
||||
version 0.81 [August, 1995]
|
||||
incorporated Tim Wegner's medium model code (thanks, Tim)
|
||||
incorporated Tim Wegner's medium model code (thanks, Tim)
|
||||
version 0.82 [September, 1995]
|
||||
[unspecified changes]
|
||||
[unspecified changes]
|
||||
version 0.85 [December, 1995]
|
||||
added more medium model code (almost everything's a far)
|
||||
added i/o, error, and memory callback functions
|
||||
fixed some bugs (16 bit, 4 bit interlaced, etc.)
|
||||
added first run progressive reader (barely tested)
|
||||
added more medium model code (almost everything's a far)
|
||||
added i/o, error, and memory callback functions
|
||||
fixed some bugs (16 bit, 4 bit interlaced, etc.)
|
||||
added first run progressive reader (barely tested)
|
||||
version 0.86 [January, 1996]
|
||||
fixed bugs
|
||||
improved documentation
|
||||
fixed bugs
|
||||
improved documentation
|
||||
version 0.87 [January, 1996]
|
||||
fixed medium model bugs
|
||||
fixed other bugs introduced in 0.85 and 0.86
|
||||
added some minor documentation
|
||||
fixed medium model bugs
|
||||
fixed other bugs introduced in 0.85 and 0.86
|
||||
added some minor documentation
|
||||
version 0.88 [January, 1996]
|
||||
fixed progressive bugs
|
||||
replaced tabs with spaces
|
||||
cleaned up documentation
|
||||
added callbacks for read/write and warning/error functions
|
||||
fixed progressive bugs
|
||||
replaced tabs with spaces
|
||||
cleaned up documentation
|
||||
added callbacks for read/write and warning/error functions
|
||||
version 0.89 [July, 1996]
|
||||
added new initialization API to make libpng work better with shared libs
|
||||
we now have png_create_read_struct(), png_create_write_struct(),
|
||||
png_create_info_struct(), png_destroy_read_struct(), and
|
||||
png_destroy_write_struct() instead of the separate calls to
|
||||
malloc and png_read_init(), png_info_init(), and png_write_init()
|
||||
changed warning/error callback functions to fix bug - this means you
|
||||
should use the new initialization API if you were using the old
|
||||
png_set_message_fn() calls, and that the old API no longer exists
|
||||
so that people are aware that they need to change their code
|
||||
changed filter selection API to allow selection of multiple filters
|
||||
since it didn't work in previous versions of libpng anyways
|
||||
optimized filter selection code
|
||||
fixed png_set_background() to allow using an arbitrary RGB color for
|
||||
paletted images
|
||||
fixed gamma and background correction for paletted images, so
|
||||
png_correct_palette is not needed unless you are correcting an
|
||||
external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED
|
||||
in pngconf.h) - if nobody uses this, it may disappear in the future.
|
||||
fixed bug with Borland 64K memory allocation (Alexander Lehmann)
|
||||
fixed bug in interlace handling (Smarasderagd, I think)
|
||||
added more error checking for writing and image to reduce invalid files
|
||||
separated read and write functions so that they won't both be linked
|
||||
into a binary when only reading or writing functionality is used
|
||||
new pngtest image also has interlacing and zTXt
|
||||
updated documentation to reflect new API
|
||||
added new initialization API to make libpng work better with shared libs
|
||||
we now have png_create_read_struct(), png_create_write_struct(),
|
||||
png_create_info_struct(), png_destroy_read_struct(), and
|
||||
png_destroy_write_struct() instead of the separate calls to
|
||||
malloc and png_read_init(), png_info_init(), and png_write_init()
|
||||
changed warning/error callback functions to fix bug - this means you
|
||||
should use the new initialization API if you were using the old
|
||||
png_set_message_fn() calls, and that the old API no longer exists
|
||||
so that people are aware that they need to change their code
|
||||
changed filter selection API to allow selection of multiple filters
|
||||
since it didn't work in previous versions of libpng anyways
|
||||
optimized filter selection code
|
||||
fixed png_set_background() to allow using an arbitrary RGB color for
|
||||
paletted images
|
||||
fixed gamma and background correction for paletted images, so
|
||||
png_correct_palette is not needed unless you are correcting an
|
||||
external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED
|
||||
in pngconf.h) - if nobody uses this, it may disappear in the future.
|
||||
fixed bug with Borland 64K memory allocation (Alexander Lehmann)
|
||||
fixed bug in interlace handling (Smarasderagd, I think)
|
||||
added more error checking for writing and image to reduce invalid files
|
||||
separated read and write functions so that they won't both be linked
|
||||
into a binary when only reading or writing functionality is used
|
||||
new pngtest image also has interlacing and zTXt
|
||||
updated documentation to reflect new API
|
||||
version 0.90 [January, 1997]
|
||||
made CRC errors/warnings on critical and ancillary chunks configurable
|
||||
libpng will use the zlib CRC routines by (compile-time) default
|
||||
changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner)
|
||||
added external C++ wrapper statements to png.h (Gilles Dauphin)
|
||||
allow PNG file to be read when some or all of file signature has already
|
||||
been read from the beginning of the stream. ****This affects the size
|
||||
of info_struct and invalidates all programs that use a shared libpng****
|
||||
fixed png_filler() declarations
|
||||
fixed? background color conversions
|
||||
fixed order of error function pointers to match documentation
|
||||
current chunk name is now available in png_struct to reduce the number
|
||||
of nearly identical error messages (will simplify multi-lingual
|
||||
support when available)
|
||||
try to get ready for unknown-chunk callback functions:
|
||||
- previously read critical chunks are flagged, so the chunk handling
|
||||
routines can determine if the chunk is in the right place
|
||||
- all chunk handling routines have the same prototypes, so we will
|
||||
be able to handle all chunks via a callback mechanism
|
||||
try to fix Linux "setjmp" buffer size problems
|
||||
made CRC errors/warnings on critical and ancillary chunks configurable
|
||||
libpng will use the zlib CRC routines by (compile-time) default
|
||||
changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner)
|
||||
added external C++ wrapper statements to png.h (Gilles Dauphin)
|
||||
allow PNG file to be read when some or all of file signature has already
|
||||
been read from the beginning of the stream. ****This affects the size
|
||||
of info_struct and invalidates all programs that use a shared libpng****
|
||||
fixed png_filler() declarations
|
||||
fixed? background color conversions
|
||||
fixed order of error function pointers to match documentation
|
||||
current chunk name is now available in png_struct to reduce the number
|
||||
of nearly identical error messages (will simplify multi-lingual
|
||||
support when available)
|
||||
try to get ready for unknown-chunk callback functions:
|
||||
- previously read critical chunks are flagged, so the chunk handling
|
||||
routines can determine if the chunk is in the right place
|
||||
- all chunk handling routines have the same prototypes, so we will
|
||||
be able to handle all chunks via a callback mechanism
|
||||
try to fix Linux "setjmp" buffer size problems
|
||||
version 0.95 [March, 1997]
|
||||
fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never
|
||||
fixed bug in PNG file signature compares when start != 0
|
||||
changed parameter type of png_set_filler(...filler...) from png_byte
|
||||
to png_uint_32
|
||||
added test for MACOS to ensure that both math.h and fp.h are not #included
|
||||
added macros for libpng to be compiled as a Windows DLL (Andreas Kupries)
|
||||
added "packswap" transformation, which changes the endianness of
|
||||
packed-pixel bytes (Kevin Bracey)
|
||||
added "strip_alpha" transformation, which removes the alpha channel of
|
||||
input images without using it (not neccesarily a good idea)
|
||||
added "swap_alpha" transformation, which puts the alpha channel in front
|
||||
of the color bytes instead of after
|
||||
removed all implicit variable tests which assume NULL == 0 (I think)
|
||||
changed several variables to "png_size_t" to show 16/32-bit limitations
|
||||
added new pCAL chunk read/write support
|
||||
added experimental filter selection weighting (Greg Roelofs)
|
||||
removed old png_set_rgbx() and png_set_xrgb() functions that have been
|
||||
obsolete for about 2 years now (use png_set_filler() instead)
|
||||
added macros to read 16- and 32-bit ints directly from buffer, to be
|
||||
used only on those systems that support it (namely PowerPC and 680x0)
|
||||
With some testing, this may become the default for MACOS/PPC systems.
|
||||
only calculate CRC on data if we are going to use it
|
||||
added macros for zTXt compression type PNG_zTXt_COMPRESSION_???
|
||||
added macros for simple libpng debugging output selectable at compile time
|
||||
removed PNG_READ_END_MODE in progressive reader (Smarasderagd)
|
||||
more description of info_struct in libpng.txt and png.h
|
||||
more instructions in example.c
|
||||
more chunk types tested in pngtest.c
|
||||
renamed pngrcb.c to pngset.c, and all png_read_<chunk> functions to be
|
||||
png_set_<chunk>. We now have corresponding png_get_<chunk>
|
||||
functions in pngget.c to get infomation in info_ptr. This isolates
|
||||
the application from the internal organization of png_info_struct
|
||||
(good for shared library implementations).
|
||||
fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never
|
||||
fixed bug in PNG file signature compares when start != 0
|
||||
changed parameter type of png_set_filler(...filler...) from png_byte
|
||||
to png_uint_32
|
||||
added test for MACOS to ensure that both math.h and fp.h are not #included
|
||||
added macros for libpng to be compiled as a Windows DLL (Andreas Kupries)
|
||||
added "packswap" transformation, which changes the endianness of
|
||||
packed-pixel bytes (Kevin Bracey)
|
||||
added "strip_alpha" transformation, which removes the alpha channel of
|
||||
input images without using it (not neccesarily a good idea)
|
||||
added "swap_alpha" transformation, which puts the alpha channel in front
|
||||
of the color bytes instead of after
|
||||
removed all implicit variable tests which assume NULL == 0 (I think)
|
||||
changed several variables to "png_size_t" to show 16/32-bit limitations
|
||||
added new pCAL chunk read/write support
|
||||
added experimental filter selection weighting (Greg Roelofs)
|
||||
removed old png_set_rgbx() and png_set_xrgb() functions that have been
|
||||
obsolete for about 2 years now (use png_set_filler() instead)
|
||||
added macros to read 16- and 32-bit ints directly from buffer, to be
|
||||
used only on those systems that support it (namely PowerPC and 680x0)
|
||||
With some testing, this may become the default for MACOS/PPC systems.
|
||||
only calculate CRC on data if we are going to use it
|
||||
added macros for zTXt compression type PNG_zTXt_COMPRESSION_???
|
||||
added macros for simple libpng debugging output selectable at compile time
|
||||
removed PNG_READ_END_MODE in progressive reader (Smarasderagd)
|
||||
more description of info_struct in libpng.txt and png.h
|
||||
more instructions in example.c
|
||||
more chunk types tested in pngtest.c
|
||||
renamed pngrcb.c to pngset.c, and all png_read_<chunk> functions to be
|
||||
png_set_<chunk>. We now have corresponding png_get_<chunk>
|
||||
functions in pngget.c to get infomation in info_ptr. This isolates
|
||||
the application from the internal organization of png_info_struct
|
||||
(good for shared library implementations).
|
||||
version 0.96 [May, 1997]
|
||||
fixed serious bug with < 8bpp images introduced in 0.95
|
||||
fixed 256-color transparency bug (Greg Roelofs)
|
||||
fixed up documentation (Greg Roelofs, Laszlo Nyul)
|
||||
fixed "error" in pngconf.h for Linux setjmp() behaviour
|
||||
fixed DOS medium model support (Tim Wegner)
|
||||
fixed png_check_keyword() for case with error in static string text
|
||||
added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul)
|
||||
added typecasts to quiet compiler errors
|
||||
added more debugging info
|
||||
fixed serious bug with < 8bpp images introduced in 0.95
|
||||
fixed 256-color transparency bug (Greg Roelofs)
|
||||
fixed up documentation (Greg Roelofs, Laszlo Nyul)
|
||||
fixed "error" in pngconf.h for Linux setjmp() behaviour
|
||||
fixed DOS medium model support (Tim Wegner)
|
||||
fixed png_check_keyword() for case with error in static string text
|
||||
added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul)
|
||||
added typecasts to quiet compiler errors
|
||||
added more debugging info
|
||||
version 0.97 [January, 1998]
|
||||
removed PNG_USE_OWN_CRC capability
|
||||
relocated png_set_crc_action from pngrutil.c to pngrtran.c
|
||||
fixed typecasts of "new_key", etc. (Andreas Dilger)
|
||||
added RFC 1152 [sic] date support
|
||||
fixed bug in gamma handling of 4-bit grayscale
|
||||
added 2-bit grayscale gamma handling (Glenn R-P)
|
||||
added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P)
|
||||
minor corrections in libpng.txt
|
||||
added simple sRGB support (Glenn R-P)
|
||||
easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
|
||||
all configurable options can be selected from command-line instead
|
||||
of having to edit pngconf.h (Glenn R-P)
|
||||
fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
|
||||
added more conditions for png_do_background, to avoid changing
|
||||
black pixels to background when a background is supplied and
|
||||
no pixels are transparent
|
||||
repaired PNG_NO_STDIO behaviour
|
||||
tested NODIV support and made it default behaviour (Greg Roelofs)
|
||||
added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler)
|
||||
regularized version numbering scheme and bumped shared-library major
|
||||
version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs)
|
||||
removed PNG_USE_OWN_CRC capability
|
||||
relocated png_set_crc_action from pngrutil.c to pngrtran.c
|
||||
fixed typecasts of "new_key", etc. (Andreas Dilger)
|
||||
added RFC 1152 [sic] date support
|
||||
fixed bug in gamma handling of 4-bit grayscale
|
||||
added 2-bit grayscale gamma handling (Glenn R-P)
|
||||
added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P)
|
||||
minor corrections in libpng.txt
|
||||
added simple sRGB support (Glenn R-P)
|
||||
easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
|
||||
all configurable options can be selected from command-line instead
|
||||
of having to edit pngconf.h (Glenn R-P)
|
||||
fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
|
||||
added more conditions for png_do_background, to avoid changing
|
||||
black pixels to background when a background is supplied and
|
||||
no pixels are transparent
|
||||
repaired PNG_NO_STDIO behaviour
|
||||
tested NODIV support and made it default behaviour (Greg Roelofs)
|
||||
added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler)
|
||||
regularized version numbering scheme and bumped shared-library major
|
||||
version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs)
|
||||
version 0.98 [January, 1998]
|
||||
cleaned up some typos in libpng.txt and in code documentation
|
||||
fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler)
|
||||
cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c
|
||||
changed recommendation about file_gamma for PC images to .51 from .45,
|
||||
in example.c and libpng.txt, added comments to distinguish between
|
||||
screen_gamma, viewing_gamma, and display_gamma.
|
||||
changed all references to RFC1152 to read RFC1123 and changed the
|
||||
PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED
|
||||
added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent)
|
||||
changed srgb_intent from png_byte to int to avoid compiler bugs
|
||||
cleaned up some typos in libpng.txt and in code documentation
|
||||
fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler)
|
||||
cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c
|
||||
changed recommendation about file_gamma for PC images to .51 from .45,
|
||||
in example.c and libpng.txt, added comments to distinguish between
|
||||
screen_gamma, viewing_gamma, and display_gamma.
|
||||
changed all references to RFC1152 to read RFC1123 and changed the
|
||||
PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED
|
||||
added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent)
|
||||
changed srgb_intent from png_byte to int to avoid compiler bugs
|
||||
version 0.99 [January 30, 1998]
|
||||
free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler)
|
||||
fixed a longstanding "packswap" bug in pngtrans.c
|
||||
fixed some inconsistencies in pngconf.h that prevented compiling with
|
||||
PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined
|
||||
fixed some typos and made other minor rearrangement of libpng.txt (Andreas)
|
||||
changed recommendation about file_gamma for PC images to .50 from .51 in
|
||||
example.c and libpng.txt, and changed file_gamma for sRGB images to .45
|
||||
added a number of functions to access information from the png structure
|
||||
png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit)
|
||||
added TARGET_MACOS similar to zlib-1.0.8
|
||||
define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined
|
||||
added type casting to all png_malloc() function calls
|
||||
free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler)
|
||||
fixed a longstanding "packswap" bug in pngtrans.c
|
||||
fixed some inconsistencies in pngconf.h that prevented compiling with
|
||||
PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined
|
||||
fixed some typos and made other minor rearrangement of libpng.txt (Andreas)
|
||||
changed recommendation about file_gamma for PC images to .50 from .51 in
|
||||
example.c and libpng.txt, and changed file_gamma for sRGB images to .45
|
||||
added a number of functions to access information from the png structure
|
||||
png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit)
|
||||
added TARGET_MACOS similar to zlib-1.0.8
|
||||
define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined
|
||||
added type casting to all png_malloc() function calls
|
||||
version 0.99a [January 31, 1998]
|
||||
Added type casts and parentheses to all returns that return a value.(Tim W.)
|
||||
Added type casts and parentheses to all returns that return a value.(Tim W.)
|
||||
version 0.99b [February 4, 1998]
|
||||
Added type cast png_uint_32 on malloc function calls where needed.
|
||||
Changed type of num_hist from png_uint_32 to int (same as num_palette).
|
||||
Added checks for rowbytes overflow, in case png_size_t is less than 32 bits.
|
||||
Renamed makefile.elf to makefile.lnx.
|
||||
Added type cast png_uint_32 on malloc function calls where needed.
|
||||
Changed type of num_hist from png_uint_32 to int (same as num_palette).
|
||||
Added checks for rowbytes overflow, in case png_size_t is less than 32 bits.
|
||||
Renamed makefile.elf to makefile.lnx.
|
||||
version 0.99c [February 7, 1998]
|
||||
More type casting. Removed erroneous overflow test in pngmem.c.
|
||||
Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes.
|
||||
Added UNIX manual pages libpng.3 (incorporating libpng.txt) and png.5.
|
||||
More type casting. Removed erroneous overflow test in pngmem.c.
|
||||
Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes.
|
||||
Added UNIX manual pages libpng.3 (incorporating libpng.txt) and png.5.
|
||||
version 0.99d [February 11, 1998]
|
||||
Renamed "far_to_near()" "png_far_to_near()"
|
||||
Revised libpng.3
|
||||
Version 99c "buffered" operations didn't work as intended. Replaced them
|
||||
with png_memcpy_check() and png_memset_check().
|
||||
Added many "if (png_ptr == NULL) return" to quell compiler warnings about
|
||||
unused png_ptr, mostly in pngget.c and pngset.c.
|
||||
Check for overlength tRNS chunk present when indexed-color PLTE is read.
|
||||
Cleaned up spelling errors in libpng.3/libpng.txt
|
||||
Corrected a problem with png_get_tRNS() which returned undefined trans array
|
||||
Renamed "far_to_near()" "png_far_to_near()"
|
||||
Revised libpng.3
|
||||
Version 99c "buffered" operations didn't work as intended. Replaced them
|
||||
with png_memcpy_check() and png_memset_check().
|
||||
Added many "if (png_ptr == NULL) return" to quell compiler warnings about
|
||||
unused png_ptr, mostly in pngget.c and pngset.c.
|
||||
Check for overlength tRNS chunk present when indexed-color PLTE is read.
|
||||
Cleaned up spelling errors in libpng.3/libpng.txt
|
||||
Corrected a problem with png_get_tRNS() which returned undefined trans array
|
||||
version 0.99e [February 28, 1998]
|
||||
Corrected png_get_tRNS() again.
|
||||
Add parentheses for easier reading of pngget.c, fixed "||" should be "&&".
|
||||
Touched up example.c to make more of it compileable, although the entire
|
||||
file still can't be compiled (Willem van Schaik)
|
||||
Fixed a bug in png_do_shift() (Bryan Tsai)
|
||||
Added a space in png.h prototype for png_write_chunk_start()
|
||||
Replaced pngtest.png with one created with zlib 1.1.1
|
||||
Changed pngtest to report PASS even when file size is different (Jean-loup G.)
|
||||
Corrected some logic errors in png_do_invert_alpha() (Chris Patterson)
|
||||
Corrected png_get_tRNS() again.
|
||||
Add parentheses for easier reading of pngget.c, fixed "||" should be "&&".
|
||||
Touched up example.c to make more of it compileable, although the entire
|
||||
file still can't be compiled (Willem van Schaik)
|
||||
Fixed a bug in png_do_shift() (Bryan Tsai)
|
||||
Added a space in png.h prototype for png_write_chunk_start()
|
||||
Replaced pngtest.png with one created with zlib 1.1.1
|
||||
Changed pngtest to report PASS even when file size is different (Jean-loup G.)
|
||||
Corrected some logic errors in png_do_invert_alpha() (Chris Patterson)
|
||||
version 0.99f [March 5, 1998]
|
||||
Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey)
|
||||
Moved makefiles into a "scripts" directory, and added INSTALL instruction file
|
||||
Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok)
|
||||
Added pointers to "note on libpng versions" in makefile.lnx and README
|
||||
Added row callback feature when reading and writing nonprogressive rows
|
||||
and added a test of this feature in pngtest.c
|
||||
Added user transform callbacks, with test of the feature in pngtest.c
|
||||
Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey)
|
||||
Moved makefiles into a "scripts" directory, and added INSTALL instruction file
|
||||
Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok)
|
||||
Added pointers to "note on libpng versions" in makefile.lnx and README
|
||||
Added row callback feature when reading and writing nonprogressive rows
|
||||
and added a test of this feature in pngtest.c
|
||||
Added user transform callbacks, with test of the feature in pngtest.c
|
||||
version 0.99g [March 6, 1998, morning]
|
||||
Minor changes to pngtest.c to suppress compiler warnings.
|
||||
Removed "beta" language from documentation.
|
||||
Minor changes to pngtest.c to suppress compiler warnings.
|
||||
Removed "beta" language from documentation.
|
||||
version 0.99h [March 6, 1998, evening]
|
||||
Minor changes to previous minor changes to pngtest.c
|
||||
Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED
|
||||
and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro
|
||||
Minor changes to previous minor changes to pngtest.c
|
||||
Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED
|
||||
and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro
|
||||
version 1.00 [March 7, 1998]
|
||||
Changed several typedefs in pngrutil.c
|
||||
Added makefile.wat (Pawel Mrochen), updated makefile.tc3 (Willem van Schaik)
|
||||
replaced "while(1)" with "for(;;)"
|
||||
added PNGARG() to prototypes in pngtest.c and removed some prototypes
|
||||
updated some of the makefiles (Tom Lane)
|
||||
changed some typedefs (s_start, etc.) in pngrutil.c
|
||||
fixed dimensions of "short_months" array in pngwrite.c
|
||||
Replaced ansi2knr.c with the one from jpeg-v6
|
||||
Changed several typedefs in pngrutil.c
|
||||
Added makefile.wat (Pawel Mrochen), updated makefile.tc3 (Willem van Schaik)
|
||||
replaced "while(1)" with "for(;;)"
|
||||
added PNGARG() to prototypes in pngtest.c and removed some prototypes
|
||||
updated some of the makefiles (Tom Lane)
|
||||
changed some typedefs (s_start, etc.) in pngrutil.c
|
||||
fixed dimensions of "short_months" array in pngwrite.c
|
||||
Replaced ansi2knr.c with the one from jpeg-v6
|
||||
version 1.0.0 [March 8, 1998]
|
||||
Changed name from 1.00 to 1.0.0 (Adam Costello)
|
||||
Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert)
|
||||
Changed name from 1.00 to 1.0.0 (Adam Costello)
|
||||
Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert)
|
||||
version 1.0.0a [March 9, 1998]
|
||||
Fixed three bugs in pngrtran.c to make gamma+background handling consistent
|
||||
(Greg Roelofs)
|
||||
Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz
|
||||
for major, minor, and bugfix releases. This is 10001. (Adam Costello,
|
||||
Tom Lane)
|
||||
Make months range from 1-12 in png_convert_to_rfc1123
|
||||
Fixed three bugs in pngrtran.c to make gamma+background handling consistent
|
||||
(Greg Roelofs)
|
||||
Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz
|
||||
for major, minor, and bugfix releases. This is 10001. (Adam Costello,
|
||||
Tom Lane)
|
||||
Make months range from 1-12 in png_convert_to_rfc1123
|
||||
version 1.0.0b [March 13, 1998]
|
||||
Quieted compiler complaints about two empty "for" loops in pngrutil.c
|
||||
Minor changes to makefile.s2x
|
||||
Removed #ifdef/#endif around a png_free() in pngread.c
|
||||
Quieted compiler complaints about two empty "for" loops in pngrutil.c
|
||||
Minor changes to makefile.s2x
|
||||
Removed #ifdef/#endif around a png_free() in pngread.c
|
||||
version 1.0.1 [March 14, 1998]
|
||||
Changes makefile.s2x to reduce security risk of using a relative pathname
|
||||
Fixed some typos in the documentation (Greg).
|
||||
Fixed a problem with value of "channels" returned by png_read_update_info()
|
||||
Changed makefile.s2x to reduce security risk of using a relative pathname
|
||||
Fixed some typos in the documentation (Greg).
|
||||
Fixed a problem with value of "channels" returned by png_read_update_info()
|
||||
version 1.0.1a [April 21, 1998]
|
||||
Optimized Paeth calculations by replacing abs() function calls with intrinsics
|
||||
plus other loop optimizations. Improves avg decoding speed by about 20%.
|
||||
Commented out i386istic "align" compiler flags in makefile.lnx.
|
||||
Reduced the default warning level in some makefiles, to make them consistent.
|
||||
Removed references to IJG and JPEG in the ansi2knr.c copyright statement.
|
||||
Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation.
|
||||
Added grayscale and 16-bit capability to png_do_read_filler().
|
||||
Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes
|
||||
too large when writing an image with bit_depth < 8 (Bob Dellaca).
|
||||
Corrected some bugs in the experimental weighted filtering heuristics.
|
||||
Moved a misplaced pngrutil code block that truncates tRNS if it has more
|
||||
than num_palette entries -- test was done before num_palette was defined.
|
||||
Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins).
|
||||
Changed compiler flags in makefile.wat for better optimization (Pawel Mrochen)
|
||||
|
4
INSTALL
4
INSTALL
@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.0.1 March 15, 1998
|
||||
Installing libpng version %VER% %DATE%
|
||||
|
||||
Before installing libpng, you must first install zlib. zlib
|
||||
can usually be found wherever you got libpng. zlib can be
|
||||
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
|
||||
version of zlib that's installed.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.0.1 or "lpng100" and "zlib-1.1.1"
|
||||
might be called "libpng-%VER% or "lpng100" and "zlib-1.1.1"
|
||||
or "zlib111") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
|
113
KNOWNBUG
Normal file
113
KNOWNBUG
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
Known bugs and suggested enhancements in libpng-1.0.1
|
||||
|
||||
1. March 13, 1998 -- BUG -- pngtrans.c:
|
||||
|
||||
row_info->channels should be updated --
|
||||
row_info->color_type should be updated --
|
||||
|
||||
STATUS: I think this is all fixed in libpng-1.0.1a but needs
|
||||
to be tested.
|
||||
|
||||
2. March 14, 1998 -- ENHANCEMENT -- Glenn
|
||||
|
||||
We should add the G>GA, G>GX, G>AG, and G>XG transformations
|
||||
in png_do_read_filler()
|
||||
|
||||
STATUS: Implemented in libpng-1.0.1a
|
||||
|
||||
3. March 14, 1998 -- BUG? -- Greg Roelofs
|
||||
|
||||
pngrtran.c: if-test for channels/FILLER may be incorrect
|
||||
|
||||
STATUS: Under investigation
|
||||
|
||||
4. March 15, 1998 -- BUG -- Kevin Bracey
|
||||
|
||||
pngwtran.c:
|
||||
line 306: loop should count to row_info->width, not to
|
||||
row_info->width*row_info->channnels
|
||||
|
||||
STATUS: Fixed in libpng-1.0.1a
|
||||
|
||||
5. March 15, 1998 -- OPTIMIZATION -- Kevin Bracey
|
||||
|
||||
Loops need to be optimized everywhere
|
||||
|
||||
a. Make them count down instead of up -- Kevin Bracey
|
||||
|
||||
Optimizing compilers don't need this, and making
|
||||
the change would be error prone -- Tom Lane, Glenn R-P
|
||||
|
||||
Question whether i-- or --i is better.
|
||||
|
||||
STATUS: Under investigation.
|
||||
|
||||
b. Remove products and structure members from loop tests -- Glenn R-P
|
||||
|
||||
Can be accomplished without messing with loop guts. This
|
||||
was shown to be effective on optimized SGI compiler:
|
||||
|
||||
replace
|
||||
png_uint_32 i;
|
||||
for(i=0; i < s->a*s->b; i++)
|
||||
with
|
||||
png_uint_32 i, count;
|
||||
istop = s->a*s->b;
|
||||
for(i=0; i<istop; i++)
|
||||
|
||||
STATUS: Mostly done in libpng-1.0.1a, done for all important loops.
|
||||
|
||||
c. Replace abs() with intrinsic ternary operations in Paeth
|
||||
filtering -- Glenn R-P
|
||||
|
||||
STATUS: Done in libpng-1.0.1a
|
||||
(can be restored to original behavior with #define PNG_USE_ABS)
|
||||
|
||||
d. In pngwutil.c, make separate simple loops to use when filter
|
||||
heuristic sums aren't needed. -- Glenn R-P
|
||||
|
||||
STATUS: Done in libpng-1.0.1a
|
||||
|
||||
6. April 6, 1998 -- BUG -- bug in pngset.c (rowbytes too large) -- Bob Dellaca
|
||||
|
||||
pngset.c has a bug, introduced in version 0.99c, that sets rowbytes
|
||||
too large when writing an image with bit_depth < 8
|
||||
|
||||
STATUS: Fixed in libpng-1.0.1a
|
||||
|
||||
7. April 10, 1998 -- BUG -- pngwutil weighted filtering bugs -- Glenn R-P
|
||||
|
||||
pngwutil.c has some bugs in the experimental weighted filter
|
||||
algorithm (PNG_FILTER_XXX should be PNG_FILTER_VALUE_XXX in
|
||||
several places)
|
||||
|
||||
STATUS: Andreas concurs. Fixed in libpng-1.0.1a
|
||||
|
||||
8. April 10, 1998 -- ENHANCEMENT -- run-time selection of malloc function
|
||||
-- Bob Dellaca
|
||||
|
||||
pngmem.c currently provides a compile-time option to replace
|
||||
png_malloc() and png_free(). It's been requested that these
|
||||
be made possible at run time, via calls to new png_set_malloc_fn()
|
||||
and png_set_free_fn() functions.
|
||||
|
||||
STATUS: Will do in libpng-1.0.1b
|
||||
|
||||
9. April 11, 1998 -- BUG -- incorrect truncation of tRNS data in
|
||||
illegal PNG file where tRNS precedes PLTE -- Larry Reeve
|
||||
|
||||
There is a misplaced pngrutil code block that truncates tRNS if it has
|
||||
more than num_palette entries -- test was done before num_palette was
|
||||
defined. Although the PNG file is illegal, it shouldn't crash apps.
|
||||
There is a simple fix; just moving the test to the point after
|
||||
num_palette has been defined.
|
||||
|
||||
STATUS: Fixed in libpng-1.0.1a
|
||||
|
||||
10. April 16, 1998 -- BUG -- incorrect operation of png_convert_to_rfc1123
|
||||
with 31st day of the month -- Steve Eddins
|
||||
|
||||
The "ptime->date % 31" is wrong, should be "ptime->date % 32".
|
||||
|
||||
STATUS: Fixed in libpng-1.0.1a
|
2
README
2
README
@ -1,4 +1,4 @@
|
||||
README for libpng 1.0.1 (shared library 2.1)
|
||||
README for libpng %VER% (shared library 2.1)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
1
TODO
1
TODO
@ -2,7 +2,6 @@ TODO - list of things to do for libpng
|
||||
|
||||
fix problem with C++ and EXTERN "C"
|
||||
add "grayscale->palette" transformation and "palette->grayscale" detection
|
||||
add "grayscale" -> "grayscale+alpha" and "grayscale+FILLER" transformations
|
||||
improved dithering
|
||||
multi-lingual error and warning message support
|
||||
sPLT chunk handling
|
||||
|
12
ansi2knr.c
12
ansi2knr.c
@ -1,7 +1,9 @@
|
||||
/* ansi2knr.c */
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax
|
||||
Copyright (C) 1989 Aladdin Enterprises. All rights reserved.
|
||||
Copyright (C) 1988 Richard M. Stallman
|
||||
|
||||
ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY. No author or distributor accepts responsibility to anyone for the
|
||||
consequences of using it or for whether it serves any particular purpose or
|
||||
@ -12,12 +14,12 @@ Everyone is granted permission to copy, modify and redistribute ansi2knr,
|
||||
but only under the conditions described in the GPL. A copy of this license
|
||||
is supposed to have been given to you along with ansi2knr so you can know
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT.
|
||||
[In the IJG distribution, the GPL appears below, not in a separate file.]
|
||||
[In the LIBPNG distribution, the GPL appears below, not in a separate file.]
|
||||
Among other things, the copyright notice and this notice must be preserved
|
||||
on all copies.
|
||||
|
||||
We explicitly state here what we believe is already implied by the GPL: if
|
||||
the ansi2knr program is distributed as a separate set of sources and a
|
||||
the ansi2knr program is distributed as a separate source file and a
|
||||
separate executable file which are aggregated on a storage medium together
|
||||
with another program, this in itself does not bring the other program under
|
||||
the GPL, nor does the mere fact that such a program or the procedures for
|
||||
@ -27,7 +29,7 @@ program under the GPL.
|
||||
|
||||
/*
|
||||
---------- Here is the GNU GPL file COPYLEFT, referred to above ----------
|
||||
----- These terms do NOT apply to the JPEG software itself; see README ------
|
||||
----- These terms do NOT apply to the LIBPNG software itself; see README ------
|
||||
|
||||
GHOSTSCRIPT GENERAL PUBLIC LICENSE
|
||||
(Clarified 11 Feb 1988)
|
||||
|
34
libpng.3
34
libpng.3
@ -1,4 +1,4 @@
|
||||
.TH LIBPNG 3 "March 15, 1998"
|
||||
.TH LIBPNG 3 "April 21, 1998"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library
|
||||
.SH SYNOPSIS
|
||||
@ -396,7 +396,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.1 March 15, 1998
|
||||
libpng version 1.0.1a April 21, 1998
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alumni.rpi.edu>
|
||||
Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
@ -872,11 +872,14 @@ unless the library has been told to transform it into another format.
|
||||
For example, 4 bit/pixel paletted or grayscale data will be returned
|
||||
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
||||
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
||||
in RGBRGBRGB format unless png_set_filler() is called to insert filler
|
||||
in RGB RGB RGB format unless png_set_filler() is called to insert filler
|
||||
bytes, either before or after each RGB triplet. 16-bit RGB data will
|
||||
be returned RRGGBBRRGGBB, with the most significant byte of the color
|
||||
be returned RRGGBB RRGGBB, with the most significant byte of the color
|
||||
value first, unless png_set_strip_16() is called to transform it to
|
||||
regular RGBRGB triplets.
|
||||
regular RGB RGB triplets, or png_set_filler() is called to insert
|
||||
filler bytes, either before or after each RRGGBB triplet. Similarly,
|
||||
8-bit or 16-bit grayscale data can be modified with png_set_filler()
|
||||
or png_set_strip_16().
|
||||
|
||||
The following code transforms grayscale images of less than 8 to 8 bits,
|
||||
changes paletted images to RGB, and adds a full alpha channel if there is
|
||||
@ -952,7 +955,7 @@ into 4 bytes for windowing systems that need them in this format:
|
||||
PNG_COLOR_TYPE_RGB) png_set_filler(png_ptr,
|
||||
filler, PNG_FILLER_BEFORE);
|
||||
|
||||
where "filler" is the number to fill with, and the location is
|
||||
where "filler" is the 8 or 16-bit number to fill with, and the location is
|
||||
either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether
|
||||
you want the filler before the RGB or after. This transformation
|
||||
does not affect images that already have full alpha channels.
|
||||
@ -1412,6 +1415,8 @@ png_infop info_ptr;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
.SH IV. Writing
|
||||
|
||||
Much of this is very similar to reading. However, everything of
|
||||
@ -1504,9 +1509,9 @@ not calling this function at all, as it has been tuned to deliver a good
|
||||
speed/compression ratio. The second parameter to png_set_filter() is
|
||||
the filter method, for which the only valid value is '0' (as of the
|
||||
October 1996 PNG specification, version 1.0). The third parameter is a
|
||||
flag that indicates
|
||||
which filter type(s) are to be tested for each scanline. See the
|
||||
Compression Library for details on the specific filter types.
|
||||
flag that indicates which filter type(s) are to be tested for each
|
||||
scanline. See the Compression Library for details on the specific filter
|
||||
types.
|
||||
|
||||
|
||||
/* turn on or off filtering, and/or choose
|
||||
@ -1780,8 +1785,9 @@ checks to see if it has data that it can do something with, you should
|
||||
make sure to only enable a transformation if it will be valid for the
|
||||
data. For example, don't swap red and blue on grayscale data.
|
||||
|
||||
PNG files store RGB pixels packed into 3 bytes. This code tells
|
||||
the library to expect input data with 4 bytes per pixel
|
||||
PNG files store RGB pixels packed into 3 or 6 bytes. This code tells
|
||||
the library to expand the input data to 4 or 8 bytes per pixel
|
||||
(or expand 1 or 2-byte grayscale data to 2 or 4 bytes per pixel).
|
||||
|
||||
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
|
||||
|
||||
@ -1899,11 +1905,11 @@ times, or any of that other stuff necessary with png_write_rows().
|
||||
|
||||
where row_pointers is:
|
||||
|
||||
png_bytef *row_pointers[height];
|
||||
png_byte *row_pointers[height];
|
||||
|
||||
You can point to void or char or whatever you use for pixels.
|
||||
|
||||
If you can't want to write the whole image at once, you can
|
||||
If you don't want to write the whole image at once, you can
|
||||
use png_write_rows() instead. If the file is not interlaced,
|
||||
this is simple:
|
||||
|
||||
@ -2366,7 +2372,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.0.1 March 15, 1998:
|
||||
Libpng version 1.0.1a April 21, 1998:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (randeg@alumni.rpi.edu).
|
||||
|
||||
|
31
libpng.txt
31
libpng.txt
@ -1,6 +1,6 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.1 March 15, 1998
|
||||
libpng version 1.0.1a April 21, 1998
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alumni.rpi.edu>
|
||||
Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
@ -22,7 +22,7 @@ libpng.txt - A description on how to use and modify libpng
|
||||
Copyright (c) 1995 Frank J. T. Wojcik
|
||||
December 18, 1995 && January 20, 1996
|
||||
|
||||
Introduction
|
||||
I. Introduction
|
||||
|
||||
This file describes how to use and modify the PNG reference library
|
||||
(known as libpng) for your own use. There are five sections to this
|
||||
@ -476,11 +476,14 @@ unless the library has been told to transform it into another format.
|
||||
For example, 4 bit/pixel paletted or grayscale data will be returned
|
||||
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
||||
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
||||
in RGBRGBRGB format unless png_set_filler() is called to insert filler
|
||||
in RGB RGB RGB format unless png_set_filler() is called to insert filler
|
||||
bytes, either before or after each RGB triplet. 16-bit RGB data will
|
||||
be returned RRGGBBRRGGBB, with the most significant byte of the color
|
||||
be returned RRGGBB RRGGBB, with the most significant byte of the color
|
||||
value first, unless png_set_strip_16() is called to transform it to
|
||||
regular RGBRGB triplets.
|
||||
regular RGB RGB triplets, or png_set_filler() is called to insert
|
||||
filler bytes, either before or after each RRGGBB triplet. Similarly,
|
||||
8-bit or 16-bit grayscale data can be modified with png_set_filler()
|
||||
or png_set_strip_16().
|
||||
|
||||
The following code transforms grayscale images of less than 8 to 8 bits,
|
||||
changes paletted images to RGB, and adds a full alpha channel if there is
|
||||
@ -556,7 +559,7 @@ into 4 bytes for windowing systems that need them in this format:
|
||||
PNG_COLOR_TYPE_RGB) png_set_filler(png_ptr,
|
||||
filler, PNG_FILLER_BEFORE);
|
||||
|
||||
where "filler" is the number to fill with, and the location is
|
||||
where "filler" is the 8 or 16-bit number to fill with, and the location is
|
||||
either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether
|
||||
you want the filler before the RGB or after. This transformation
|
||||
does not affect images that already have full alpha channels.
|
||||
@ -1110,9 +1113,9 @@ not calling this function at all, as it has been tuned to deliver a good
|
||||
speed/compression ratio. The second parameter to png_set_filter() is
|
||||
the filter method, for which the only valid value is '0' (as of the
|
||||
October 1996 PNG specification, version 1.0). The third parameter is a
|
||||
flag that indicates
|
||||
which filter type(s) are to be tested for each scanline. See the
|
||||
Compression Library for details on the specific filter types.
|
||||
flag that indicates which filter type(s) are to be tested for each
|
||||
scanline. See the Compression Library for details on the specific filter
|
||||
types.
|
||||
|
||||
|
||||
/* turn on or off filtering, and/or choose
|
||||
@ -1386,8 +1389,9 @@ checks to see if it has data that it can do something with, you should
|
||||
make sure to only enable a transformation if it will be valid for the
|
||||
data. For example, don't swap red and blue on grayscale data.
|
||||
|
||||
PNG files store RGB pixels packed into 3 bytes. This code tells
|
||||
the library to expect input data with 4 bytes per pixel
|
||||
PNG files store RGB pixels packed into 3 or 6 bytes. This code tells
|
||||
the library to expand the input data to 4 or 8 bytes per pixel
|
||||
(or expand 1 or 2-byte grayscale data to 2 or 4 bytes per pixel).
|
||||
|
||||
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
|
||||
|
||||
@ -1505,11 +1509,11 @@ times, or any of that other stuff necessary with png_write_rows().
|
||||
|
||||
where row_pointers is:
|
||||
|
||||
png_bytef *row_pointers[height];
|
||||
png_byte *row_pointers[height];
|
||||
|
||||
You can point to void or char or whatever you use for pixels.
|
||||
|
||||
If you can't want to write the whole image at once, you can
|
||||
If you don't want to write the whole image at once, you can
|
||||
use png_write_rows() instead. If the file is not interlaced,
|
||||
this is simple:
|
||||
|
||||
@ -1886,4 +1890,3 @@ to set the error callbacks AFTER png_read_init(), or to change them with
|
||||
png_set_error_fn(), which is essentially the same function, but with a
|
||||
new name to force compilation errors with applications that try to use
|
||||
the old method.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH LIBPNGPF 3 "March 15, 1998"
|
||||
.TH LIBPNGPF 3 "April 21, 1998"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library
|
||||
(private functions)
|
||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "March 15, 1998"
|
||||
.TH PNG 5 "April 21, 1998"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
6
png.c
6
png.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
@ -16,7 +16,7 @@
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h.
|
||||
*/
|
||||
char png_libpng_ver[12] = "1.0.1";
|
||||
char png_libpng_ver[12] = "1.0.1a";
|
||||
|
||||
/* Place to hold the signature string for a PNG file. */
|
||||
png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
|
18
png.h
18
png.h
@ -1,12 +1,12 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see the COPYRIGHT NOTICE below.
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998 Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
*
|
||||
@ -31,6 +31,7 @@
|
||||
* 1.00 1.00 100 2.1.0 [int should be 10000]
|
||||
* 1.0.0 1.0.0 100 2.1.0 [int should be 10000]
|
||||
* 1.0.1 1.0.1 10001 2.1.0
|
||||
* 1.0.1a 1.0.1a 10002 2.1.0
|
||||
*
|
||||
* Henceforth the source version will match the shared-library minor
|
||||
* and patch numbers; the shared-library major version number will be
|
||||
@ -38,10 +39,9 @@
|
||||
* The PNG_PNGLIB_VER macro, which is not used within libpng but
|
||||
* is available for applications, is an unsigned integer of the form
|
||||
* xyyzz corresponding to the source version x.y.z (leading zeros in y and z).
|
||||
*
|
||||
*
|
||||
* See libpng.txt for more information. The PNG specification is available
|
||||
* as RFC 2083 <ftp://ftp.uu.net/graphics/png/documents/>
|
||||
* See libpng.txt or libpng.3 for more information. The PNG specification is
|
||||
* available as RFC 2083 <ftp://ftp.uu.net/graphics/png/documents/>
|
||||
* and as a W3C Recommendation <http://www.w3.org/TR/REC.png.html>
|
||||
*
|
||||
* Contributing Authors:
|
||||
@ -118,14 +118,14 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.1"
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.1a"
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
* 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=bugfix */
|
||||
#define PNG_LIBPNG_VER 10001 /* 1.0.1 */
|
||||
#define PNG_LIBPNG_VER 10002 /* 1.0.2 */
|
||||
|
||||
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
|
||||
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
|
||||
@ -589,7 +589,7 @@ struct png_struct_def
|
||||
png_byte sig_bytes; /* magic bytes read/written from start of file */
|
||||
|
||||
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
|
||||
png_byte filler; /* filler byte for 24->32-bit pixel expansion */
|
||||
png_uint_16 filler; /* filler bytes for pixel expansion */
|
||||
#endif /* PNG_READ_FILLER_SUPPORTED */
|
||||
#if defined(PNG_READ_bKGD_SUPPORTED)
|
||||
png_byte background_gamma_type;
|
||||
@ -1590,7 +1590,7 @@ PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf));
|
||||
#endif /* PNG_READ_pCAL_SUPPORTED */
|
||||
PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf));
|
||||
PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
|
||||
#endif /* PNG_BIG_ENDIAN_GET_SUPPORTED */
|
||||
#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */
|
||||
|
||||
/* Initialize png_ptr struct for reading, and allocate any other memory.
|
||||
* (old interface - NOT DLL EXPORTED).
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*/
|
||||
|
||||
/* Any machine specific code is near the front of this file, so if you
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* This file provides a location for all error handling. Users which
|
||||
* need special error handling are expected to write replacement functions
|
||||
|
4
pngget.c
4
pngget.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
|
6
pngmem.c
6
pngmem.c
@ -1,14 +1,14 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* This file provides a location for all memory allocation. Users which
|
||||
* This file provides a location for all memory allocation. Users who
|
||||
* need special memory handling are expected to modify the code in this file
|
||||
* to meet their needs. See the instructions at each function.
|
||||
*/
|
||||
|
10
pngpread.c
10
pngpread.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
@ -446,13 +446,13 @@ png_push_save_buffer(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
|
||||
{
|
||||
png_size_t i;
|
||||
png_size_t i,istop;
|
||||
png_bytep sp;
|
||||
png_bytep dp;
|
||||
|
||||
istop = png_ptr->save_buffer_size;
|
||||
for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer;
|
||||
i < png_ptr->save_buffer_size;
|
||||
i++, sp++, dp++)
|
||||
i < istop; i++, sp++, dp++)
|
||||
{
|
||||
*dp = *sp;
|
||||
}
|
||||
|
28
pngread.c
28
pngread.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* This file contains routines that an application calls directly to
|
||||
* read a PNG file or stream.
|
||||
@ -125,7 +125,7 @@ png_read_init(png_structp png_ptr)
|
||||
/* Read the information before the actual image data. This has been
|
||||
* changed in v0.90 to allow reading a file that already has the magic
|
||||
* bytes read from the stream. You can tell libpng how many bytes have
|
||||
* been read from the beginning of the stream (up to the maxumum of 8)
|
||||
* been read from the beginning of the stream (up to the maximum of 8)
|
||||
* via png_set_sig_bytes(), and we will only check the remaining bytes
|
||||
* here. The application can then have access to the signature bytes we
|
||||
* read if it is determined that this isn't a valid PNG file.
|
||||
@ -522,7 +522,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
void
|
||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
{
|
||||
png_uint_32 i;
|
||||
png_uint_32 i,image_height;
|
||||
int pass, j;
|
||||
png_bytepp rp;
|
||||
|
||||
@ -530,12 +530,13 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
/* save jump buffer and error functions */
|
||||
pass = png_set_interlace_handling(png_ptr);
|
||||
|
||||
png_ptr->num_rows = png_ptr->height; /* Make sure this is set correctly */
|
||||
image_height=png_ptr->height;
|
||||
png_ptr->num_rows = image_height; /* Make sure this is set correctly */
|
||||
|
||||
for (j = 0; j < pass; j++)
|
||||
{
|
||||
rp = image;
|
||||
for (i = 0; i < png_ptr->height; i++)
|
||||
for (i = 0; i < image_height; i++)
|
||||
{
|
||||
png_read_row(png_ptr, *rp, NULL);
|
||||
rp++;
|
||||
@ -728,8 +729,9 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
#if defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
if (png_ptr->gamma_16_table != NULL)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (1 << (8 - png_ptr->gamma_shift)); i++)
|
||||
int i,istop;
|
||||
istop = (1 << (8 - png_ptr->gamma_shift));
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->gamma_16_table[i]);
|
||||
}
|
||||
@ -739,8 +741,9 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
png_free(png_ptr, png_ptr->gamma_16_table);
|
||||
if (png_ptr->gamma_16_from_1 != NULL)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (1 << (8 - png_ptr->gamma_shift)); i++)
|
||||
int i,istop;
|
||||
istop = (1 << (8 - png_ptr->gamma_shift));
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->gamma_16_from_1[i]);
|
||||
}
|
||||
@ -748,8 +751,9 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
png_free(png_ptr, png_ptr->gamma_16_from_1);
|
||||
if (png_ptr->gamma_16_to_1 != NULL)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (1 << (8 - png_ptr->gamma_shift)); i++)
|
||||
int i,istop;
|
||||
istop = (1 << (8 - png_ptr->gamma_shift));
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->gamma_16_to_1[i]);
|
||||
}
|
||||
|
4
pngrio.c
4
pngrio.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* This file provides a location for all input. Users which need
|
||||
* special handling are expected to write a function which has the same
|
||||
|
579
pngrtran.c
579
pngrtran.c
File diff suppressed because it is too large
Load Diff
263
pngrutil.c
263
pngrutil.c
@ -1,12 +1,12 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* libpng 1.0.1
|
||||
* libpng 1.0.1a
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
* March 15, 1998
|
||||
* April 21, 1998
|
||||
*
|
||||
* This file contains routines which are only called from within
|
||||
* libpng itself during the course of reading an image.
|
||||
@ -76,9 +76,10 @@ png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
|
||||
int
|
||||
png_crc_finish(png_structp png_ptr, png_uint_32 skip)
|
||||
{
|
||||
png_uint_32 i;
|
||||
png_uint_32 i,istop;
|
||||
|
||||
for (i = skip; i > (png_uint_32)png_ptr->zbuf_size; i -= png_ptr->zbuf_size)
|
||||
istop = (png_uint_32)png_ptr->zbuf_size;
|
||||
for (i = skip; i > istop; i -= istop)
|
||||
{
|
||||
png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
|
||||
}
|
||||
@ -258,20 +259,6 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_ptr->mode |= PNG_HAVE_PLTE;
|
||||
|
||||
#if defined (PNG_READ_tRNS_SUPPORTED)
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (info_ptr != NULL && info_ptr->valid & PNG_INFO_tRNS)
|
||||
{
|
||||
if (png_ptr->num_trans > png_ptr->num_palette)
|
||||
{
|
||||
png_warning(png_ptr, "Truncating incorrect tRNS chunk length");
|
||||
png_ptr->num_trans = png_ptr->num_palette;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(PNG_READ_OPT_PLTE_SUPPORTED)
|
||||
if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
@ -349,6 +336,21 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->palette = palette;
|
||||
png_ptr->num_palette = (png_uint_16)num;
|
||||
png_set_PLTE(png_ptr, info_ptr, palette, num);
|
||||
|
||||
#if defined (PNG_READ_tRNS_SUPPORTED)
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (info_ptr != NULL && info_ptr->valid & PNG_INFO_tRNS)
|
||||
{
|
||||
if (png_ptr->num_trans > png_ptr->num_palette)
|
||||
{
|
||||
png_warning(png_ptr, "Truncating incorrect tRNS chunk length");
|
||||
png_ptr->num_trans = png_ptr->num_palette;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@ -758,6 +760,12 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (length == 0)
|
||||
{
|
||||
png_warning(png_ptr, "Zero length tRNS chunk");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
|
||||
png_ptr->trans = (png_bytep)png_malloc(png_ptr, length);
|
||||
png_ptr->flags |= PNG_FLAG_FREE_TRANS;
|
||||
@ -1075,7 +1083,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
purpose[slength] = 0x00; /* null terminate the last string */
|
||||
|
||||
png_debug(3, "Finding end of pCAL purpose string\n");
|
||||
for (buf = purpose; *buf != '\0'; buf++)
|
||||
for (buf = purpose; *buf; buf++)
|
||||
/* empty loop */ ;
|
||||
|
||||
endptr = purpose + slength;
|
||||
@ -1113,7 +1121,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
|
||||
}
|
||||
|
||||
for (buf = units; *buf != 0x00; buf++)
|
||||
for (buf = units; *buf; buf++)
|
||||
/* Empty loop to move past the units string. */ ;
|
||||
|
||||
png_debug(3, "Allocating pCAL parameters array\n");
|
||||
@ -1497,7 +1505,7 @@ png_combine_row(png_structp png_ptr, png_bytep row,
|
||||
int s_inc, s_start, s_end;
|
||||
int m;
|
||||
int shift;
|
||||
png_uint_32 i;
|
||||
png_uint_32 i, istop;
|
||||