Commit Graph

411 Commits

Author SHA1 Message Date
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