Commit Graph

480 Commits

Author SHA1 Message Date
John Bowler
ed3ca0e3eb [libpng16] Fixed the simplified API example programs and improved the error
message if the version field is not set.
2012-08-31 17:32:36 -05:00
John Bowler
4a6c6df6c7 [libpng16] Allow fine grain control of unknown chunk APIs. This change allows
png_set_keep_unknown_chunks() to be turned off if not required and causes
both read and write to behave appropriately (on read this is only possible
if the user callback is used to handle unknown chunks).  The change
also removes the support for storing unknown chunks in the info_struct
if the only unknown handling enabled is via the callback, allowing libpng
to be configured with callback reading and none of the unnecessary code.
2012-08-16 16:12:13 -05:00
Glenn Randers-Pehrson
025d415838 [libpng16] Folded long lines and fixed some grammar. 2012-08-16 00:51:44 -05:00
Glenn Randers-Pehrson
810c99583b [libpng16] Fixed some spelling errors. 2012-08-15 23:20:47 -05:00
John Bowler
e9567514dd [libpng16] Unknown handling fixes and clean up. This adds more correct option
control of the unknown handling, corrects the pre-existing bug where
the per-chunk 'keep' setting is ignored and makes it possible to skip
IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
There is a new test program, test-unknown.c, which is a work in progress
(not currently part of the test suite).  Comments in the header files now
explain how the unknown handling works.
2012-08-15 22:53:00 -05:00
Glenn Randers-Pehrson
dbb7e19fda [libpng16] Consistently use memset(), memcpy(), and memcmp() instead of the
png_memset(), png_memcpy(), and png_memcmp() macros.
2012-08-10 17:27:42 -05:00
Glenn Randers-Pehrson
26849f4693 [libpng16] Consistently use png_memset(), png_memcpy(), and png_memcmp(),
except in pngtest.c and example.c where these macros are not visible.
2012-08-10 16:01:45 -05:00
John Bowler
134c5761fa [libpng16] Fix new leak when text compression is disabled. 2012-08-10 10:49:21 -05:00
Glenn Randers-Pehrson
4430b91363 [libpng16] Restore info_ptr members that were deleted by the previous
patch; they are needed by png_set_IHDR() for both read and write.  Fix
some ifdefs that caused the contrib/pngminim/ applications to not compile.
2012-08-09 22:24:04 -05:00
Glenn Randers-Pehrson
432c174b64 [libpng16] Eliminated use of png_sizeof(); use sizeof() instead, and use.
a consistent style for (sizeof type) and (sizeof (array))
2012-08-09 20:14:48 -05:00
Glenn Randers-Pehrson
14ca47b453 [libpng16] Improved performance of new do_check_palette_indexes() function
(only update the value when it actually increases, move test for whether
the check is wanted out of the function.
2012-06-06 13:30:30 -05:00
John Bowler
921648a997 [libpng16] Recognize known sRGB ICC profiles while reading; prefer writing the
iCCP profile over writing the sRGB chunk, controlled by the
    PNG_sRGB_PROFILE_CHECKS option.
2012-03-28 23:36:12 -05:00
John Bowler
b11b31aea2 [libpng16] Changed chunk handler warnings into benign errors, incrementally
load iCCP
2012-03-21 07:55:46 -05:00
Glenn Randers-Pehrson
42ed02ed9a [libpng16] Reverted png_set_itxt(); it would not compile without warnings. 2012-03-16 23:17:27 -05:00
Glenn Randers-Pehrson
31d66245ea [libpng16] Added png_set_itxt() (work in progress) 2012-03-16 13:53:25 -05:00
John Bowler
aa816c4444 [libpng16] Added configuration support for benign errors and changed the read
default. Also changed some warnings in the iCCP and sRGB handling
from to benign errors. Configuration now makes read benign
errors warnings and write benign errors to errors by default (thus
changing the behavior on read).  The simplified API always forces
read benign errors to errors (regardless of the system default, unless
this is disabled in which case the simplified API can't be built.)
2012-03-16 07:39:49 -05:00
Glenn Randers-Pehrson
945cb1f9be [libpng16] Issue a png_benign_error() instead of png_warning() about bad
palette index.
2012-03-10 08:48:04 -06:00
John Bowler
b5d0051dcb [libpng16] Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c.  A new shared keyword check routine was also added
and the 'zbuf' is no longer allocated on progressive read.  It is now
possible to call png_inflate() incrementally.
2012-03-09 09:15:18 -06:00
John Bowler
42a2b556e9 [libpng16] Made read 'inflate' handling like write 'deflate' handling. The
read code now claims and releases png_ptr->zstream, like the write code.
The bug whereby the progressive reader failed to release the zstream
is now fixed, all initialization is delayed, and the code checks for
changed parameters on deflate rather than always calling
deflatedEnd/deflateInit.
2012-03-05 20:57:40 -06:00
Glenn Randers-Pehrson
eeb1bb678d [libng16] Added palette-index checking while writing.
Relocated palette-index checking function from pngrutil.c to pngtrans.c
2012-03-02 22:10:15 -06:00
John Bowler
6f237b6bf0 [libpng16] Remove whitespace at end of lines 2012-03-02 13:20:52 -06:00
John Bowler
cf49919686 [libpng16] Fixed some bugs in ICC profile writing. The code should now accept
all potentially valid ICC profiles and reject obviously invalid ones.
It now uses png_error() to do so rather than casually writing a PNG
without the necessary color data.
2012-03-01 21:54:07 -06:00
Glenn Randers-Pehrson
363ae65e2b [libpng16] Added tests for invalid palette index while reading and writing
(work in progress, the latter isn't finished).
2012-03-01 21:39:29 -06:00
John Bowler
dee7577330 [libpng16] Added PNG_IMAGE_FLAG_FAST for the benefit of applications that
store intermediate files, or intermediate in-memory data, while processing
image data with the simplified API.  The option makes the files larger
but faster to write and read.  pngstest now uses this by default; this
can be disabled with the --slow option.
2012-03-01 18:55:54 -06:00
John Bowler
1c25b9b06b [libpng16] Fixed transparent pixel and 16-bit rgb tests in pngstest and removed
a spurious check in pngwrite.c
2012-02-29 10:49:28 -06:00
John Bowler
5bc90389bf [libpng16] Added color-map support to simplified API.
This is an initial version for review; the documentation has not yet been
updated.
2012-01-23 22:43:22 -06:00
John Bowler
04336ba10f [libpng16] Add palette support to the simplified APIs. This commit
changes some of the macro definitions in png.h, app code may need
corresponding changes.
2012-01-16 07:48:36 -06:00
Glenn Randers-Pehrson
1531bd61a0 [libpng16] Updated copyright year to 2012 2012-01-01 14:45:04 -06:00
John Bowler
5d56786eff [libpng16] Implemented 'restrict' for png_info and png_struct.
Added new "png_structrp" typedef. Because of the
way libpng works both png_info and png_struct are always accessed via a
single pointer.  This means adding C99 'restrict' to the pointer gives
the compiler some opportunity to optimize the code.  This change allows that.
2011-12-24 09:12:00 -06:00
John Bowler
d332c67da7 [libpng16] Start-up code size improvements, error handler flexibility.
These changes alter how the tricky allocation of the initial png_struct and
png_info structures are handled. png_info is now handled in pretty much the
same way as everything else, except that the allocations handle NULL return
silently.  png_struct is changed in a similar way on allocation and on
deallocation a 'safety' error handler is put in place (which should never
be required).  The error handler itself is changed to permit mismatches
in the application and libpng error buffer size; however, this means a
silent change to the API to return the jmp_buf if the size doesn't match
the size from the libpng compilation; libpng now allocates the memory and
this may fail.  Overall these changes result in slight code size
reductions; however, this is a reduction in code that is always executed
so is particularly valuable.  Overall on a 64-bit system the libpng DLL
decreases in code size by 1733 bytes.  pngerror.o increases in size by
about 465 bytes because of the new functionality.
2011-12-21 17:36:12 -06:00
Glenn Randers-Pehrson
13831bc06e [libpng16] Updated "last changed" dates 2011-12-21 08:28:28 -06:00
John Bowler
baeb6d1e92 [libpng16] Added ANSI-C (C90) headers; eliminated the use of FAR/far. 2011-11-26 18:21:02 -06:00
John Bowler
3706d730d1 [libpng15] Allow row_stride==0 to indicate default stride in simplified API 2011-11-21 10:28:06 -06:00
John Bowler
4fa96a42f7 [libpng15] Fixes for C++ compilation using g++ When libpng source is compiled
using g++. The compiler imposes C++ rules on the C source; thus it
    is desireable to make the source work with either C or C++ rules
    without throwing away useful error information.  This change adds
    png_voidcast to allow C semantic (void*) cases or the corresponding
    C++ static_cast operation, as appropriate.
2011-11-16 16:39:16 -06:00
John Bowler
18c5cfafeb [libpng15] Multiple transform bug fixes plus a work-round for double gamma
correction.
2011-11-16 14:26:34 -06:00
John Bowler
89c2f84287 [libpng15] Fix Windows builds, add pngstest to Visual Studio and OpenWatcom 2011-11-16 12:04:39 -06:00
Glenn Randers-Pehrson
4be12aa1e3 [libpng15] Updated commentary 2011-11-10 06:35:48 -06:00
John Bowler
e6fb691c49 [libpng15] Fixes to alpha swap on read, simplified write and filler add code 2011-11-08 21:35:16 -06:00
John Bowler
dd81915d5b [libpng15] Corrections to the PNG_FORMAT_ values and code cleanup. 2011-11-08 14:29:45 -06:00
John Bowler
3615d03e05 [libpng15] Fix PNG_SIMPLIFIED transformations,
adding alpha and reducing to 8-bit
2011-11-08 10:38:09 -06:00
Glenn Randers-Pehrson
efc4b69767 [libpng15] Fixed some typos in comments. 2011-11-07 23:31:34 -06:00
John Bowler
7875d534cb [libpng15] Simplified read/write API initial version; basic read/write tested
on a variety of images, limited documentation (in the header file.)
2011-11-07 22:33:49 -06:00
Glenn Randers-Pehrson
55e85c24b4 [libpng15] Imported from libpng-1.5.7beta01.tar 2011-11-04 13:47:49 -05:00
Glenn Randers-Pehrson
2b7d730e27 [libpng15] Bump version to libpng-1.5.7beta01 2011-11-02 23:14:13 -05:00
Glenn Randers-Pehrson
bc6726bc04 [libpng15] Imported from libpng-1.5.6.tar 2011-11-02 22:48:36 -05:00
Glenn Randers-Pehrson
bb5cb1476b [libpng15] Bump version to libpng-1.5.6beta02 2011-09-22 12:48:19 -05:00
Glenn Randers-Pehrson
d404b6d488 [devel] Imported from libpng-1.5.4.tar 2011-07-07 06:26:30 -05:00
Glenn Randers-Pehrson
ef217b76a3 [devel] Updated comments that mention 1.5.3; changed them to 1.5.4. 2011-06-15 12:58:27 -05:00
John Bowler
550bab03fb [devel] Removed the ACCURATE and LEGACY options (they are no longer useable)
Fixed some compiliation problems with scaling options.
2011-06-14 06:17:26 -05:00
John Bowler
b2bee3374c [devel] Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is
wrong (high by one) 25% of the time. Dividing by 257 with rounding is
    wrong in 128 out of 65536 cases. Getting the right answer all the time
    without division is easy.
2011-06-10 23:24:58 -05:00
Glenn Randers-Pehrson
36fa2a0abd [devel] Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
before IDAT.
2011-05-11 06:52:37 -05:00
Glenn Randers-Pehrson
af855e415d [devel] Remove some trailing blanks. 2011-05-07 10:54:28 -05:00
John Bowler
c5bef946b1 [devel] IDAT compression failed if preceded by a compressed text chunk
This was because the attempt to reset the zlib stream in png_write_IDAT
happened after the first IDAT chunk had been deflated - much too late.
In this change internal functions are added to claim/release the z_stream
and, hopefully, make the code more robust.  Also deflateEnd checking is
added - previously libpng would ignore an error at the end of the stream.
2011-05-05 17:35:39 -05:00
Glenn Randers-Pehrson
4753906826 [devel] Update "last changed" dates and added CHANGES entry. 2011-05-05 07:32:30 -05:00
John Bowler
88b77cc6f3 [devel] Remove png_snprintf, add formatted warning messages.
This change adds internal APIs to allow png_warning messages to have parameters
 without requiring the host OS to implelment snprintf.  As a side effect the
 dependency of the RFC1132 code on stdio is removed and PNG_NO_WARNINGS does
 actually work now.
2011-05-05 06:49:55 -05:00
John Bowler
e6dc85bb0b [devel] Changed png_struct jmp_buf member name to avoid clash with macro 2011-04-27 14:47:15 -05:00
John Bowler
4a12f4a22a [devel] Cleanup of conditional compilation code and of background/gamma
handling. Internal changes only except for a new option to avoid compiling
in the png_build_grayscale_palette API (which is not used at all internally.)
The main change is to move the transform tests (READ_TRANSFORMS,
WRITE_TRANSFORMS) up one level to the caller of the APIs.
2011-04-17 18:34:22 -05:00
Glenn Randers-Pehrson
1345cbeea8 [devel] Update change comments (1.5.2 -> 1.5.3) 2011-03-31 20:33:04 -05:00
Glenn Randers-Pehrson
6b3d50b2cd [devel] Re-initialize the zlib compressor before compressing non-IDAT chunks. 2011-03-31 20:14:29 -05:00
Glenn Randers-Pehrson
47dc5f7b54 [devel] Fix spelling in a comment. 2011-03-30 09:59:02 -05:00
Glenn Randers-Pehrson
3d3aae1697 --amend [devel] Imported from libpng-1.5.1.tar 2011-02-02 23:00:03 -06:00
Glenn Randers-Pehrson
b764c60a12 [devel] Imported from libpng-1.5.1beta03.tar 2011-01-14 21:20:20 -06:00
Glenn Randers-Pehrson
f5ea1b7095 [devel] Imported from libpng-1.5.0.tar 2011-01-06 06:45:07 -06:00
Glenn Randers-Pehrson
64b863cd2a [devel] Update copyright year and bump to version libpng-1.5.0rc07 2011-01-04 09:58:33 -06:00
Glenn Randers-Pehrson
d546f4399f [devel] Added the private PNG_UNUSED() macro definition in pngpriv.h.
(adapted from the UNUSED() macro in pngvalid.c by John Bowler)
2010-12-04 20:41:36 -06:00
Glenn Randers-Pehrson
f0eda4e8d7 [devel] Imported from libpng-1.5.0beta51.tar 2010-10-15 15:08:42 -05:00
Glenn Randers-Pehrson
7e1fabe2f7 [devel] Imported from libpng-1.5.0beta50.tar 2010-10-14 07:35:45 -05:00
Glenn Randers-Pehrson
1b49a71df4 [devel] Imported from libpng-1.5.0beta49.tar 2010-10-07 21:01:17 -05:00
Glenn Randers-Pehrson
83b4fc4af4 [devel] Imported from libpng-1.5.0beta48.tar 2010-10-04 23:06:09 -05:00
Glenn Randers-Pehrson
b0876110ca [devel] Fixed problem with symbols creation in Makefile.am which was assuming
that CCP writes to standard output by default (Martin Banky).
2010-10-04 22:24:14 -05:00
Glenn Randers-Pehrson
bcb3aac3c5 [devel] Fixed a number of problems with 64-bit compilation reported by Visual
Studio 2010 (John Bowler).
2010-09-10 22:05:27 -05:00
Glenn Randers-Pehrson
39515c9ee0 [devel] Imported from libpng-1.5.0beta46.tar 2010-08-28 06:25:21 -05:00
Glenn Randers-Pehrson
a7119547e2 [devel] Imported from libpng-1.5.0beta45.tar 2010-08-26 07:10:48 -05:00
Glenn Randers-Pehrson
9b362b1e4f [devel] Bump to version libpng-1.5.0beta45 2010-08-24 09:05:02 -05:00
Glenn Randers-Pehrson
67439c4701 [devel] Addressed various issues identified by GCC, mostly signed/unsigned
and shortening problems on assignment but also a few difficult to optimize
(for GCC) loops (John Bowler).
2010-08-19 07:01:09 -05:00
Glenn Randers-Pehrson
e600c51355 [devel]Made all API functions that have const arguments and constant string
literal pointers declare them (John Bowler).
Many APIs did not change their arguments but were not declared using
PNG_CONST.  This change corrects this.  In a few cases APIs that return
constant string literal pointers have also been changed to declare this.
Unlike the argument change this may require app changes; however the
results could never be written to (the app would crash on some platforms
where strings are not writable), so this seems advisable.
2010-08-18 07:25:46 -05:00
Glenn Randers-Pehrson
363f96e717 [devel] Imported from libpng-1.5.0beta41.tar 2010-08-11 09:04:31 -05:00
Glenn Randers-Pehrson
836fe66e24 [devel] Imported from libpng-1.5.0beta40.tar 2010-08-06 06:57:32 -05:00
Glenn Randers-Pehrson
77396b63f9 [devel] VisualC/GCC warning fixes, VisualC build fixes
The changes include support for function attributes in VC in addition to
    those already present in GCC - necessary because without these some
    warnings are unavoidable.  Fixes include signed/unsigned fixes in
    pngvalid and checks with gcc -Wall -Wextra -Wunused.
  VC requires function attributes on function definitions as well as
    declarations, PNG_FUNCTION has been added to enable this and the
    relevant function definitions changed.
2010-08-02 08:00:10 -05:00
Glenn Randers-Pehrson
3df324d845 [devel] Expanded TAB characters, again. 2010-07-31 13:45:04 -05:00
Glenn Randers-Pehrson
4009a76e97 [devel] Implemented remaining "_fixed" functions and corrected warnings
that were recently introduced, mostly resulting from
safe but uncast assignments to shorter integers.  Also added a zlib
VStudio release library project because the latest zlib Official Windows
build does not include such a thing.
2010-07-31 06:34:36 -05:00
Glenn Randers-Pehrson
6c47e84d2e [devel] Bump to version libpng-1.5.0beta36 2010-07-29 19:10:27 -05:00
Glenn Randers-Pehrson
29034c5076 [devel] Expanded the new TAB characters. 2010-07-29 17:58:49 -05:00
Glenn Randers-Pehrson
31aee0d0c0 [devel]
Fixed point APIs are now supported throughout (no missing APIs).
  Internal fixed point arithmetic support exists for all internal floating
    point operations.
  sCAL validates the floating point strings it is passed.
  Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2
  Two new APIs exist to get the number of passes without turning on the
    PNG_INTERLACE transform and to get the number of rows in the current
    pass.
  A new test program, pngvalid.c, validates the gamma code.
  Errors in the 16 bit gamma correction (overflows) have been corrected.
  cHRM chunk testing is done consistently (previously the floating point
    API bypassed it, because the test really didn't work on FP, now the test
    is performed on the actual values to be stored in the PNG file so it
    works in the FP case too.)
  Most floating point APIs now simply call the fixed point APIs after
    converting the values to the fixed point form used in the PNG file.
  The standard headers no longer include zlib.h, which is currently only
    required for pngstruct.h and can therefore be internal.
  (Patches by John Bowler)
2010-07-29 17:39:14 -05:00
Glenn Randers-Pehrson
915bab5fc7 [devel] Bump to version libpng-1.5.0beta35 2010-07-24 08:25:31 -05:00
Glenn Randers-Pehrson
39a8bb71d3 [devel] Imported from libpng-1.5.0beta34.tar 2010-07-12 06:45:23 -05:00
Glenn Randers-Pehrson
8f9de7acbd [devel] Bump back to version libpng-1.5.0beta34 2010-07-06 07:46:10 -05:00
Glenn Randers-Pehrson
289500ab8d [devel] Imported from libpng-1.5.0beta33.tar 2010-06-28 20:21:22 -05:00
Glenn Randers-Pehrson
4db344230d [devel] Imported from libpng-1.5.0beta32.tar 2010-06-25 20:18:44 -05:00
Glenn Randers-Pehrson
821b7106b2 [devel] Imported from libpng-1.5.0beta31.tar 2010-06-25 20:06:43 -05:00
Glenn Randers-Pehrson
ef3831a1fe [devel] Imported from libpng-1.5.0beta30.tar 2010-06-25 20:06:40 -05:00
Glenn Randers-Pehrson
5feb87cd0e [devel] Imported from libpng-1.5.0beta29.tar 2010-06-25 20:06:38 -05:00
Glenn Randers-Pehrson
57d9617964 [devel] Imported from libpng-1.5.0beta28.tar 2010-06-25 20:06:35 -05:00
Glenn Randers-Pehrson
5b3d554e1e [devel] Imported from libpng-1.5.0beta26.tar 2010-06-25 20:06:30 -05:00
Glenn Randers-Pehrson
53c07f5909 [devel] Imported from libpng-1.5.0beta25.tar 2010-06-25 20:06:28 -05:00
Glenn Randers-Pehrson
537c1a5747 [devel] Imported from libpng-1.5.0beta24.tar 2010-05-07 09:55:50 -05:00
Glenn Randers-Pehrson
f24daf23a5 [devel] Added more blank lines for readability. 2010-05-06 09:44:04 -05:00
Glenn Randers-Pehrson
aa3143cf6f [devel] Imported from libpng-1.5.0beta23.tar 2010-04-29 10:56:05 -05:00
Glenn Randers-Pehrson
bb317fb0b2 [devel] Bump to libpng-1.5.0beta22 2010-04-28 07:44:23 -05:00
Glenn Randers-Pehrson
deec549d9f [devel] Imported from libpng-1.5.0beta21.tar 2010-04-26 22:51:22 -05:00