Compare commits

...

2728 Commits

Author SHA1 Message Date
Cosmin Truta
7cecdcae07 Harden a vestigial check against overflow inside png_zalloc
Reported-by: Sergio Atienza Pastor, MTP Métodos y Tecnología
2025-07-03 22:42:11 +03:00
Cosmin Truta
cf59edd364 Bump version to 1.6.51.git 2025-07-02 20:24:24 +03:00
Cosmin Truta
2b978915d8 Release libpng version 1.6.50 2025-07-01 23:50:00 +03:00
Cosmin Truta
254a64ec30 doc: Update the man pages to the final PNG-3 specification
Also make editorial changes regarding the previous PNG specifications.
2025-07-01 22:57:36 +03:00
Cosmin Truta
9eb25bd899 chore: Rerun ./autogen.sh --maintainer 2025-06-30 23:46:32 +03:00
Cosmin Truta
8087a21d0a build: Fix the CMake file for cross-platform builds that require libm
Detect the availability of `libm` on the target platform.
Previously, `libm` was detected on the host platform only.

Also introduce the variable `PNG_LINK_LIBRARIES`.
Stop using `M_LIBRARY`, which was not namespace-clean.
2025-06-30 22:27:17 +03:00
John Bowler
2e5f296bfa fix: Prevent unknown chunks from causing out-of-place IEND errors
PNG_AFTER_IDAT was not set by the IDAT read code if unknown chunk
handling was turned on.  This was hidden in the current tests by checks
within the text handling chunks. (For example, pngtest.png has a zTXt
chunk after IDAT.)

This change modifies both the sequential and the progressive reader to
reliably set PNG_AFTER_IDAT when the first non-IDAT chunk is seen and
before that chunk is processed.

The change is minimalist; PNG_HAVE_CHUNK_AFTER_IDAT can probably be
removed and replaced with PNG_AFTER_IDAT.  Making the latter change is
something to be considered in libpng2.

Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-30 16:27:22 +03:00
Filip Wasil
4266c75f40 riscv: Remove unused argument
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-28 16:19:11 +03:00
Filip Wasil
f451a4de09 riscv: Simplify the runtime check to always be present
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-28 16:19:11 +03:00
Filip Wasil
6aa47debba riscv: Do not overwrite -march when testing against SIMD availability
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-28 16:19:11 +03:00
Filip Wasil
3391bb98e3 riscv: Use C intrinsics
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-28 16:19:11 +03:00
Filip Wasil
21895b05ab riscv: Clearly separate the build flow for autotools and cmake
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-18 14:43:36 +03:00
Cosmin Truta
be81ebe1a4 chore: Rerun ./autogen.sh --maintainer 2025-06-17 11:41:32 +03:00
Filip Wasil
edf46621f3 riscv: Improve the RVV availability check
In some cases, the vector extension is not supported, although the
compiler allows the "v" flag in `-march` and includes `<riscv_vector>`
without raising an error.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-17 11:40:57 +03:00
Cosmin Truta
5dc5937b30 chore: Update .gitignore
This is a cherry-pick of commit df3b9173277aae60b08a216dc23484f6ec171ef5
from branch 'libpng18'.
2025-06-14 18:35:46 +03:00
Cosmin Truta
7084241c75 Bump version to 1.6.50.git 2025-06-14 17:13:02 +03:00
Cosmin Truta
640204280f Release libpng version 1.6.49 2025-06-12 20:05:46 +03:00
Cosmin Truta
740366c32b doc: Update the png.5 man page to the latest PNG-3 draft 2025-06-12 19:58:06 +03:00
Cosmin Truta
5d53dfd20c chore: Rerun ./autogen.sh --maintainer 2025-06-12 18:46:04 +03:00
Filip Wasil
5b62726ced riscv: Fix autodetection of RVV support
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-06-12 18:44:02 +03:00
Cosmin Truta
a5830bfcb1 build: Fix the detection of the math library in the CMake file
This is a fix of commit 5631b9b952e6940c67d4b48c00882e99229aa31b
"build: Implement various improvements to the CMake file"
2025-06-11 21:38:01 +03:00
Cosmin Truta
3bca02e274 examples: Refactor and reformat using clang-format
Add contrib/examples/.clang-format, tailored to fit the existing code
as closely as possible. The end goal is to set up automatic formatting
for the entire libpng source tree. We're doing this experiment in this
subdirectory, for now.

Also make refactoring changes, as follows:

 * Rewrite the preprocessor checks `#if PNG_FOO_SUPPORTED` to stop
   compilation immediately, with a descriptive `#error` about what
   needs to be supported.

 * Rewrite and reflow comments, add braces and brackets, and make other
   minor modifications that are suited for the clang-format'ed code.
2025-06-01 22:40:38 +03:00
Sanjay Jangid
197bbfe0d5 examples: Fix file descriptor leak in iccfrompng.c by closing input file
Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-31 17:06:28 +03:00
Cosmin Truta
0cc6436ef5 build: Repair and reduce the CMake build dependency graph
A funny thing happened while refactoring the function argument parsing
in the `PNGGenConfig` module: the processing of dependencies inside
the CMake function `generate_copy` got fixed, thanks to an inadvertent
typo correction!

Going down the rabbit hole, we uncovered two issues:

 1. A typo in `scripts/cmake/PNGGenConfig.cmake` caused a dependency
    declaration to disappear, disrupting the graph. Fortunately, this
    disruption was being mitigated by an additional set of (redundant)
    symbolic target declarations that kept the CMake build going.

 2. The exact string matching inside `scripts/cmake/gensrc.cmake.in`
    imposed an artificial limitation, disallowing the use of absolute
    file paths.

The typo correction in (1), and the use of regex matching instead of
exact string matching in (2), allowed us to use absolute file paths
in the main CMake file, consistently, thus allowing CMake to recognize
them as uniquely-identifiable nodes in the dependency graph. There
should be no further need to have extra symbolic targets for proper
node identification.

In the end, we shaved off the redundant symbolic target declarations,
retaining only `png_genfiles` and `png_genprebuilt`.
2025-05-29 22:55:00 +03:00
Cosmin Truta
f04c457a51 build: Remove the PNG_DEBUG option from CMake files and project files
Counter-intuitively, defining the PNG_DEBUG macro as 1 (i.e. setting
the debug verbosity level to 1) does *not* cause any of the existing
debug traces to show up. This setting would have worked if we had trace
statements like `png_debug(0, message)`, but we don't have any.

Debug traces do show up for verbosity levels from 2 to 5. The libpng
manual describes in detail how they are meant to be used.

According to the history of the CMake file, as well as the history of
other project files, PNG_DEBUG was never set to a numeric value larger
than 1. In other words, these debug settings inside these build files
never produced any output in any (unmodified) libpng version.

(As for the configure build, PNG_DEBUG has no special treatment there.)

Considering the plethora of alternative methods to pass C preprocessor
options through our build files, scripts and projects onto libpng, we'd
rather discontinue PNG_DEBUG as a dedicated build option.
2025-05-29 19:47:03 +03:00
Cosmin Truta
5631b9b952 build: Implement various improvements to the CMake file
Allow the CMake build to work properly, even if file paths (in the
source directory, in the build directory, or in the install directory)
might contain whitespace characters.

Improve the check for compilers that might use MSVC Runtime library
headers on Windows. We use POSIX-ish ("deprecated") functions, even
on Windows, and we want no spurious warnings.

Tidy up the CMake file: rearrange declarations, rewrite comments, etc.
2025-05-29 18:28:16 +03:00
Joost Nieuwenhuijse
dc71f481ff build: Fix apple-non-apple cross building
When cross compiling for an apple platform on a non-apple platform
(or the reverse), `if(APPLE)` in line 32 should refer to the target
platform. Without importing the `APPLE` variable, it refers to the
host platform.

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-28 17:24:21 +03:00
Cosmin Truta
e2c1579816 ci: Add action-editorconfig-checker to the GitHub Action for linting
The editorconfig-checker program is not installed by default in the OS
used by GitHub Actions. Fortunately, the editorconfig-checker authors
have kindly provided the action-editorconfig-checker repository, which
we are now using.
2025-05-28 11:02:47 +03:00
Cosmin Truta
cff8620272 chore: Add riscv/.editorconfig and pacify editorconfig-checker
Also tidy up the new RISC-V code to comply with our coding style,
and rearrange comments inside png.h to improve readability within
the configured editing limits.
2025-05-27 11:28:56 +03:00
Cosmin Truta
5be32eb35c chore: Rerun ./autogen.sh --maintainer 2025-05-26 22:37:06 +03:00
Filip Wasil
611bf1016c riscv: autotools update 2025-05-19 15:58:44 +02:00
Filip Wasil
0e37c0b477 riscv: Fix more comments
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-14 22:35:47 +03:00
Filip Wasil
7108843467 riscv: Fix the run-time checking of the RVV availability
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-14 10:24:58 +03:00
Filip Wasil
2b0eb78656 riscv: Fix autotools definitions and comments
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-14 10:24:58 +03:00
Filip Wasil
ffb8e8b26f Fix and improve the RISC-V Vector (RVV) implementation
Changes include manually merged code from Manfred SCHLAEGL.

Co-authored-by: Manfred SCHLAEGL <manfred.schlaegl@gmx.at>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-01 17:44:00 +03:00
Dragoș Tiselice
cc5ee6b213 Add optimized RISC-V Vector functions
Largely based off of the ARM NEON implementation.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-05-01 17:44:00 +03:00
Cosmin Truta
b4800bae33 Bump version to 1.6.49.git 2025-05-01 14:50:23 +03:00
Cosmin Truta
ea12796820 Release libpng version 1.6.48 2025-04-30 16:51:46 +03:00
Cosmin Truta
643dbda7d6 doc: Update the png.5 man page to the latest PNG-3 draft specification
Also update libpngpf.3 to explicitly state that the internal functions
should not be used by applications.
2025-04-30 16:30:24 +03:00
Cosmin Truta
34e3f7a65b Remove the config for Travis CI (and thank them for their support!)
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-30 11:49:37 +03:00
Cosmin Truta
3e67531078 chore: Add a TODO note in .cmake-format.yaml; reformat CMakeLists.txt
Apply some (but not all) of the suggestions made by the cmake-format
program. Meanwhile, the cmake-lint program is (still) happy.
2025-04-29 17:30:30 +03:00
Cosmin Truta
23bdc7a6c4 build: Add the CMake build option PNG_LIBCONF_HEADER
Running the pnglibconf scripts (script/*.awk) is not always possible.
An AWK interpreter is not always guaranteed to be available; and even
if it is, there are limitations when making cross-platform libpng
builds, especially when the differences between the host platform and
the target platform are significant. For example:
 * Building for the Windows (MinGW) target on a Unix development host;
 * Building for the iOS target on a macOS development host;
 * Building for the Android target on any development host.

In such scenarios, a preconfigured (i.e. prebuilt) pnglibconf.h file,
either taken from the libpng source tree or provided by the user who
wants to make a custom libpng build, becomes a necessity.

In this commit we introduce the build option `PNG_LIBCONF_HEADER` in
order to address this specific use case.

We also specify a version range (3.14...4.0) for the minimum required
CMake program, to future-proof the CMake build for just a little bit
longer.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-28 20:44:53 +03:00
Cosmin Truta
69a3e5bfd1 chore: Clean up the error directives
Make the error directives uniformly consistent with one another.
Remove surrounding quotes and trailing punctuation, and rephrase
some of the error messages and some of their associated comments
for either brevity or clarity.
2025-04-25 16:19:30 +03:00
Cosmin Truta
c90491724e Discourage the inclusion of private headers outside libpng
Add checks inside the private png*.h header files, in order to reduce
unintentional occurences of application backdoors.

Such backdoors might occur, for example, when we make changes to the
internal data structures that might somehow "leak" from the libpng
code into the user code. The applications that use the libpng API must
pretend not to know that these headers exist at all.

Co-authored-by: John Bowler <jbowler@acm.org>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-25 15:35:11 +03:00
John Bowler
98448e372d Remove unused function from write-only configurations
`png_icc_profile_error` is no longer used when writing iCCP chunks,
therefore it can be compiled out when the reading is disabled.

This change includes two `minconfig` files to test read-only and
write-only "full" configurations, to supplement the existing tests
for "minimal" configurations.

Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-22 19:35:01 +03:00
John Bowler
f2b0f5fe1c fix(mDCv): Correct the floating-point setter png_set_mDCv
In the floating-point API function `png_set_mDCv` we incorrectly
divided by two the chromaticity values before passing them on to
`png_set_mDCv_fixed`.

Reported-by: Mohit Bakshi <mohitbakshi2205@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-22 18:08:39 +03:00
Chris Blume
7101a5569f Correct mistake in example.c 2025-04-22 18:04:46 +03:00
Cosmin Truta
e046c0dc3b Revert "Recover from errors in ancillary chunks"
This reverts commit 34005e3d3d373c0c36898cc55eae48a79c8238a1.

Although I agreed with Lucas Chollet initially, I finally understood
the objection brought forth by John Bowler: "[...] it's not an
ancillary chunk type if it's not a chunk type in the first place."

I feel that more deliberation is needed on what a robust PNG decoder
should do when it stumbles upon a chunk type that fails to meet its
basic requirements. A clarifying recommendation for decoders may or
may not need to be stipulated in the PNG specification as well.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-04-22 16:39:01 +03:00
Lucas CHOLLET
34005e3d3d Recover from errors in ancillary chunks
As per the third edition of the spec, decoders should recover from
errors in ancillary chunks.

In section 13.1 Error handling [1]:
> Anomalous situations other than syntax errors shall be treated as
> follows:
>  1. Encountering an unknown ancillary chunk is never an error. The
>     chunk can simply be ignored.

More specifically, in this commit, if a chunk that is detected as
ancillary, does not pass the `check_chunk_name()` function, only a
_benign_ is issued, instead of an error.

This allows libpng to fully decode images like [2] and [3]. It has been
tested by passing them to both pngtest and Gnome's image viewer. Note
that invalid-unknown-ancillary-after-IDAT.png could already be displayed
but not fully decoded.

[1] https://w3c.github.io/png/#13Decoders.Errors
[2] https://github.com/web-platform-tests/wpt/blob/master/png/errors/support/invalid-unknown-ancillary.png
[3] https://github.com/web-platform-tests/wpt/blob/master/png/errors/support/invalid-unknown-ancillary-after-IDAT.png
2025-03-04 15:13:19 -07:00
Cosmin Truta
44f97f08d7 [libpng18] chore: Clean up the FILE * formulations in code and in documentation
We should use `FILE *` instead of `FILE*` or `(FILE*)`, consistently,
as we should for all other pointer types. Moreover, when we refer to
standard stdio file objects in comments and in documentation, we should
use the term "FILE objects" consistently.

Lastly, we clarify in a comment in example.c that `PNG_STDIO_SUPPORTED`
is true only when the stdio support is both available in the system and
accessible in the user's libpng build.

This is a cherry-pick of commit c63c5463903014c904b540216c2784023fb8c1c8
from branch 'libpng18'.

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-02-26 19:46:08 +02:00
Cosmin Truta
044536de92 [libpng18] chore: Clean up remnants of the long-discontinued Win16 support
Remove #ifdef sections and other workarounds for old Windows compilers
that lacked proper support for Win32, including, especially, support
for the Win32 stdio API.

This is a cherry-pick of commit e936211760ddf0ed4a4711ea897b59395dfd206e
from branch 'libpng18'.

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-02-26 19:42:28 +02:00
Cosmin Truta
738f5e743c ci: Add more checks to ci_verify_version.sh; refactor
In addition to png.h, configure.ac and CMakeLists.txt, the script
ci_verify_version.sh is now able to verify libpng-config-head.in also.

For the benefit of readability, the old script ci_shellify.sh has been
split into smaller, independent scriptlets: libexec/ci_shellify_*.sh.

The linting script ci_lint.sh has been updated as needed.
2025-02-20 11:59:16 +02:00
Cosmin Truta
f20e66aa93 chore: Apply some of the missed updates to the copyright year 2025-02-19 13:15:14 +02:00
Cosmin Truta
5d09501462 Bump version to 1.6.48.git 2025-02-19 13:07:40 +02:00
Cosmin Truta
872555f4ba Release libpng version 1.6.47 2025-02-18 11:18:30 +02:00
Cosmin Truta
bb7e922914 ci: Introduce the CI_NO_BUILD flag
For testing purposes (e.g. wanting to see if "make distclean" works
correctly with and without building), as well as development purposes
(e.g. wanting to inspect the artifacts produced in the configuration
stage), add `CI_NO_BUILD` to the family of contrarians.
2025-02-17 21:13:32 +02:00
John Bowler
b20e6fb314 pngimage: clean up on user/internal errors
pngimage: The code simply exited with a return code of 99 in the event
of a user error including giving pngimage invalid PNG files and an
internal error.  It now attempts to clean up the state before doing so,
matching the normal behaviour.

pngimage: Non-ISO use of setjmp(3) corrected.

pngerror.c: Failure to call png_image_free on a false result from a
png_safe_execute function call fixed.  This was a regression caused by
the 'volatile' clean-up.  Not normally detectable because png_image_free
will often be called by the application.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-02-17 11:38:28 +02:00
Chris Lilley
5356b94169 Update man page to latest PNG 3e draft 2025-02-11 11:39:31 -05:00
John Bowler
812c34c13c test: add limit configuration tests
nocompile-limits.dfa: turns off all limits including run-time limits

nolimits.dfa: makes the compile time limits unlimited while leaving on
    the run-time limits.

Fixes compiler warnings exposed by these tests. These are just warnings,
there were no bugs other than a failure to handle systems with a 16-bit
at the appropriate time which would result in a later failure on malloc.

png.c: png_icc_check_length: in-line code was still used in place of
    png_chunk_max when checking the current chunk allocation limit.  The
    in-line code did not handle PNG_MAXSEG_64K and, anyway, issued
    compiler warnings in the 'nocompile-limits' case.  Changed to use
    png_malloc_max.

pngrutil.c: eliminated an erroneous 'truncation' warning with GCC-14 by
    using a safe cast.

pngtest.c: failed to check for PNG_USER_LIMITS_SUPPORTED around API
    calls which don't exist without PNG_USER_LIMITS.

Signed-off-by: John Bowler <jbowler@acm.org>
2025-01-31 09:46:21 -08:00
John Bowler
68e090e700 fix: png_write_iCCP check on profile length
This is a regression of commit a8242dd9473a8da4d851623cf0b514a8ee4bee34
"PNGv3 colourspace precedence rules conformance".

Previously, `png_write_iCCP` used the length from the first four bytes
of the profile set by `png_set_iCCP`, rather than the actual data length
recorded by `png_set_iCCP`.

If the profile data were less than 4 bytes long, it would have caused
a read-beyond-end-of-malloc error.  This bug was in the libpng code even
before the changes introduced in the above-mentioned commit, but it was
inaccessible.  It became accessible when we removed the pre-PNGv3 colour
space checks in `png_set_iCCP`.

Reported-by: Bob Friesenhahn <bobjfriesenhahn@gmail.com>
Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-30 23:22:42 +02:00
Cosmin Truta
8c7ed2e3b2 fix: Typo in a preprocessor directive
This is a regression of commit 2519a03418af2108d3bd8c269ba01ab72ae240ef
"refactor: Clean up the checking of chunk lengths and allocation limits"

Compilation would break under the "right" non-default configuration.
(Oopsie!)

Also clean up comments in the surrounding code.

Reported-by: chris0e3 <chris0e3@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-30 23:07:55 +02:00
John Bowler
2519a03418 refactor: Clean up the checking of chunk lengths and allocation limits
Internal changes only.

Move chunk length checks to fewer places:

Change `png_struct::user_chunk_malloc_max` to always have a non-zero
value, in order to avoid the need to check for zero in multiple places.

Add `png_chunk_max(png_ptr)`, a function-like macro defined in pngpriv.h
which expresses all the previous checks on the various USER_LIMITS and
system limitations.  Replace the code which implemented such checks with
`png_chunk_max`.

Move the malloc limit length check in `png_read_chunk_header` to
`png_handle_chunk` and make it conditional on the chunk type.

Progressive reader: call `png_read_chunk_header`.

Correct the handling of pHYs.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-30 20:30:44 +02:00
John Bowler
c4b20d0a3a test: add configuration tests and fix bugs
The two new configuation tests, fixed.dfa and float-fixed.dfa verify
that the 'standard' configuration of libpng works without floating point
arithmetic.

Signed-off-by: John Bowler <jbowler@acm.org>
2025-01-27 10:59:58 -08:00
John Bowler
a8242dd947 PNGv3 colourspace precedence rules conformance
This is a major change required by the new PNGv3 colour chunk precedence
rules.  It **does not** change the libpng API (png.h) however it changes
the following handling of PNG files:

IFF the PNG file contains colour space information it changes from the
libpng v3 behaviour to the now compulsory PNG v3 behaviour:

1) libpng no longer invalidates colour space chunks because they are
   inconsistent.
2) libpng no longer responds to the "png_get_" APIs positively if they
   are not present in the PNG but can be deduced from the colour space
   chunks that are present.
2025-01-27 10:59:33 -08:00
Cosmin Truta
171bdd3a6c Bump version to 1.6.47.git 2025-01-27 18:32:44 +02:00
Cosmin Truta
0024abd279 Release libpng version 1.6.46 2025-01-23 19:02:04 +02:00
Cosmin Truta
fcb0bca15f chore: Update the .editorconfig file; add/update README files
Add various missing pieces to their right places:
 * Update .editorconfig in order to let editorconfig-checker know that
   aclocal.m4 (which is auto-generated) may contain trailing whitespace.
 * Add ci/README.md.
 * Update scripts/README.txt.

TODO:
Integrate editorconfig-checker into the linting workflow on GitHub.
(See .github/workflows/lint.yml)
2025-01-22 23:19:49 +02:00
Cosmin Truta
deadeea7a2 chore: Fix a typo in Makefile.am; rerun ./autogen.sh --maintainer 2025-01-22 15:15:58 +02:00
Cosmin Truta
9cc729b523 build: Update scripts/makefile.*
Apply the following updates:
 * Tidy up the compiler flag definitions.
 * Update the Darwin, Linux and MSYS makefiles to match the compiler
   flags used in scripts/makefile.clang and scripts/makefile.gcc.
 * Add the `pngtest-static` target in the Darwin makefile, following
   on the Linux makefile.
 * Rewrite some of the implicit make rules to match one another more
   consistently.
 * Make corrections in the copyright years to match git log.
2025-01-21 19:06:43 +02:00
Cosmin Truta
36a16fd761 build: Add scripts/makefile.c89; update other makefiles
Add scripts/makefile.c89 and refactor scripts/makefile.emcc,
scripts/makefile.clang and scripts/makefile.gcc

Refactor variable definitions inside scripts/makefile.clang,
scripts/makefile.gcc and scripts/makefile.emcc, and start using
the option `-pedantic-errors` unconditionally. This option was
first implemented in GCC version 3.1, and it was available in
Clang and in other Clang-based compilers (e.g. Emscripten) from
the beginning.

Add scripts/makefile.c89, derived from the above makefiles, but
with `-pedantic-errors -std=c89`. We aren't enabling the C89 level
by default, to avoid any incompatibility, whether intentional or
accidental, with the compiler's default language level. However,
we are still continuing to support C89 in the 'libpng16' branch,
and this special makefile can be used for testing purposes.
2025-01-21 18:42:49 +02:00
John Bowler
4d7c99334e fix: Restore the build for strictly-conforming standard compilers
In libpng version 1.6.45 we inadvertently used a declaration after
a statement, which works for compilers supporting C99 and newer,
but fails with C89 compilers, which we are still supporting in the
branch 'libpng16'.

Moreover, in commit 92e8581f12d4570b777eaabfbe1f4243b7b80c04, we used
the macro `PNG_FIXED_EXPORT` in a manner that introduced a spurious ';'
character, which broke the build for all standard-conforming compilers.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-21 11:24:21 +02:00
Cosmin Truta
19a5a5eba3 pngminus: Remove a workaround for an old printer
A downgrade from 16-bit samples to 8-bit samples, or an expansion from
1- or 2-channel grayscale (or grayscale+alpha) to 3- or 4-channel
RGB (or RGB+alpha), etc., may be deemed generally useful. Such image
transforms could be made available to the user via command-line options.
On the other hand, keeping the decision to disable or enable these
transforms unconditionally at compile time (e.g. because they're needed
to work around a specific printer's limitations) is less than ideal.
2025-01-10 14:49:51 +02:00
Cosmin Truta
8a28d0558e pngminus: Fix a typo in png2pnm.c 2025-01-10 13:21:21 +02:00
Cosmin Truta
03660a516b pngminus: Add .editorconfig file; update the CMake file 2025-01-10 12:27:01 +02:00
John Bowler
f753baae52 api(PNGv3): Update the generated files and PNG_EXPORT_LAST_ORDINAL
Apart from the png.h change, these files are machine-generated.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-08 23:22:50 +02:00
John Bowler
92e8581f12 api(PNGv3): Add support for mDCV and cLLI
This adds APIs to get/set the two remaining new PNG-v3 colour space
chunks.  The mDCV API matches that of cHRM.  Both chunks support
floating point APIs (all values in the two chunks are real numbers).

Both chunks have a new encoded type, a four-digit-precision fixed-point
number, which cannot be represented in the existing `png_fixed_point`
type, so a `png_uint_32` is used.

Test examples for cICP, cLLI and mDCV are now in pngtest.png, and a
necessary change to the pngunknown.c test program has been made to
accomodate the additions.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-08 23:22:50 +02:00
Cosmin Truta
8ffc967e8a Bump version to 1.6.46.git 2025-01-08 19:26:11 +02:00
Cosmin Truta
51f5bd68b9 Release libpng version 1.6.45 2025-01-07 18:31:22 +02:00
Cosmin Truta
3714c584b1 chore: Rerun ./autogen.sh --maintainer 2025-01-06 19:48:56 +02:00
Cosmin Truta
2a845ff819 build: Move portions from the main CMake file to separate modules
In preparation for the upcoming changes in the build system, any parts
of the CMake file that are unlikely to be affected should be moved out
of the way. This should facilitate an easier resync between the branch
'libpng16' and its successor(s).

Specifically:
 * Move the functions `generate_chk`, `generate_out`, `generate_source`
   and `generate_copy` to scripts/cmake/PNGGenConfig.cmake.
 * Move the function `png_add_test` to scripts/cmake/PNGTest.cmake.
 * Leave the function `create_symlink` in place, but add a TODO note.
   As we raised the minimum required CMake version to 3.14, we should
   now be able to use CMake's built-in function instead.
2025-01-06 17:09:10 +02:00
John Bowler
0cc367aaea [libpng16] fix: Write order of colourspace chunks should conform to PNG v3
cICP was written after PLTE, not before.  The other chunks were output
in an order which does not match the new PNG-v3 "priority" order.

This change outputs all chunks in the "priority" order; highest
precedence first.  This means that the PNGs so written conform to
PNG v3 (cICP), and allow a streaming app to handle chunks in order,
without buffering data which may later be overridden.

Note that PNG-v3 establishes the idea of dropping ancillary chunks
which are inconveniently ordered in the definition of how APNG chunks
are handled.

This is a cherry-pick of commit 945f2602a0ea05a7938b2f52df9ef16cf3440291
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-03 22:28:23 +02:00
Cosmin Truta
3042f74de0 [libpng16] fix: Update the cICP implementation yet more
For the sake of completeness:
 * Add the cICP entry to the list of known chunks to ignore inside
   `png_set_keep_unknown_chunks`.
 * Handle cICP in `png_read_end`, alongside cHRM, gAMA, iCCP, sRGB.
 * In pngtest.c, move the cICP test code near cHRM, gaMA, iCCP, sRGB.

This is a cherry-pick of commit 27c2ac722fd99b8622cead655034208ce96346ac
from branch 'libpng18'.

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-03 13:46:34 +02:00
Cosmin Truta
4599354be8 [libpng16] test: Move cicp-display-p3_reencoded.png to contrib/testpngs/png-3/
Update the main CMake file and the auxiliary test scripts accordingly.

This is a cherry-pick of commit fe277b7752990be35523832a546aec478437968a
from branch 'libpng18'.
2025-01-02 20:01:25 +02:00
Cosmin Truta
823c2d80dc [libpng16] fix: Update the cICP support for better compliance with PNG-3
Apply the following corrections and improvements:
 * Add a validity check in `png_set_cICP`.
 * Fix the ordering check in `png_handle_cICP`.
 * Add a multiplicity check in `png_handle_cICP`.
 * Optimize the implementation of `png_write_cICP`.
 * Remove an unnecessary preprocessor guard from pngtest.c.
 * Update the dependency declaration in pnglibconf.dfa.
 * Fix the indentation where necessary.

This is a cherry-pick of commit c2a02691df1ecf51b7c97142752a7034350cb1f6
from branch 'libpng18'.
2025-01-02 11:15:20 +02:00
Lucas CHOLLET
75748d93ce [libpng16] Add support for reading and writing the cICP chunk
This chunk was added in the third edition of the PNG specification and
contains Coding Independent Code Points (related to color space
description). It is fairly simple as it only contains four fields of one
byte each: Colour Primaries, Transfer Function, Matrix Coefficients,
Video Full Range Flag.

The test file originally comes from the related WPT test case:
https://github.com/web-platform-tests/wpt/blob/master/png/support/cicp-display-p3.png

Note that I reencoded the file to make it match libpng's default
encoding parameters (it only modifies the IDAT chunk).

This is a cherry-pick of commit 65925ad4b2cbed934d5d850fe764dc46c4becbcb
from branch 'libpng18'.

Reviewed-by: John Bowler <jbowler@acm.org>
Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-02 11:15:20 +02:00
Cosmin Truta
6f786ff0f6 Update the copyright year
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2025-01-02 11:08:58 +02:00
Cosmin Truta
c1cc0f3f4c [libpng16] build: Rename a private function to benefit C++Builder
Embarcadero's compilers, old (Borland-based) and new (Clang-based),
do have full support for Standard C. The Clang-based compiler is
claiming, through the macro __STDC_VERSION__, to support C99 and C11,
whereas the Borland-based compiler supports ANSI C, as it has for
decades.

However, their run-time library is exposing global functions beyond
the scope of Standard C, for backwards compatibility with the older
Borland products. One of these functions is `randomize`, which clashes
with a function inside pngvalid.c that incidentally has the same name.

Building libpng in "Strict ANSI C" mode, in which all Borland-specific
globals are hidden (e.g. via `bcc32 -A`), would have been a workable
solution for the Borland-based ANSI C compiler, but no such solution
appears to exist for the Clang-based C90/C99/C11 compiler.

Fortunately, renaming a private function inside a test program is a
cost-free alternative fix.

This is a cherry-pick of commit 6184164aa73ee764b1822f44d3db7619cf84f3fa
from branch 'libpng18'.
2024-10-18 16:16:16 +03:00
Cosmin Truta
d9d70e6506 [libpng16] refactor: Deduplicate the interlace arrays png_pass_*
Move the definitions of interlace arrays to the top of their respective
translation units, to reduce their repeated copying in various places of
the codebase.

TODO:
As they still exist in three copies, in pngpread.c, in pngrutil.c, and
in pngwutil.c, they should all be further moved to a common place.

This is a cherry-pick of commit 620a2b73b22df66ed099e1faacac2d92f48252b7
from branch 'libpng18'.
2024-10-17 14:18:52 +03:00
John Bowler
76e5ec217f [libpng16] test: Add a compile-time check in pngimage.c to avoid a failure
Disable the check on `interlace_method` inside function `compare_read`
in pngimage.c, if WRITE_INTERLACING is not supported.

If interlaced encoding is disabled inside libpng, the encoded images
are non-interlaced silently and unconditionally.  This commit updates
the image comparison to skip the interlace check in the resultant
image; other behavior is still checked.

This is a cherry-pick of commit d9f13d8d846e08b00f6530b7a5fe07039d48c78d
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-10-15 23:23:53 +03:00
John Bowler
65470ac86c fix: Avoid integer overflows in function png_xy_from_XYZ
This is a cherry-picked of commit f45531cc141dc20dc7a4046bbe92270b1e799a5d
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-10-13 17:32:20 +03:00
Cosmin Truta
8b1d489bce [libpng16] style: Resolve the remaining warnings issued by cmake-lint
Resolve the indentation issues raised by cmake-lint on a fragment of
CMakeLists.txt that no longer exists in branch 'libpng18'.
2024-10-12 19:37:50 +03:00
Cosmin Truta
a7a8faeefa [libpng16] style: Add a cmake-format config file and satisfy cmake-lint
Introduce CMake file linting, based on the cmakelang project by
Josh Bialkowski (@cheshirekow).

Fix various style issues in the CMake files:
 * Add the missing copyright header to PNGConfig.cmake.
 * Resolve a "missing docstring" warning raised by cmake-lint.
 * Rewrite all docstrings in the style of CMake's own documentation.
 * Fix whitespace inconsistencies.

References:
 * https://pypi.org/project/cmakelang
 * https://github.com/cheshirekow/cmake_format

This is a cherry-pick of commit c317fe31114d92d05d44bf98c9b559edf4656b9c
from branch 'libpng18'.
2024-10-12 19:37:50 +03:00
John Bowler
d7d950e8bd [libpng16] chore: Clean up the leading blank lines from all source files
The leading blank lines are apparently an artefact of an older source
control system.  They are not required and they look like accidents,
because starting a source file with a blank line is not a regular habit
of software developers nowadays.

This is a cherry-pick of commit 37cc20add8fb5b83bb5299a26cd3b41e0f776017
from branch 'libpng18'.

Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-10-11 11:51:04 +03:00
John Bowler
f14d5fcd1e [libpng16] fix: Correct the function png_fp_sub in png.c
The code erroneously evaluated `addend0+addend1` in the case where
`addend1` is less than zero.  The function is meant to subtract the
second argument from the first.

This is a cherry-pick of commit 79fd6d1edc8fe8c41ed58c6318bd57761d8f007e
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-10-10 22:29:03 +03:00
Cosmin Truta
7c90057cfe [libpng16] ci: Verification should pass regardless of autoconf artifacts
Allow ci_verify_configure.sh to pass regardless whether the configure
script and the associated configure control files are present.
This is necessary for the branches newer than 'libpng16', where these
artifacts are no longer auto-generated by default.

This is a cherry-pick of commit 09ec97edc099538d548a67253b990660c912af4f
from branch 'libpng18'.
2024-10-07 21:48:04 +03:00
Cosmin Truta
1bf304c43c [libpng16] ci: Use modern CMake command options in ci_verify_cmake.sh
Due to raising the minimum CMake version to 3.14, we can now run the
CMake build verification (ci_verify_cmake.sh) from the libpng source
dir, just as in the other scripts (ci_verify_*.sh). This is possible
thanks to the modern CMake command options `cmake -B` and `cmake -S`.

We can finally simplify the implementation of ci_verify_cmake.sh by
removing a code complication that was annoying, and yet, necessary in
peculiar Bash-on-Windows setups.

Fun fact:
CMake version 3.14 was released on 2019-03-14. Reportedly, on purpose!

This is a cherry-pick of commit 558dfbb7570cb74205f978f11504b217a2c03c2c
from branch 'libpng18'.
2024-10-06 22:39:51 +03:00
Cosmin Truta
9ee82380da [libpng16] test: Tidy up the logging of test program arguments in CTest
This is a cherry-pick of commit 2e416c623d293659a102936870c4b36c00e1b347
from branch 'libpng18'.
2024-10-06 21:54:21 +03:00
Cosmin Truta
642b5d81e3 [libpng16] build: Raise the minimum required CMake version to 3.14
Start using the features guaranteed to be available in CMake 3.14.
Specifically, use the ability of `find_package(ZLIB)` to pick up zlib
from the ZLIB_ROOT variable (if given).

This is a cherry-pick of commit 00343a761e41e56acaeb0517aec5325d3b951837
from branch 'libpng18'.
2024-10-06 21:54:21 +03:00
John Bowler
d3cf9b6e22 [libpng16] arm: Use png_aligncastconst for an upcast in Neon intrinsics
This changes the arm/palette_neon_intrinsics.c code from using a bare
cast to using the portable macro `png_aligncastconst`.  This removes
the `-Wcast-align` warning.

The cast is safe because the pointer was allocated by `malloc(1024)`,
and `malloc` is required to return a pointer with sufficient alignment
for anything the allocation can accomodate.

Nevertheless, this is a quick and dirty fix; the use of `png_bytep` in
the `png_struct` declaration of the pointer is machine-specific.  Other
architectures may need different types and, consequently, the only type
which is portable to other companies' CPUs is `(void*)`.

This is a cherry-pick of commit a604b12c112162bfb45a0476e956777f6ed82d85
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-27 16:54:09 +03:00
John Bowler
d288a1dd36 fix: Adjust colorspace calculations for ACES AP0
The subtracts in PNG_XYZ_from_xy are producing integer overflow with
some valid but extreme xy values.  This re-introduces the previous
checks, but with less limited bounds; sufficient to accomodate the
ACEScg end points (ACES AP1), but not for the ACES AP0 end points.
Those were not working anyway because libpng reads the cHRM parameters
as unsigned values, so they must always be at least 0.

A better solution requires recognizing reasonable negative values (ones
which violate the current spec) and allowing them too, at least on read.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-27 13:02:54 +03:00
John Bowler
0a27b48e94 [libpng16] mips: Eliminate use of non-ISO-C90 features
The MIPS MSA code contains // comments and the use of an "asm"
directive, neither of which are part of ISO-C90.  This removes the //
comments and converts asm to __asm__, which GCC allows.

The code compiles but maintenance is required; it's not clear it will
work on anything other than one specific compiler/isa combination.  It
should be rewritten using intrinsics, not assembler; as it stands it is
a security risk.

This is a cherry-pick of commit bd39ebbcfd64d785f907b5e8dd4055a97a34f2cf
from branch 'libpng18'.

Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-25 14:50:59 +03:00
Cosmin Truta
65cd5fa3e5 ci: Fix the configuration for Travis CI and AppVeyor CI 2024-09-24 22:12:25 +03:00
Cosmin Truta
f3a45ac2e9 [libpng16] chore: Update .gitignore
Ignore artifacts produced by IDEs such as Embarcadero RAD Studio,
JetBrains Fleet, Qt Creator, and possibly others.

Also update the list of artifacts produced by C/C++ workflows and
CMake workflows in Microsoft Visual Studio and Qt Creator.

This is a cherry-pick of commit 10c76f3a1a9096f9b7cf64dd7abf5035e379e47f
from branch 'libpng18'.
2024-09-24 17:25:37 +03:00
Cosmin Truta
d161ce6116 [libpng16] projects: Add a build launcher to the Visual Studio project
Add projects/vstudio/build.bat, a wrapper for `devenv [...] /build`.

This is a cherry-pick of commit f1c01b5c36fc4fdcd9238c5295cc5565a9caa43e
from branch 'libpng18'.
2024-09-24 17:24:38 +03:00
Cosmin Truta
b3bcbf9f82 [libpng16] projects: Adjust settings in the Visual Studio project
Adjust the warning levels across the entire solution in order to tidy
up the build log.

Also remove the vestigial macro definition _USRDLL and add the missing
macro definition _CRT_SECURE_NO_WARNINGS.

This is a cherry-pick of commit 719705a2ab932a353748371c2e57f39ebc4bb8a3
from branch 'libpng18'.
2024-09-24 17:23:47 +03:00
John Bowler
b8a0a5401f [libpng16] test: Fix "make check" in all branches beyond 'libpng16'
This corrects the checks to that libpng 10800 does not turn on the
enhanced transform checks in either pngvalid or pngstest.  The correct
fix is to change the 10700 code for comments which explain what aspect
or aspects of the transforms are broken (ideally) or at least state that
the transforms are broken.

This is a cherry-pick of commit aec888ab80f5d2241b3515b60f0f9337108fb624
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-20 23:47:36 +03:00
Cosmin Truta
529e69e76a Revert "oss-fuzz: Update the README file, the Docker file and the build script"
This reverts commit 3117b5f94a06aaf52a7365074e8199909680e52e.

A regression was introduced. (Oopsie!)

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-19 21:37:52 +03:00
Cosmin Truta
cd5e582fd6 Revert "oss-fuzz: Transfer to an external repo and remove from this repo"
This reverts commit b7276eca0182bb6ad174ef044bb5f6f0504451af.

Although the brand new pngfuzz repo is coming up next, it turned out
that the deletion of contrib/oss-fuzz/ from the 'libpng16' branch was
premature. (Oopsie!)

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-19 21:26:25 +03:00
Cosmin Truta
bcb3124141 [libpng16] ci: Update ci_lint.sh to recognize .editorconfig-checker.json
As the editorconfig-checker program is transitioning from using
the .ecrc config file to the .editorconfig-checker.json config file,
the older program versions do not recognize the new config file name.

Update ci_lint.sh to instruct editorconfig-checker to pick up its
configuration from the new config file name, regardless of the program
version.

Also update ci_lint.sh to instruct yamllint to check all *.json files,
including .editorconfig-checker.json.

This is a cherry-pick of commit 77f88338a19a223cc678e1a6a04888a31c78dabf
from branch 'libpng18'.
2024-09-17 19:14:28 +03:00
Cosmin Truta
cb08862674 [libpng16] chore: Set the indent_size fields in .editorconfig
Also add an .editorconfig-checker.json file. We need to instruct the
editorconfig-checker program to skip the checks for the indent size.
(As of this commit time, editorconfig-checker is too rigid to recognize
"smart indentations".)

This is a cherry-pick of commit 67c99f75cf05b354f89c01c8fc15948300e84143
from branch 'libpng18'.

Co-authored-by: John Bowler <jbowler@acm.org>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-17 19:14:28 +03:00
Cosmin Truta
18ab7d09dd [libpng16] chore: Reorganize and update .gitignore
Ignore the files and the directories that are typically produced by
text editors, development tools, development environments, etc.

This is a cherry-pick of commit 050aa7bb936c8889a41942b0b83f5db8582bce17
from branch 'libpng18'.
2024-09-15 20:26:18 +03:00
Cosmin Truta
68d7ce8040 ci: Get ready for the upcoming branch 'libpng18' 2024-09-14 22:41:01 +03:00
Cosmin Truta
c0f3dd43d8 doc: Update the README and TODO files 2024-09-14 22:35:51 +03:00
Cosmin Truta
222dd7ca49 doc: Make a small correction about branches in the libpng manual 2024-09-14 18:53:00 +03:00
Cosmin Truta
e3c7b26fbd ci: Fix bad (but innocuous) copy pasta in ci_verify_version.sh 2024-09-14 16:38:02 +03:00
Cosmin Truta
b7276eca01 oss-fuzz: Transfer to an external repo and remove from this repo
A new repository named "pngfuzz", dedicated to fuzz testing PNG
processing software in general and libpng in particular, has been
created:

https://github.com/pnggroup/pngfuzz

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-14 13:40:59 +03:00
Cosmin Truta
ef153d5325 Bump version to 1.6.45.git 2024-09-14 11:46:34 +03:00
Cosmin Truta
f5e92d7697 Release libpng version 1.6.44 2024-09-12 23:44:44 +03:00
Cosmin Truta
88ab4f592d chore: Rerun ./autogen.sh --maintainer 2024-09-12 21:44:11 +03:00
Cosmin Truta
3117b5f94a oss-fuzz: Update the README file, the Docker file and the build script 2024-09-12 18:26:10 +03:00
John Bowler
5a7e87fc04 fix: Prevent overflow in chromaticity calculations
In `png_xy_from_XYZ` X+Y+Z was calculated without checking for overflow.
This fixes that by moving the correct code from `png_XYZ_normalize` into
a static function which is now used from `png_xy_from_XYZ`.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-12 12:14:01 +03:00
Green Sky
8cc22a8c15 cmake: Fix an error in the declaration of target include directories
Properly declare target include directories for generated includes.
Previously the non targeted `include_directories()` was used, which
had issue when using the `png_static` target in a submodule.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-10 23:50:55 +03:00
Cosmin Truta
843dbb7579 Revert "cmake: Fix an error in the declaration of target include directories"
This reverts commit 1d1cc9ae18f677201bf7e47928c30562df967756.

The verification has failed. (Oopsie!)
2024-09-10 22:41:03 +03:00
Green Sky
1d1cc9ae18 cmake: Fix an error in the declaration of target include directories
Properly declare target include directories for generated includes.
Previously the non targeted `include_directories()` was used, which
had issue when using the `png_static` target in a submodule.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-10 22:03:13 +03:00
Cosmin Truta
1964d560e9 Deprecate PNGARG and remove all of its remaining uses 2024-09-10 19:15:13 +03:00
Mikhail Khachayants
68ba4f1f7d oss-fuzz: Add fuzzing targets for simplified READ API
New target added to libpng_read_fuzzer.cc for simplified READ API.
2024-09-09 23:45:06 +03:00
Benjamin Buch
0e204b7364 build: Add a CMake config file compatible with the FindPNG module
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-08 21:57:37 +03:00
Cosmin Truta
53a7f4e320 ci: Simplify the Travis CI configuration matrix
Going forward, we will continue to verify the cmake build and the
configure build with the hardware optimizations enabled by default,
and the makefile build with the hardware optimizations disabled by
default.

The Travis CI configuration file is simpler, and, more importantly,
the Travis CI verification process will be shorter and cheaper.
2024-09-08 15:58:08 +03:00
Cosmin Truta
fcdec9c66e chore: Delete contrib/tools/chkfmt.sh
Going forward, we will continue developing and using ci/ci_lint.sh
2024-09-08 15:35:10 +03:00
Cosmin Truta
222086586b chore: Pacify editorconfig-checker version 3.0 2024-09-08 15:22:58 +03:00
Ben Wagner
40878fd6dc fix: Restore STDERR in pngtest.c
In "test: Add consistency checks for the PNG_LIBPNG_VER* number" [0] the
`STDERR` macro was moved from outside an `ifdef` to inside an `ifdef`.
This broke the code in the `else` of this `ifdef` which also uses the
`STDERR` macro. Move `STDERR` back to where it was to avoid compile
errors in the `else` case.

[0] cc8006c48d

Fixes: #560
Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-08 10:47:44 +03:00
John Bowler
20f819c29e fix: Remove cHRM check to accomodate ACES AP1
ACES AP1 has a red endpoint with a negative Z, this triggers the checks
in libpng that ensure that x, y and z (chromaticities) are all >=0.
This removes the checks on the sign of the chromaticities since it is
valid to use negative values for any of them and converts the "internal"
error code return to external (because the internal cases correspond to
negative x, y or z.)

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-07 13:07:21 +03:00
Cosmin Truta
7e18d14296 ci: Add the targets/ subdirectory to facilitate cross-platform testing
Considering that a non-trivial amount of libpng code is arch-specific,
we should perform cross-platform builds (with cross-platform toolchains)
and test runs (on emulated architectures) in our routine verification.

The content of ci/targets/ shall consist of target description files,
written in the standard shell language. These files may be source'd as
needed, before running the verification scripts ci/ci_verify_*.sh.

Here is the initial list of target systems:
Android, Cygwin, FreeBSD, Linux, MSDOS, Windows.

And here is the initial list of target architectures:
ARM, MIPS, PowerPC, RISC-V, x86.
2024-09-05 22:23:30 +03:00
Eric Riff
43d6ad3e15 cmake: Honor CMAKE_SYSROOT if set
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-09-05 18:35:46 +03:00
Cosmin Truta
33ef48b6d6 cmake: Fix the handling of PNG_HARDWARE_OPTIMIZATIONS on FreeBSD/amd64
Because of a missing "amd64" string (in lowercase) in a regex match,
the CMake build was unable to pick up the PNG_HARDWARE_OPTIMIZATIONS
flag on FreeBSD/amd64 (and possibly other amd64 systems as well).

Rename the target arch variable from TARGET_ARCH to a more idiomatic
PNG_TARGET_ARCHITECTURE, and set it to an always-lowercase string.
The follow-on checks are now simpler and easier to get right.
2024-09-04 18:32:03 +03:00
Cosmin Truta
532fec0214 ci: Fix the verification of the msys2 toolchain on AppVeyor CI
Initialize the arch-specific MSYSTEM environment variable, to ensure
that msys2 bash picks up and executes /etc/profile correctly.

Install and use the host-specific cmake and ninja, to ensure that
msys2 cmake picks up the host-specific zlib build correctly.
2024-09-03 14:48:50 +03:00
Cosmin Truta
e4a31f024b arm: Add a placeholder file in lieu of the former filter_neon.S
In the previous commit 9e538750d99c8f1accf7e93878e4fde47c069908
we removed the obsolete assembler implementation `filter_neon.S`.

In this commit we add a stand-in for the original file, restoring
the original source tree structure, for the benefit of continuing
hassle-free libpng source upgrades in the 1.6.x line.
2024-06-17 15:28:38 +03:00
Ross Burton
9e538750d9 arm: Remove obsolete assembler implementation filter_neon.S
This file contains hand-coded assembler implementations of the filter
functions for 32-bit Arm platforms.  These are only used when the
compiler doesn't support neon intrinsics (added to GCC 4.3 in 2008) or
is exactly GCC 4.5.4 (released 2012), both of which are sufficiently
unlikely to be true that it's fair to say the assembler is no longer
used.

This commit deletes filter_neon.S and removes the now obsolete
preprocessor logic in pngpriv.h.

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-06-15 23:09:34 +03:00
John Bowler
ceed2a3cf6 SECURITY: disable build of filter_neon.S on arm
This fixes the bug https://github.com/pnggroup/libpng/issues/505
"libpng does not support PAC/BTI on aarch64 targets" which arises
because the build mechanisms (both cmake and configure) assemble
arm/filter_neon.S even though it ends up completely empty.  The empty
file effectively poisons the so that the PAC/BTI support gets disabled.

The fix is minimal; it simply removes arm/filter_neon.S from the list of
sources included in the 64-bit ARM builds build.  Note that this was
already done in cmake for MSVC - it's not clear whether this change was
a partial fix for the same issue.

This version of the fix ONLY affects aarch64 (arm64) builds; 32-bit ARM
systems can still invoke the assembler if required and, indeed, there
should be no change whatsover to those builds.

The assembler code could not be used on 64-bit systems in any case so
in practice there is no material change to 64-bit builds either.

TESTING: pull the changes then type "autoreconf" if using configure (not
required for cmake).

TESTS: cmake has not been tested because cross-builds with cmake
currently fail to find the zlib installation from the cmake system root
path.  The following has been tested with configure cross builds:

armv7-linux-gnueabi [no neon support]
armv7a-linux-gnueabi [no neon support]
armv7a-hardfloat-linux-gnueabi [neon support not enabled]
armv7a-hardfloat-linux-gnueabi -mfpu=neon [uses intrinics]
armv7a-hardfloat-linux-gnueabi -mfpu=neon
        -DPNG_ARM_NEON_IMPLEMENTATION=2 [uses assembler]
aarch64-linux-gnu [uses intrinsics]
aarch64-linux-gnu -DPNG_ARM_NEON_OPT=0 [neon support disabled]

Signed-off-by: John Bowler <jbowler@acm.org>
2024-05-31 10:18:28 -07:00
Cosmin Truta
f1848a3b56 Bump version to 1.6.44.git 2024-02-24 13:32:56 +02:00
Cosmin Truta
ed217e3e60 Release libpng version 1.6.43 2024-02-23 11:51:40 +02:00
Cosmin Truta
e1fa61daa8 ci: Add the libpng release tags to the list of exclusions
The release tags are redundant in the CI process. It is the main branch
that is always verified.
2024-02-23 11:12:03 +02:00
Cosmin Truta
80691b9da2 test: Fix a compiler warning in pngtest.c 2024-02-23 11:09:51 +02:00
Cosmin Truta
890231026d chore: Delete comments and config settings and stuff from here and there 2024-02-22 17:00:05 +02:00
Cosmin Truta
3b9a73ed3e doc: Review the libpng history and update scripts/cmake/AUTHORS.md 2024-02-22 16:47:51 +02:00
Cosmin Truta
e05ebfba7c doc: Update the README file 2024-02-22 12:30:50 +02:00
Cosmin Truta
ec2e58c16a pngexif: Import pngexifinfo as an externally-contributed project
We used this experimental project in the development of the PNG-EXIF
("eXIf") specification, back in 2017. The project evolved together
with the draft specification, which was finalized on 2017-Jun-15 and
approved by the PNG Group on 2017-Jul-13.

The EXIF specification, outside of the scope of PNG and libpng, is
quite complex. The libpng implementation cannot grow too much beyond
performing basic integrity checks on top of serialization. In order
to create and manipulate PNG-EXIF image files, the use of external
libraries and tools such as ExifTool is necessary.

Now, with the addition of contrib/pngexif to the libpng repository,
offline tasks like metadata inspection and linting can be performed
without importing external dependencies.
2024-02-22 11:32:53 +02:00
Benjamin Buch
7b888092b9 build: Mark the installed libpng headers as system headers in CMake
Modern compilers can disable the warnings that originate from system
headers. This change allows them to do so with the libpng headers.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-21 23:26:07 +02:00
Cosmin Truta
14a348ddc8 build: Checking for compiler support of LoongArch LSX should be guarded
In the configure script, checking whether the LoongArch LSX intrinsics
are supported by the compiler was done unconditionally, regardless of
the targetted host platform. Compared to how we support the other SIMD
platforms and compilers, this is rather unconventional.

We are placing this check under the guard of its own platform, for the
time being. A full solution, in line with the rest of the configure.ac
patterns concering SIMD optimizations, is TODO.

We also do an overall cleanup in the SIMD section of configure.ac, and,
finally, we regenerate the configure script.
2024-02-20 23:30:12 +02:00
Cosmin Truta
29e31f622f build: Add an explicit declaration of the AWK variable to configure.ac
Declare AWK explicitly via the AC_ARG_VAR directive, in order to make
it "precious", and to include it in the list of influential variables
at the end of the configure help text.

Rephrase a few comments and config traces.

Finally, regenerate the configure script.
2024-02-20 15:10:12 +02:00
Cosmin Truta
d165a20ae4 build: Improve the search for an AWK processor in the CMake build
Add nawk to the list of AWK-processing programs that are known to work,
and show the search result in the CMake log.
2024-02-19 20:51:26 +02:00
Cosmin Truta
aa95dee697 build: Update the CMake build options PNG_TOOLS and PNG_FRAMEWORK
Update the PNG_TOOLS option: set it to OFF by default when the
target is an embedded system, yet still allow it to be overridden.

Update the PNG_FRAMEWORK option: force it back to OFF and print a
warning if the option was ON but the target is not an Apple system.
2024-02-19 14:25:55 +02:00
Dan Rosser
e7ba9c0dfc build: Fix a CMake build regression introduced in version 1.6.41
This fixes commit 4edbb4da81626a7342a22824d7a8f60a3ea71bd0.

During the move of CMake scripts to the scripts/cmake/ subdirectory,
some of the workflows have been broken.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-19 11:19:52 +02:00
Cosmin Truta
6b5a2da072 Fix "ci: Fix the reporting in ci_lint.sh"
This fixes commit dddaf0c625a8daea4d027cb57380b7fac6f58285.

The way to reliably `find` executable files is different on BSD, Mac
and Linux, unfortunately.
2024-02-17 18:28:01 +02:00
Cosmin Truta
dddaf0c625 ci: Fix the reporting in ci_lint.sh
The variable `CI_LINT_COUNTER` was incremented inside subshells, but
remained unchanged in the main shell process. The errors detected by
the internal linters remained unreported by the main script. (Oopsie!)

Besides fixing this defect, considering that only a pass/fail status
is needed, we are replacing `CI_LINT_COUNTER` with `CI_LINT_STATUS`.
2024-02-17 16:32:21 +02:00
Cosmin Truta
72c4520d3c ci: Allow the user to force an in-tree cleanup before verification
Introduce the environment option CI_FORCE:
 * ci_verify_configure.sh is known to fail if an existing build
   configuration is found in the top-level directory.
   Setting CI_FORCE=1 will run `make distclean` before verification.
 * ci_verify_makefiles.sh cannot be reliably executed if random
   object files are found in the top-level directory.
   Setting CI_FORCE=1 will run `rm *.o *.obj` before verification.
 * ci_verify_cmake.sh is not known at this time to fail for similar
   reasons; but if it does, we will use CI_FORCE to trigger any
   necessary pre-build cleanup.
2024-02-17 11:56:35 +02:00
Cosmin Truta
0fa3c0f698 chore: Clean up the spurious uses of sizeof(png_byte); fix the manual
By definition, `sizeof(png_byte)` is 1.

Remove all the occurences of `sizeof(png_byte)` from the code, and fix
a related typo in the libpng manual.

Also update the main .editorconfig file to reflect the fixing expected
by a FIXME note.
2024-02-15 21:53:24 +02:00
Cosmin Truta
4191872d0d chore: Update the .editorconfig files and pacify editorconfig-checker 2024-02-15 18:29:26 +02:00
Cosmin Truta
42c8fcbff9 Add a GitHub Action for linting 2024-02-15 15:43:54 +02:00
Cosmin Truta
f74d5ecce8 ci: Pacify shellcheck version 0.8 and apply other linting improvements
Work around a limitation in the `shellcheck source` directive, which
does not recognize quotes in shellcheck versions older than 0.9.

Also extend the checks for YAML files over the entire source tree, in
preparation for the introduction of the GitHub Actions config file.
2024-02-15 14:37:24 +02:00
Cosmin Truta
fb65436e06 ci: Fix the check of PNG_LIBPNG_VER_BUILD in ci_verify_version.sh
`PNG_LIBPNG_VER_BUILD` should be zero for public releases and non-zero
for development versions. The ci_verify_version.sh script should check
this requirement as such.
2024-02-12 12:22:43 +02:00
Cosmin Truta
63c715b7d7 ci: Remove the workaround for CI_AR from ci_verify_makefiles.sh 2024-02-11 23:49:08 +02:00
Cosmin Truta
1cdde11877 build: Update the makefiles for the benefit of cross-compilation
Split AR_RC into AR and ARFLAGS. The variables AR and ARFLAGS are
de-facto standards (like CC and CFLAGS, LD and LDFLAGS, etc.) that
may be overridden when running make. Moreover, configuring CC, LD,
AR, etc., to point to a cross-platform compiler, linker, librarian,
etc., is a de-facto standard practice as well.

Also remove the MKDIR_P variable definitions from all makefiles.
They've been leftovers from the removal of the "install*" targets.
2024-02-11 23:14:09 +02:00
Cosmin Truta
8120345c89 ci: Update (again) the ci_verify_*.sh scripts; update .shellcheckrc
Apply stylistic improvements and remove a shellcheck exclusion.
2024-02-11 15:24:03 +02:00
Cosmin Truta
7a6148290f ci: Update the ci_verify_*.sh scripts.
Bring the coding patterns in line with the newest scripts.
2024-02-10 16:45:26 +02:00
Cosmin Truta
c6ee62af2e ci: Add ci_verify_version.sh
This program verifies the libpng source tree, expecting consistent
definitions of version numbers in the C source code, in the Autoconf
scripts, and in the CMake scripts.

The version verification is performed as follows. (Please note that
the version definitions in png.h are checked twice.)
 * The files png.h, configure.ac and CMakeLists.txt are checked by
   the ci_verify_version.sh program.
 * The files png.h, png.c and pngtest.c are checked by the pngtest
   program.
2024-02-09 18:00:24 +02:00
Cosmin Truta
46b79d4716 ci: Update and rename ci_lint_ci.sh to ci_lint.sh; update .shellcheckrc
The ci_lint.sh program can now lint the entire libpng source tree.
2024-02-08 21:37:42 +02:00
Cosmin Truta
49eeb1f8ba ci: Add ci_shellify.sh
This program can shellify png.h, configure.ac and CMakeLists.txt.
2024-02-08 19:17:33 +02:00
Cosmin Truta
366c9c6a24 ci: Reformat all scripts using 1TBS
One may truly embrace the stylishness of the One True Brace Style.
2024-02-06 16:20:33 +02:00
Cosmin Truta
920db2ecc0 api: Introduce the PNG_LIBPNG_VER_SHAREDLIB macro; update pngwin.rc
The version macros `PNG_LIBPNG_VER_SONUM` and `PNG_LIBPNG_VER_DLLNUM`
weren't always in sync, but they should be, going forward.

Or, better yet, we should keep them in, deprecated, and introduce
`PNG_LIBPNG_VER_SHAREDLIB` for all shared library builds of all kinds
on all platforms.

It is unknown how many user applications have been using these macros.
We have been using `PNG_LIBPNG_VER_DLLNUM` for pngwin.rc, for example.
Which, by the way, was last updated in 2009.
2024-02-05 21:54:19 +02:00
Cosmin Truta
cc8006c48d test: Add consistency checks for the PNG_LIBPNG_VER* numbers
Trigger a compile-time error in pngtest.c if there is any disagreement
among `PNG_LIBPNG_VER`, `PNG_LIBPNG_VER_MAJOR`, `PNG_LIBPNG_VER_MINOR`,
etc.
2024-02-05 21:31:23 +02:00
Cosmin Truta
aa9023bbd0 test: Remove compile-time option SINGLE_ROWBUF_ALLOC from pngtest.c
We have been running address-sanitized CI verifications for a while.
We can finally afford to simplify pngtest.c by removing a compile-time
option and the associated code branches that used to serve (only to a
limited extent) the purpose of bounds checking.

Also change the brief description of pngtest.c at the top of the file.
This is no longer just a simple test program.
2024-02-05 18:02:08 +02:00
Cosmin Truta
c9ac5bdba4 ci: Add a pre-build checkup stage to ci_verify_configure.sh
Also update comments and tracing printouts in ci/ci_*.sh
2024-02-04 21:53:15 +02:00
Cameron Cawley
ab6d97b7c8 build: Update and rename makefile.acorn to makefile.riscos
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-02 21:36:53 +02:00
Cosmin Truta
9138be341b Improve, refactor and clean up pngtest.c
Improve:
The pngtest program used to be rather relaxed upon seeing invalid
parameters in callbacks: it either ignored them, or it bailed out
of the callbacks, essentially sweeping the bug under the rug.
But no more. Now it terminates with a severe `png_error`, in which
it says what's broken and where.

Improve:
`PNG_DEBUG`, defined externally at build time, and defaulting to zero,
was assumed to be non-negative. Now it's checked.

Clean up:
In a very distant past, the pngtest program used to "travel" across
libpng versions, on its own, not necessarily accompanied by the actual
library version that it was meant to test. However, this stopped being
the case, and now is as good a time as any to remove the compatibility
workarounds that had made the aforementioned "travel" possible.

Other chores include:
 * The refactoring of the user-defined chunk handling routines;
 * The cleanup of an unnecessary use of volatile;
 * The various cosmetic improvements of code and comments.
2024-02-02 21:32:48 +02:00
John Bowler
ce1f1f001e API usage: add 'basic' configuration
This adds a new configuration file, 'contrib/conftest/basic.dfa' which
disables unused APIs on a test Linux-based system.  So support the
configuration several fixes were necessary in the test programs so that
the tests are skipped correctly when APIs are not available.

The configuration has been tested on a range of common Linux apps
including web browser code (qtwebengine), image processing code (e.g.
ImageMagick) and general display code (X11, Qt5 and Qt6, KDE).  Overall
this first step reduces libpng linked code and data size to about 2/3 of
the full configuration.

To use the new test simply copy basic.dfa to 'pngusr.dfa' in the root of
the source directory and build.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-02-02 13:24:02 +02:00
John Bowler
805ed7a2d4 Correct row width check in png_check_IHDR
This changes the mask used in the IHDR width check from ~7U to
~(png_alloc_size_t)7 which is a quantity at least as big as both
png_uint_32 and size_t whereas "7U" will be 16 bits on a 16 bit system.
The change both corrects a bug in the code (on 16 bit systems) and
removes compiler warnings about the test always being false on 64-bit
architectures.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-02-02 01:39:48 -08:00
guxiwei
2aebfb4aa9 loongarch: Add cmake support 2024-02-01 21:17:37 +02:00
Chris Blume
7f1f960d4f Add eXIf support to push mode
libpng already supports eXIf as of v1.6.31.
However, it seems like support was added for normal mode and not added
to push mode.

Notice PNG_READ_eXIfJSUPPORTED is in pngread.c:
https://github.com/pnggroup/libpng/blob/libpng16/pngread.c#L178
but is missing from pngpread.c:
https://github.com/pnggroup/libpng/blob/libpng16/pngpread.c#L274

This commit adds eXIf support to push mode.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-02-01 20:49:15 +02:00
John Bowler
59a68c83f0 Fix contrib/conftest/pngcp.dfa
This was broken by the corrections to the 'palette max' handling; if
that is disabled the test of num_palette_max must be removed in pnread.c

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-31 15:17:49 +02:00
Cosmin Truta
3bd304e5f4 chore: Split lines in scripts/*.awk to pacify the editorconfig checker 2024-01-31 15:02:42 +02:00
Cosmin Truta
f0c578748b chore: Fix a comment in pngrtran.c 2024-01-31 14:51:52 +02:00
Cosmin Truta
2d7da9db8a chore: Add .editorconfig files 2024-01-31 13:04:26 +02:00
Cosmin Truta
4356cb0709 Bump version to 1.6.43.git 2024-01-31 11:32:51 +02:00
Cosmin Truta
35d9f5ea52 Release libpng version 1.6.42 2024-01-29 22:51:33 +02:00
Cosmin Truta
31439b6b8d chore: Fix whitespace in pngpriv.h 2024-01-29 20:36:36 +02:00
Cosmin Truta
537c66660e chore: Fix and update the libpng manual
Fix various typos and whitespace errors, and clean up obsolete
formulations such as `(png_infopp)NULL`.

Bring all URLs up to date.
2024-01-29 17:53:21 +02:00
Cosmin Truta
ac944e2b36 Fix a regression introduced in "chore: Clean up the return statements"
This fixes commit 27e548af2518ff8d278b45c40d11ad1bdd68eaa0.

The macro `png_check_sig` has been deprecated and remained untested
for decades. And yet, somehow it escaped from all past API cleanups.

Also update the libpng manual.

Reported-by: Matthieu Darbois
2024-01-29 15:30:10 +02:00
Cosmin Truta
ba980b8f0c Release libpng version 1.6.41 2024-01-24 18:59:00 +02:00
Cosmin Truta
27e548af25 chore: Clean up the return statements and update example.c accordingly 2024-01-23 21:25:03 +02:00
Cosmin Truta
92b2128a75 chore: Add, relocate or rephrase debug statements, for better clarity 2024-01-23 02:33:54 +02:00
Cosmin Truta
6159bad8a9 ci: Relicense again the CI scripts, from Boost License to MIT License
Many build scripts, ports and other third-party add-ons that are
circulating around appear to be distributed under the MIT License.
Examples include the Vcpkg build system (including the libpng port)
and the Meson build definitions (including the libpng definition).

I am, therefore, relicensing our CI scripts once more, as the sole
author (so far), just in case that any of the CI code might travel
from/to such projects. Hopefully, this one last license will stick.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-22 23:55:18 +02:00
Cosmin Truta
3285bf0d4c ci: Add help options; add checks for the boolean environment options 2024-01-22 23:45:23 +02:00
Cosmin Truta
4edbb4da81 build: Move scripts/*.cmake.in to scripts/cmake/; add cmake/AUTHORS.md
From the libpng licensing point of view, the build projects, the build
scripts, the test scripts, the CI verification scripts, et cetera, have
not traditionally been part of libpng proper, although some of these,
including the CMake-based build, have been released under the libpng
license.

Considering how the CMake build grew as a result of many contributions
from many contributing authors over a long time, one may argue that it
almost became an individual piece of software in its own right.

Moving on, everything CMake-related shall be placed in the subdirectory
scripts/cmake/ (except, of course, the main CMakeLists.txt). Moreover,
contributing authors shall be acknowledged in scripts/cmake/AUTHORS.md.

Please see scripts/cmake/README.md for more information.
2024-01-22 17:24:59 +02:00
Cosmin Truta
9a774b9156 chore: Rerun ./autogen.sh --maintainer and update .gitignore
Bring the auto-generated scripts up to date with the autoconf upgrade
from version 2.71 to version 2.72.

Make the .gitignore exclusions better tailored to the autoconf- and
configure-generated artifacts.
2024-01-22 15:22:50 +02:00
Cosmin Truta
671661849a build: Move scripts/*.m4 to scripts/autoconf/
Move all Autoconf macro files (except for those that need to be in
the top-level directory) to their own subdirectory scripts/autoconf/

In this commit, we introduce a better way to organize the scripts dir,
and we make a better separation between the build scripts under the
libpng license vs. the build scripts that fall under other licenses.

Please see scripts/autoconf/README.md for more information.
2024-01-22 15:16:10 +02:00
Cosmin Truta
438a518611 Update the main AUTHORS file 2024-01-20 19:09:38 +02:00
John Bowler
8fb49b8b94 Relax pngtest-all message testing
Previously the 'make check' test pngtest-all looked for given messages
at EOL.  The match failed with Windows/MSYS2 because of the Windows
<cr><lf> line endings output by pngtest.  This changes the test to look
for the message anywhere in a line; this might give false matches but
the specific messages being searched for are not likely to cause this
problem.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 15:31:53 -08:00
John Bowler
144b348e07 Use --xfail for Adler32 check in pngtest-all
The test always failed on systems with no support for zlib
inflateValidate and on systems where the png_set_option setting was
disabled, however pngtest-all succeeded because the failure was ignored.
The latter is now fixed so the badadler.png check needs to use --xfail,
not --relaxed.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 11:10:00 -08:00
John Bowler
1a0d7a7481 Correct regression-palette-8.png
This corrects contrib/testpngs/badpal/regression-palette-8.png.  Despite
the comment in commit da109d3e the file checked in had 255 PLTE entries
so failed to perform the regression test.  This version of the PNG has
254 entries.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-19 08:55:56 -08:00
Adam Richter
866fdf6f8f Fix an off-by-one error in png_do_check_palette_indexes
The last byte of each row was ignored in a function that was executed
under the build flags `PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED` and
`PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED`.

This is a revert of a change previously applied in libpng-1.6.33beta01.
See SourceForge bug #269 at https://sourceforge.net/p/libpng/bugs/269/

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-19 17:45:27 +02:00
John Bowler
6f8257e437 tests/pngtest-all: detect failures add tests
This change is only verifiable in configure builds; cmake only executes
the basic test.

The previous version of tests/pngtest-all only returned the status code
of the final test.  Apparently it could never fail.  This adds checking
of all return status codes.

The change also adds a basic approach for regression testing with PNGs
that should fail a test; --strict ensures that PNGs which are valid do
not start to be reported as erroneous, this is the inverse.

At present the code (minimal traditional Bourne shell) only tests the
palette index checking code, a potentially important check if apps rely
on it.

The changes have been tested using the configure build both with a
regression which causes the libpng checking to cease to work and with a
corrected (reverted regression).  The regression test verifies that the
intended check works as expected.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-18 17:36:59 -08:00
John Bowler
269b753496 Do not build unused Adler32 code
This removes the default build of an undocumented feature to disable
Adler32 checksums on those systems where it was the default.

The PR is motived by github #187 however it fixes a much more general
problem (#187 is limited to an issue where libpng "crashes" on some
manufacturer systems).  The fix is based on a suggestion by @sgowdev who
is the originator of the issue.

When libpng disables the checking of Adler32 checksums it does so by an
undocumented and therefore possibly unsupported call to a zlib function
which does not exist in some versions of zlib.

Fortunately libpng only does this if the caller of libpng explicitly
asks for it to happen.  Unfortunately the call to the undocumented
function is still in the compiled and built libpng and this means that
on some systems (as identified in #187) libpng can fail to load or maybe
even crash.

The libpng authors are currently unaware of any program or system that
uses this feature and none has been identified by the contributors to

In this fix an option is added to *enable* the code so that by default
the code is *disabled* - this is a simple generalization of the
suggestion by @sgowdev.

BENEFITS: the problem is eliminated, users of the functionality, if any,
are idenfified, the functionality can be implemented correctly in the
future or it can be removed.  Hardly anyone complains.

COSTS: someone will complain that they have to enable an option in a
libpng build to use a feature that never worked consistently in the
first place.

This patch has been tested both with the option enabled and with it
disabled via pngusr.dfa.  Tests, checks pass with cmake and configure,
make distcheck passes on configure.

Reported-by: Stephen Gowen <dev.sgowen@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-18 23:57:06 +02:00
John Bowler
2b814cde29 Regression test for off-by-one palette check error
This adds a file to regression-test the previously introduced off-by-one
error in the check on read for a colormapped PNG with an out-of-range
index (equal or greater than the length of the PLTE).

Previous tests covered all cases except the 8-bit palette case; the
"small" test file contains the "bad" entry at index 254, not 255 so it
passes even if the final byte is not checked.  The new file has the
erroneous entry in the last byte.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-18 23:17:51 +02:00
Zixu Wang
893b8113f0 Fix unused platform check and configuration for macOS
In a similar manner as zlib (https://github.com/madler/zlib/pull/895),
libpng contains a header configuration that's no longer valid and
hasn't been exercised for the macOS target.

- The target OS conditional macros are misused. Specifically
  `TARGET_OS_MAC` covers all Apple targets, including iOS, and it
  should not be checked with `#if defined` as they would always be
  defined (to either 1 or 0) on Apple platforms.
- `#include <fp.h>` no longer works for the macOS target and results
  in a compilation failure. macOS ships all required functions in
  `math.h`, and clients should use `math.h` instead.

This problem has not been noticed until a recent extension in clang
(https://github.com/llvm/llvm-project/pull/74676) exposed the issue
and broke libpng builds on Apple platforms. The failure can be
reproduced now by adding `#include <TargetConditionals.h>` before the
block.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-18 22:24:30 +02:00
Cosmin Truta
7ec2bd28c7 Update the main Authors file 2024-01-18 18:13:38 +02:00
gxw
70d10da35c MIPS: Fixed undefined MSA interfaces
When compiling on the MIPS platform using the following command:
./configure --enable-hardware-optimizations && make
The options '-mmsa -mfp64' are not being passed.
PNG_MIPS_MSA_IMPLEMENTATION is defined as 2, leading to
the initialization of unimplemented MSA interfaces.
2024-01-18 18:13:23 +02:00
gxw
064f992187 Loongson: Fixed compilation warnings for undefined macros. 2024-01-18 17:58:38 +02:00
gxw
46f1106a3f Loongson-mips: Fixed typo 2024-01-18 10:24:57 +08:00
Cosmin Truta
a7fe3414e5 mips: Wrap up the MIPS/Loongson port and acknowledge the contributors
Completion of this port required a rerun of `./autogen.sh --maintainer`
followed by a rebuild of scripts/pnglibconf.h.prebuilt.
2024-01-17 23:24:05 +02:00
gxw
ce4b632dd7 Optimize png16 with loongson mmi for 64-bit os 2024-01-17 22:46:16 +02:00
jinbo
6b0d1bd75b Add loongarch support and LSX SIMD optimizations
Enable LSX by default:
    ./configure && make

Disable LSX:
    ./configure --enable-loongarch-lsx=no && make

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-17 22:42:02 +02:00
Cosmin Truta
2a4f0f5aee De-volatilize the internal implementation of png_safe_execute
`png_safe_execute` called `setjmp` in a context where the result was
undefined (an assignment statement). This corrects the code and removes
volatile statements that were introduced previously to quell warnings
from earlier versions of GCC.

Co-authored-by: John Bowler <jbowler@acm.org>
2024-01-17 18:06:47 +02:00
Cosmin Truta
7dacc4d5aa Rewrite various initializations for the benefit of various compilers
Mark the initialization of `png_signature[]` as static const inside the
function `png_sig_cmp`. This might be helpful to optimizing compilers.

Initialize the arrays `number_buf[]`, `digits[]` and `buffer[]` inside
the functions `png_convert_to_rfc1123_buffer`, `png_ascii_from_fixed`,
`png_warning_parameter_unsigned` and `png_warning_parameter_signed`.
Although these initializations are redundant, compilers such as gcc-13
fail to see the redundancy.
2024-01-17 16:59:38 +02:00
John Bowler
da109d3e6e Improve test coverage with a "correctly" damaged palette index test
The PNG IDAT did not include a '255' entry, the highest entry is '254',
this corrects the test PNG to have a palette with only 254 entries so
that it triggers the palette index checks.

Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2024-01-17 12:43:31 +02:00
John Bowler
f9348b77da write palette check corrections
The write palette check is off-by-one when checking the maximum palette
index against the number of entries however, because of the
implementation, the simple correction would fail if no palette check had
been performed (for example for a non-palette image).  This corrects
both errors so that the code outputs a warning (but not an error) if a
user of libpng writes an image with a PLTE which is one entry short.

The write palette check can be turned off on colour type 3 images
(colour mapping images) but this is done by setting the 'maximum'
palette index in the image to (-1).  The ammended code works because it
only executes for paletted images, it is dependent on palette checks
being compiled in and they will always be checked unless the stored
'max' value is less than 0.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-16 16:15:23 -08:00
John Bowler
2ea11e2235 Palette index checking fixes
The palette index checking function is called by default but only if
some *other* transformation is happening.  This makes the 'get palette
max' public API disfunctional (sometimes it works, sometimes it returns
0) and causes the supposed default behaviour of checking the palette
index only to work sometimes.  It works in pngtest, it doesn't work in
pngcp.

The check in pngread also has an off-by-one error; the number recorded
is the highest index found so it should be checked to ensure that it is
less than the palette length but it was checked for being greater.

The pull request includes a set of 8 files which all have the full range
of possible indices including one (the highest) which is invalid because
the PLTE chunk is one short of the maximum for each bit depth.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-16 14:59:02 -08:00
John Bowler
b60316f4ee Remove GCC7.1 arithmetic overflow fixup
This removes pragmas and the controlling code that quelled warnings
generated by GCC7.1 (only) with -Wstrict-overflow=3 and possibly other
levels.  Tested with GCC13.2, GCC7.1 is no longer the current version of
GCC7 (GCC7.5) and GCC7.1 was replaced by GCC7.2 on August 14, 2017.

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-15 21:42:05 +02:00
John Bowler
050ce505e4 pngfix: del workround for GCC7.1 -Wstrict-overflow
Previously pngfix had been made warning-free in GCC7.1 by marking auto
variables (volatile).  This prevented the arithmetic optimizations which
caused warnings from GCC7.1 with higher values -Wstrict-overflow=<n>

GCC has moved on a lot since 7.1 and pngfix.c now compiles with just one
warning using -Wstrict-overflow=5.  The change includes a change to make
this go away by performing the rearrangement GCC was using in the code:

   i == ndigits-1

becomes:

   i+1 == ndigits

i is initialized to ndigits and has been decremented at least once so
this is fine.

Test, configure:

  CFLAGS="-Wall -Wextra -Wno-maybe-uninitialized -Wstrict-overflow=5" \
    ../configure --enable-werror
  make
  make cehck

Test, cmake:

  cmake ..
  make
  make test

Signed-off-by: John Bowler <jbowler@acm.org>
2024-01-15 09:50:24 -08:00
John Bowler
2a23247420 pngcp: remove GNU setjmp warning workround
Prior versons of the GCC warned about the 'dest' parameter of
contrib/tools/pngcp.c not being volatile, which isn't necessary because
it isn't modified.  This removes the GCC specific fixup.

The function which calls setjmp, cppng() also relied on undefined
behavior because it assigned the result of setjmp() to a variable; this
is not one of the four uses of setjmp permitted by ANSI-C.  This passes
the result previously returned by longjmp via (struct display).  It's
very very unlikely that any compiler could have got the code wrong but
it is technically undefined.
2024-01-14 15:47:20 -08:00
Cosmin Truta
6b241f3786 Do not rely on INT_MAX in png.h
At a certain step in the configuration process, `gcc -Wundef`
complained about using `INT_MAX` without a definition in png.h,
which is easily fixable with an include.

We would rather not add any extra dependencies to png.h, however,
so we use some unsigned int arithmetic magic instead.
2024-01-12 01:12:08 +02:00
Cosmin Truta
b3521c60af pngminus: Delete the incomplete output files upon premature termination
Defer the program termination on error until all files are closed and
(if applicable) all incompletely-written output files are deleted.

In addition, perform the following maintenance tasks:
 * Rename and document the internal helpers used by the functions
   `png2pnm` and `pnm2png`.
 * Unset the executable permission bits for the *.bat test programs.
2024-01-09 18:54:02 +02:00
Cosmin Truta
6beae586d6 pngminus: Expect all image transformations to be available in libpng
The pngminus programs use several PNG image transformations:
`png_set_expand`, `png_set_expand_1_2_4_to_8`, etc. (in png2pnm.c);
`png_set_packing`, `png_set_invert_mono`, etc. (in pnm2png.c).
The availability of all of these transformations in libpng is now
required at compile time.

On the topic of transformations, apply an unrelated fix to the use
of `png_set_gamma`.
2024-01-09 00:33:39 +02:00
Cosmin Truta
bdbbcaa457 pngminus: Improve and modernize the PNG processing
Improve and modernize png2pnm.c:

 * Remove the explicit reading of the input PNG file signature.
   Libpng is now able to read it, check it, and issue an appropriate
   error message in case of magic number mismatch or file corruption.
   (See the function `png_read_sig`.)

 * Remove the explicit allocation and dealocation of the image data.
   Libpng is now able to manage all the image data automatically.
   (See the function `png_read_png`.)

 * Specify the needed image transformations without a-priori checking
   the image type for applicability.

 * Use the `png_set_expand_gray_1_2_4_to_8` transformation.
   Since libpng version 1.2.9, this transformation (if needed) must
   be enabled separately from `png_set_expand`.

Improve and modernize pnm2png.c:

 * Modify the allocation of image data, in order to match libpng's
   internal allocation model.

 * Transfer the ownership of the image data from the `pnm2png` function
   to libpng, which will manage and dealocate it at the right time.
   (See the functions `png_set_image_rows` and `png_data_freer`.)

Refactor, clean up, etc.
2024-01-08 20:31:18 +02:00
Cosmin Truta
abb8d4a71f pngminus: Fix and improve the PNM processing
Improve png2pnm.c:

 * Add support for writing 16-bit raw PNM image files.

Fix and improve pnm2png.c:

 * Add support for reading 16-bit raw PNM image files.

 * Fix the parsing of arbitrarily long numeric strings.
   In the parsing of PNM tokens, we can and we should avoid storing
   more than one leading '0' in the token buffer. All valid (in-range)
   numeric strings must fit in this limited-size buffer, regardless of
   their actual length in the input file.

 * Refactor the PNM parsing in order to make it more capable to handle
   various kinds of input file errors.

 * Remove the volatile qualifiers from all variable declarations.
   Their original purpose was to appease old (and incorrect) warnings
   issued by ancient optimizing compilers.

 * Print a note about the program's lack of support for the PAM ("P7")
   file format when the input is in this format.

 * Add FIXME notes about the need to signal incorrect or incomplete
   input files. (For png2pnm, this is done inside libpng.)
2024-01-08 14:14:33 +02:00
Cosmin Truta
c993ae4c67 pngminus: Update CMake file; rename test scripts; add .gitignore
Raise the minimum required CMake version to 3.5.

Add the configuration option `PNGMINUS_USE_SYSTEM_PNG` for compiling
and linking with the system libpng library instead of the internal one.

Remove the old configuration option `PNGMINUS_USE_STATIC_LIBRARIES`.
When using the internal libpng (via `PNGMINUS_USE_SYSTEM_PNG=OFF`),
simply enforce static linking and produce single-file executables.

Rename the scripts "png2pnm.sh" (etc.) to "test_png2pnm.sh" (etc.),
to make it obvious that they are test drivers, not program launchers.

Add a .gitignore file for project-specific build and test artifacts.
2024-01-05 19:59:07 +02:00
Cosmin Truta
6abf8c1e91 Fix the API comment about png_data_freer
The old note about this function being unlikely to work correctly was
likely incorrect.
2024-01-03 21:13:59 +02:00
Cosmin Truta
0dfe422e9f Update the copyright year 2024-01-02 21:25:55 +02:00
John Bowler
71b9b5e16e pngfix: ensure fclose happens last on file close
This reverts the code to a variant of my old style of doing an 'fclose'
correctly and adds comments explaining why it is so difficult.  Thanks
to @ihsinme for pointing out the error on github.com

Signed-off-by: John Bowler <jbowler@acm.org>
2023-12-30 11:06:34 -08:00
Stephen Kitt
9f9f8d8e63 Fix bashisms
makepngs.sh relies on a Bash feature in one of its case statements,
";;&"; this should be made explicit in the shebang.

intgamma.sh declares a function in a manner which may fail in non-Bash
sh implementations, this patch uses the correct syntax.

Based on a patch by Roflcopter4:
https://github.com/joncampbell123/dosbox-x/pull/3850

Signed-off-by: Stephen Kitt <steve@sk2.org>
2023-12-27 12:53:48 +02:00
Cosmin Truta
437b24a958 mips: Fix the build for generic ANSI C89 compilers
The <stdint.h> header is a standard C99 header, and a MIPS-specific
header, but it is not a standard C89 header. It should not be included
until ensuring that the code being compiled is MIPS-specific.
2023-12-20 21:09:27 +02:00
Sui Jingfeng
2ed5a70bca mips: Implement the run-time MIPS MSA discovery function correctly
The old implementation of png_have_msa() caused a bus error,
if a word in /proc/cpuinfo was longer than 10 characters.

In the original implementation, `word[10]` was too short, and
`word[i++] = ch` caused a stack smash if the characters between
spaces were more than 10.

And also, fclose(f) should be called before leaving.

For example on loongson ls3a4000 cpu platform:

$ cat /proc/cpuinfo

system type             : Generic Loongson64 System
machine                 : loongson,loongson64g-4core-ls7a
processor               : 0
cpu model               : ICT Loongson-3 V0.1  FPU V0.1
BogoMIPS                : 3594.02
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 2112
extra interrupt vector  : no
hardware watchpoint     : no
isa                     : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2
ASEs implemented        : vz msa loongson-mmi loongson-cam loongson-ext loongson-ext2
shadow register sets    : 1
kscratch registers      : 6
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
processor               : 1
cpu model               : ICT Loongson-3 V0.1  FPU V0.1
BogoMIPS                : 3611.26
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 2112
extra interrupt vector  : no
hardware watchpoint     : no
isa                     : mips1 mips2 mips3 mips4 mips5 mips32r1 mips32r2 mips64r1 mips64r2
ASEs implemented        : vz msa loongson-mmi loongson-cam loongson-ext loongson-ext2
shadow register sets    : 1
kscratch registers      : 6
package                 : 0
core                    : 1
VCED exceptions         : not available
VCEI exceptions         : not available

Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-20 21:09:27 +02:00
Cosmin Truta
85f866dea3 cmake: Enable policy CMP0074 for ZLIB_ROOT; deprecate PNG_BUILD_ZLIB
Although the minimum required CMake version is 3.6, this policy will
only have effect under CMake 3.12 or newer.

Reported-by: Jacob Harding <54728054+jacobharding@users.noreply.github.com>
2023-12-20 19:12:42 +02:00
Cosmin Truta
2fff013a69 cmake: Raise the minimum required version to 3.6 and use its features
Use the `CMAKE_HOST_SOLARIS` variable, introduced in CMake 3.6, and
raise `cmake_minimum_required` accordingly.
2023-12-13 20:24:33 +02:00
Cosmin Truta
acfd50ae0b cmake: Clean up functions, string operations, regular expressions, etc.
Remove the inclusion of the external module `CMakeParseArguments`.
Function argument parsing became a first-class feature in CMake 3.5.

Delete the function `find_symbol_prefix`. It is no longer used.

Use variables instead of strings in string operations where possible.
Prevent CMake from getting confused by string values that might be
accidentally identical to unrelated keywords.

Clean up spurious `.*` sequences in regex matching operations.

Rephrase a comment.
2023-12-11 20:51:06 +02:00
Cosmin Truta
8fc13a8704 cmake: Enable the libpng framework build by default on Apple systems
The PNG_FRAMEWORK option used to be off by default. It was possible to
turn it on, regardless of the underlying operating system, but doing so
outside of an Apple OS broke the libpng build.

PNG_FRAMEWORK is now on by default, conditionally defined on Apple
systems only, and it is ignored (without breaking the build) elsewhere.

Other minor changes have also been applied.
2023-12-08 23:22:39 +02:00
Timothy Lyanguzov
1460b3ce78 cmake: Use Zlib as a package
1. automatic linking of the library and add include directory
2. properly specify include directories

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-08 14:57:36 +02:00
Cosmin Truta
e1088f99d4 Redo "cmake: Fix CPU architecture regexes"
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 23:17:56 +02:00
Cosmin Truta
d65b3ebf00 Revert "cmake: Fix CPU architecture regexes"
This reverts commit 9c1dc4d13dab823d6441d417546ebeee3994389b.

The new regex for Intel can match "x86_64", but it fails with "x86".
Moreover, the new regex for MIPS needs more testing on all MIPS ISAs.

Reported-by: Clinton Ingram <clinton.ingram@outlook.com>
2023-12-07 23:17:56 +02:00
Clinton Ingram
a3d1a35b98 cmake: Don't add Unix ASM file to the ARM-specific source list for MSVC
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 16:11:12 +02:00
Cosmin Truta
9c1dc4d13d cmake: Fix CPU architecture regexes
Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-12-07 16:11:12 +02:00
Cosmin Truta
e755fb79ba ci: Quick-fix ci_verify_cmake.sh
Avoid using `cmake --option=value` and `ctest --option=value`, to stay
compatible with older versions of CMake.
2023-10-19 00:26:54 +03:00
Cosmin Truta
f79c85e22d Update the configuration for Travis CI and AppVeyor CI
Update the Travis CI matrix:
 * Run ASan and UBSan unconditionally on FreeBSD and Linux, and
   not at all on Mac.
 * Remove the `CI_NO_TEST=1` runs from the environment column.

Update the AppVeyor CI matrix:
 * Replace `CI_NO_TEST=1` with `CI_CMAKE_VARS=-DPNG_TESTS=0` when
   testing Visual Studio on ARM64.

Also apply minor stylistic changes.
2023-10-18 22:31:49 +03:00
Cosmin Truta
53d2188fa5 ci: Update the support for cross-build verifications; refactor
Rename `CI_HOST_ARCH` and `CI_HOST_SYSTEM`, to `CI_BUILD_ARCH` and
`CI_BUILD_SYSTEM`, following the nomenclature used by GNU Autotools.
Unfortunately, the word "host" has confusingly opposite meanings in
CMake (and Bazel, etc.) vs. Autotools (and Meson, etc.)

Remove `CI_TARGET_TRIPLET` and `CI_TARGET_ABI` (for now).

Introduce the function `ci_expr` as a fast and easy equivalent of
`expr >/dev/null`.

Rephrase the assertions using an implementation pattern that is more
expressive, yet (arguably) just as readable. Remove `ci_assert`.

Modify the main functions to display more useful information in case
of usage error.
2023-10-18 19:36:38 +03:00
Timothy Lyanguzov
f2294569cf Use CMake 3.5 features
1. Set `cmake_minimum_required` to 3.5
   (see https://cmake.org/cmake/help/latest/release/3.27.html)
2. Specify the version of CMake project
3. Remove the redundant call to `cmake_policy`
4. Use `CMAKE_INSTALL_BINDIR` and `CMAKE_INSTALL_INCLUDEDIR`
5. Use private library linking for tools and test programs
6. Don't activate testing if it was not enabled

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-10-02 23:24:00 +03:00
Tyler Kropp
1547b335e4 cmake: Fix copying targets on Windows in multi-config build systems
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-10-02 00:00:03 +03:00
Cosmin Truta
b2ef6edbe8 cmake: Rename PNG_EXECUTABLES to PNG_TOOLS
For the sake of consistency with a recent addition to the configure
script, the option name PNG_EXECUTABLES (introduced in libpng-1.6.38)
shall become PNG_TOOLS.

PNG_EXECUTABLES is still maintained as a deprecated option, allowing
the applications that use it to be built without modification, but a
deprecation warning will be issued.
2023-08-03 21:08:29 +03:00
Cosmin Truta
5a6ea1822b configure: Rerun "./autogen.sh --maintainer" 2023-08-02 21:42:10 +03:00
Cosmin Truta
22ad62c25e configure: Rename the recently-added options
Rename
    --enable-png-tests/--disable-png-tests
    --enable-png-tools/--disable-png-tools
to
    --enable-tests/--disable-tests
    --enable-tools/--disable-tools
respectively.

While the `PNG_` prefix is necessary in CMakeLists.txt, a corresponding
`--...-png-` option qualifier would be redundant in a configure script.
2023-08-02 21:42:10 +03:00
Carlo Bramini
71475b064f configure: allow to disable building of tools and test
This PR adds two set of options to the configure script:
    --enable-png-tests/--disable-png-tests
and
    --enable-png-tools/--disable-png-tools

By using this feature, a user will be allowed to build only library if
needed, which will be useful on platforms not able to build the tools
and/or the tests.
This PR leaves the existing behaviour as default setting, by building
both the tools and the tests if the options are not used.

CMakeLists.txt already supports this feature with the options PNG_TESTS
and PNG_EXECUTABLES. After this commit, Autotools will provide the same
feature.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-08-02 17:39:36 +03:00
Cosmin Truta
ee9d6d7bf2 ci: Improve the support for cross-build verifications
Introduce CI_TARGET_TRIPLET and CI_TARGET_ABI.

Rename CI_HOST_MACHINE and CI_TARGET_MACHINE, respectively, to
CI_HOST_ARCH and CI_TARGET_ARCH, following on the conventional
target triplet nomenclature.

Introduce CI_BUILD_SYSTEM and CI_BUILD_ARCH, following on the
GNU Autotools (host/build/target) practice and nomenclature.

Ensure that CI_TARGET_SYSTEM, CI_TARGET_ARCH and CI_TARGET_ABI
are all initialized when verifying a cross-platform build.

Work around an obscure CMake error by ensuring that CMake variables
(CMAKE_AR and CMAKE_RANLIB) are initialized to the full executable
paths of their CI_* equivalents (CI_AR and CI_RANLIB).

Implement other general-purpose improvements:
 * Check all CI_NO_* variables in an arithmetic context, to allow
   setting them explicitly to zero in external configurations.
 * Label the assertions with descriptions of what's being asserted.
 * Add more comments and tracing printouts.
2023-07-30 17:07:25 +03:00
Cosmin Truta
f8e5fa92b0 ci: Fix ci_verify_cmake.sh; improve ci.lib.sh
Fix ci_verify_cmake.sh: sync up CI_BUILD_TO_INSTALL_RELDIR with
CI_INSTALL_DIR. (Oopsie!)

Replace slashes, backslashes and dots with underlines in system
names and machine hardware names. These names are now included in
the output directory naming scheme.
2023-07-09 12:27:51 +03:00
Cosmin Truta
c81516e943 ci: Fix bad copy pasta in ci_verify_configure.sh 2023-07-08 23:46:53 +03:00
Cosmin Truta
0b7bc40de1 ci: Introduce CI_HOST_* and CI_TARGET_*
Replace CI_SYSTEM_NAME and CI_MACHINE_NAME with CI_HOST_SYSTEM and
CI_HOST_MACHINE, respectively.

Introduce CI_TARGET_SYSTEM and CI_TARGET_MACHINE, defaulting to
CI_HOST_SYSTEM and CI_HOST_MACHINE, respectively.

Use CI_TARGET_SYSTEM and CI_TARGET_MACHINE in the naming scheme of
target build and install directories, in order to allow concurrent
verification builds for multiple cross-platform targets.
2023-07-04 19:40:05 +03:00
Cosmin Truta
82414985c1 ci: Add ci_lint_ci.sh and .shellcheckrc
Add ci_lint_ci.sh for linting the CI config files and scripts.
The linting is based on yamllint and shellcheck.
2023-07-04 00:12:32 +03:00
Cosmin Truta
c0616f1017 ci: Add ci.lib.ch; update ci_verify_*.sh accordingly
Move the common declarations and initializations from ci_verify_*.sh
to ci.lib.sh, and update them as follows:
 * Simplify the ci_ function names.
 * Refactor the CI_ variable names:
    - Add the new variable CI_TOPLEVEL_DIR.
    - Rename the variables CI_SCRIPTNAME, CI_SCRIPTDIR, etc.,
      to CI_SCRIPT_NAME, CI_SCRIPT_DIR, etc.
    - Rename the variables CI_SRCDIR_FROM_BUILDDIR, etc., to
      CI_BUILD_TO_SRC_RELDIR, etc.
 * Add new functions inside ci.lib.sh:
    - Replace ci_err with ci_err_usage, ci_err_fatal, ci_err_internal.
    - Add the new functions ci_warn and ci_assert.
 * Simplify the ci_ function names inside ci_verify_*.sh.
2023-07-03 22:59:24 +03:00
Cosmin Truta
c741d1e392 ci: Relicense the CI scripts to the Boost Software License version 1.0
Fetch LICENSE_BSL_1_0.txt from http://www.boost.org/LICENSE_1_0.txt
and update the copyright notice in all ci_* scripts.

Append "SPDX-License-Identifier" tags after each copyright notice;
see https://github.com/david-a-wheeler/spdx-tutorial/#spdx-tutorial
2023-07-03 19:14:33 +03:00
Cosmin Truta
ad9e42a877 Add .yamllint.yml, a configuration file for yamllint 2023-07-03 13:38:40 +03:00
Cosmin Truta
d7f77bf271 Bump version to 1.6.41.git 2023-06-26 11:09:17 +03:00
Cosmin Truta
f135775ad4 Release libpng version 1.6.40 2023-06-21 22:06:40 +03:00
Cosmin Truta
afc6c595bf Fix a build regression on Solaris
Fix a regression introduced in commit aeb26da4cb64c0e75c8d.

On an Illumos test machine, running the GCC compiler and the Solaris
link editor, the CMake build failed with the following error:

    ld: fatal: unrecognized option '--version-script=/.../libpng.vers'

The fix consists in avoiding the use of CMAKE_SHARED_LIBRARY_C_FLAGS
in version script checks on Solaris.

Also clean up the surrounding code, as follows:
 * Rename CMAKE_REQUIRED_FLAGS_SAVE to _SAVED_CMAKE_REQUIRED_FLAGS.
   (The name of an internal variable should not begin with "CMAKE_".)
 * Reformat the version script to optimize the vertical space.
2023-06-21 21:08:40 +03:00
Cosmin Truta
e6c5bf46c4 Ensure that only one eXIf chunk is written in the entire datastream
EXIF data can be stored in an eXIf chunk before IDAT, or after IDAT,
but the entire PNG datastream may contain one eXIf chunk at most.

Introduce the private mode flag PNG_WROTE_eXIf, which is meant to be
used like the PNG_WROTE_tIME flag. The eXIf chunk and the tIME chunk
have the same ordering rules (i.e. no constraints are imposed), and
the same multiplicity rules (i.e. no multiples are allowed), and they
should be initialized and checked using the same algorithm.

This fixes commit cd03aaf7bf0e0c748b8c6cb34a56b402b40d61d0,
previously reverted in 3d57708c9166419b7f5e0bbda2f7a2149112c844.

Reported-by: Ben Bullock <benkasminbullock@gmail.com>
2023-06-21 16:16:07 +03:00
Wan-Teh Chang
8be5c147d5 Don't report a valid tRNS chunk if it was canceled
Add special handling of the PNG_INFO_tRNS flag to png_get_valid() to
not report a canceled tRNS chunk as valid.

Fix https://github.com/glennrp/libpng/issues/482

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-06-20 19:20:38 +03:00
Cosmin Truta
f7abe3c419 Avoid a memory leak when allocation of a pCAL buffer fails
Set the PNG_FREE_PCAL flag immediately after the allocation of the
first pCAL buffer, so that, if any one of the subsequent allocations
fail, all pCAL buffers still get deallocated by png_free_data.

Also reorder the initialization of other PNG_FREE_ flags (without
altering the semantics) to improve the overall consistency inside
the pngset.c module.

Co-authored-by: Philippe Antoine <contact@catenacyber.fr>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-06-20 15:09:36 +03:00
Jesús González
82097c2108 Fix a doc typo in pnglibconf.dfa
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-16 15:34:29 +02:00
Cosmin Truta
e519af8b49 cmake: Allow overwriting the debug postfix of library filenames
Users may opt to change the debug suffix, e.g., from "d" to "_debug".

Rather than making CMAKE_DEBUG_POSTFIX a cache variable (which is
an antipattern in CMake), we introduce a new cache variable, named
PNG_DEBUG_POSTFIX.

Suggested-by: Diego Barrios Romero <eldruin@gmail.com>
2023-02-12 22:31:11 +02:00
Cosmin Truta
efc96c9d59 cmake: Redo the fix for Clang support on Windows
Redo commit 70fda1837d5de802ce5f7e04be239192b6a74d92, with a redesign.

Define the variables PNG_SHARED_OUTPUT_NAME and PNG_STATIC_OUTPUT_NAME
for the benefit of the OUTPUT_NAME target properties of, respectively,
the shared libpng build and the static libpng build. Fix and improve
not only Clang, but also other Windows toolchains, such as Embarcadero.

Rename the variable PNGLIB_SHARED_SOVERSION to PNG_ABI_VERSION.
The applicability of this variable, which is much wider than the old
name used to suggest, includes the definitions of PNG_*_OUTPUT_NAME.

Delete the confusingly-named variables PNGLIB_NAME and PNG_LIB_NAME,
and rename PNG_LIB_TARGETS to PNG_LIBRARY_TARGETS.

Set the macros _CRT_SECURE_NO_DEPRECATE and _CRT_NONSTDC_NO_DEPRECATE,
for all compilers that use MSVC run-time library headers. Currently,
these compilers are MSVC and Clang/Windows.

Add or improve the comments that accompany user-serviceable variables
and options.

Co-authored-by: B. Scott Michel <scooter.phd@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-12 17:22:08 +02:00
Cosmin Truta
aab24fa1b3 Clean up CMakeLists.txt
* Rename the target `png` to `png_shared`. The main targets are now
   named `png_shared`, `png_static` and `png_framework`.
 * Rename the function symbol_prefix() to find_symbol_prefix().
 * Rename the prefix `S` to `_SYM` in the function create_symlink().
 * Rewrite the precondition checks in the function create_symlink().
 * Add precondition checks to the function generate_copy().
 * Delete the vestigial property CLEAN_DIRECT_OUTPUT.
 * Delete the variables PNG_LIB_NAME_STATIC and PNG_LIB_NAME_FRAMEWORK.
 * Initialize and use PNG_LIB_TARGETS consistently as a list.
 * Move all include() commands to the top of the file.
 * Acknowledge a former contributor.
 * Reformat.
2023-02-08 19:44:31 +02:00
Jeremy Maitin-Shepard
efa9c2e920 cmake: Rename the custom targets to have the png_ prefix
This avoids taget namespace pollution when including libpng as a
sub-project.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-08 17:10:52 +02:00
Cosmin Truta
c22ef3b2e3 Revert "cmake: Fix the Clang support on Windows"
This reverts commit 70fda1837d5de802ce5f7e04be239192b6a74d92.

Fixing Clang on Windows is important. However, in the previous fix,
the name of the compiled libpng library file was changed, incorrectly,
on all platforms except Windows. A proper fix will follow up.
2023-02-07 17:49:06 +02:00
Cosmin Truta
66fede80d2 ci: Update the CI scripts
Apply the following changes:
 * Update CI_BUILDDIR and CI_INSTALLDIR to reflect the new script
   names.
 * Introduce CI_SRCDIR_FROM_BUILDDIR and CI_INSTALLDIR_FROM_BUILDDIR
   to the cmake build, to ensure that the Windows tools can handle
   native Windows paths correctly when executed via Bash-on-Windows.
 * Stop guessing and using CI_SRCDIR_NATIVE and CI_INSTALLDIR_NATIVE
   in the cmake build, since we now have a better solution.
 * Show the ninja program version in ninja-based cmake builds.
 * Move the cleanup of previous builds into separate functions, and
   do it in a cleaner manner. No pun intended.
2023-02-05 17:09:00 +02:00
Cosmin Truta
59fa76e164 ci: Add CMake+Ninja+Clang to the AppVeyor CI matrix 2023-02-04 20:33:23 +02:00
B. Scott Michel
70fda1837d cmake: Fix the Clang support on Windows
Fix a build error that occurs with the Ninja code generator and the
Clang compiler on Windows:

    ninja: error: build.ninja: multiple rules generate png16.lib

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-02-03 16:32:32 +02:00
Gunther Nikl
aeb26da4cb cmake: Use CMAKE_SHARED_LIBRARY_C_FLAGS in version script checks
Building the version script test executable may fail in the link step
with GNU ld as linker like this:

  ld: final link failed: Nonrepresentable section on output

Building the test excutable with CMAKE_SHARED_LIBRARY_C_FLAGS makes the
test succeed with GNU ld since this adds -fpic/-fPIC.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-01-31 22:25:23 +02:00
Jon Creighton
cd0ea2a7f5 Fix for universal binaries on macOS
Fix the issue of a
    clang: error: no such file or directory: 'x86_64'
error on building universal binaries on macOS.

It is also necessary to specify:
    -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Example CMake command:
    cmake -S libpng \
          -B build_libpng \
          -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
          -DCMAKE_C_FLAGS="-DPNG_ARM_NEON_OPT=0"

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2023-01-09 19:55:04 +02:00
Cosmin Truta
9923515ff4 Update the copyright year 2023-01-09 19:50:00 +02:00
Cosmin Truta
61bfdb0cb0 Update the configuration for Travis CI and AppVeyor CI
Simplify the test matrix on Travis CI to reduce the testing time.

Use CI_CMAKE_TOOLCHAIN_FILE on AppVeyor CI.
2022-11-29 12:38:45 +02:00
Cosmin Truta
9db8cff6ef ci: Fix verification under Cygwin Bash + CMake + Visual Studio; update
Fix autodetection and use of the cygpath executable on Windows.

Add a new variable CI_CMAKE_TOOLCHAIN_FILE to ci_verify_cmake.sh.
This should help in future cross-platform testing.

Remove the implicit initialization of CI_CC, CI_LD and CI_LIBS from
ci_verify_makefiles.sh. This should help the testing of default values
of their respective make variables (CC, LD and LIBS).
2022-11-27 21:58:07 +02:00
Cosmin Truta
b445aade83 ci: Rename the ci_* scripts
Give the CI scripts new names that better reflect what they do, and
make room for activities such as linting or dependency installation:
 * Rename ci_autotools.sh to ci_verify_configure.sh.
 * Rename ci_cmake.sh to ci_verify_cmake.sh.
 * Rename ci_legacy.sh to ci_verify_makefiles.sh.

Also rename CI_LEGACY_MAKEFILES to CI_MAKEFILES.

Update the config files for Travis CI and AppVeyor CI accordingly.
2022-11-27 21:05:42 +02:00
musvaage
3c152a8ef7 Fix typos
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-27 17:39:19 +02:00
Cosmin Truta
5a0b7e9c29 manuals: Remove references to libpngpf(3); update links
From libpng-1.5.0 onwards, the private libpng functions are no longer
accessible to the libpng users, and the content of libpngpf(3) is no
longer relevant.

Update links, introducing the new canonical location of the libpng
source repository:
https://github.com/pnggroup/libpng
2022-11-27 16:20:31 +02:00
Cosmin Truta
b126f80710 Reorganize and update the README file; add Markdown formatting 2022-11-27 16:20:31 +02:00
Cosmin Truta
3c761b5135 Bump version to 1.6.40.git 2022-11-27 13:10:35 +02:00
Cosmin Truta
07b8803110 Release libpng version 1.6.39 2022-11-20 23:53:23 +02:00
Cosmin Truta
32f465a66b Update the file list in README 2022-11-20 23:53:23 +02:00
Paul Eggert
074e2eaab0 configure: Fix possible regressions with trunk autoconf (vs 2.71)
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-20 23:20:10 +02:00
John Bowler
790fef342b tools: Fix a memory leak in pngcp
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-20 23:03:43 +02:00
Alberto Barbaro
8a5732fcb3 tools: Fix a buffer overflow involving a file name in pngfix
Reported-by: Guoxiang Niu (@niugx), EaglEye Team
Reported-by: Riccardo Mori <patacca@autistici.org>
Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-20 22:28:03 +02:00
Cosmin Truta
77c3a39299 Clean up comments and whitespace characters in source files
Remove all remaining "last changed" version info from source comments.
(The version control system maintains this information automatically.)

Delete the trailing whitespace characters.
2022-11-20 21:23:33 +02:00
Cosmin Truta
8cfdb5436d Clean up oss-fuzz
With the caveat that oss-fuzz needs a full sync with upstream, here
are the changes applied to our old copy:
 * Add a missing #include directive.
 * Remove the "last changed" version info.
 * Clean up the trailing whitespace.

Co-authored-by: Ilya Yegorov <hkctkuy@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-20 21:13:14 +02:00
Cosmin Truta
f6036c0aeb Update, rename and clean up various scripts
Rename contrib/tools/chkfmt to contrib/tools/chkfmt.sh; refactor:
 * Increase the max line length for contrib/**/*.[ch] from 96 to 100.
 * Set the max line length for ci_*.sh to 100.
 * Use `basename $0` instead of the hard-coded script name.
 * Update comments.

Remove contrib/tools/reindent. For automated code formatting, including
indentation, we need a robust solution.

Add an empty line after the hashbang line in all scripts.

Remove the "last changed" version info from comment headers.
(The version control system maintains this information automatically.)
2022-11-20 20:21:41 +02:00
Cosmin Truta
689e06516b Clean up vestigial uses of png_size_tp 2022-11-20 17:51:33 +02:00
Cosmin Truta
33de006e12 Turn large PNG chunks into benign errors
Import Chromium commit
e87a029871

Add the author to the list of libpng contributing authors.

Portions from the original commit message follow:

***

A recent change to libpng [1] (included in Chromium with the recent
libpng update [2]) turns chunks that are bigger than
PNG_USER_CHUNK_MALLOC_MAX into failures. Although this matches the
intent of PNG_USER_CHUNK_MALLOC_MAX, it also causes images which used to
be viewable in Chromium to fail. Changing to a benign error allows us to
display these images once again. Though it means we do allow libpng to
allocate more than PNG_USER_CHUNK_MALLOC_MAX, it matches the behavior
prior to [2] (when we were using 1.6.22), and it does not regress
crbug.com/117369

[1] 347538efbd
[2] f82653a473

***

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=827754
Co-authored-by: Leon Scroggins III <scroggo@google.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-20 00:56:35 +02:00
tangyaofang
9b5488054b Fix comments
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-11-16 01:51:34 +02:00
Felix Hanau
04c016d79f scripts: Fix the remaining instance of ZLIB_INCLUDE_DIR 2022-10-23 23:10:07 +03:00
Cosmin Truta
b8ca9108ac arm: Add a compile-time assertion about PNG_ARM_NEON_CHECK_SUPPORTED
Following up on the previous commit by Martin Storsjö:

If the availability of ARM Neon is not only known at compile time,
but also expected by the compiler's target architecture, there should
be no further need for a run-time check. In fact, such a check would
be counter-productive.
2022-10-12 12:42:09 +03:00
Martin Storsjö
e56f79c0c6 cmake: Default to PNG_ARM_NEON=off for arm targets
This matches the configure script - unless the user has requested
anything, no hardware optimizations are autoenabled.

Defaulting to "check" is brittle (that configuration is deprecated
and poorly supported) - and for configurations where it would
make sense (where NEON isn't universally enabled in the compiler)
it didn't end up setting ARM_NEON_OPT to 1 in pnglibconf.h anyway.

This fixes default builds with cmake for iOS and Windows on armv7,
where NEON is universally available (but there's no runtime check
implemented) - but actually using NEON on this architecture
requires explicitly opting in to it when configuring, just like
with the configure script.

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-10-12 12:35:33 +03:00
Cosmin Truta
12222e6fbd scripts: Add missing makefile.clang reference to README.txt 2022-09-18 23:51:58 +03:00
Cosmin Truta
9b65ad49d3 scripts: Remove the support for "install" targets from all makefiles
In most of the legacy makefiles (with only a few notable exceptions
such as makefile.linux), the "install" targets have been broken since
libpng-1.5.0beta01. Specifically, the "install-shared" targets produced
incorrect library names, due to a missing symbol in the definition of
the LIBSOREL macro.

Rather than correcting this long-standing and long-untested error, we
decided to remove the support for "make install" altogether, from all
legacy makefiles. Further use of "make install", "make install-static"
or "make install-shared" will fail with an error message.

Going forward, the only tested and supported manners to install libpng
shall be the conventional build and install procedures driven by the
configure script or by the CMake file.
2022-09-18 19:37:40 +03:00
Cosmin Truta
3f991d5092 scripts: Remove makefile.cegcc
It is obsolete and unlikely to be still working
2022-09-18 16:26:26 +03:00
Cosmin Truta
b422bc1181 .gitignore: Ignore the autoreconf artifacts 2022-09-18 11:35:35 +03:00
Cosmin Truta
6fc5119423 Bump version to 1.6.39.git 2022-09-17 13:36:12 +03:00
Cosmin Truta
0a158f3506 Release libpng version 1.6.38 2022-09-14 22:42:00 +03:00
Cosmin Truta
50d7a85154 Acknowledge the contributors of bug fixes applied to the EXIF support
Considering that the EXIF support is part of the core libpng library
(which excludes scripts, tests, and other independent programs), its
contributors should be acknowledged in the AUTHORS file.
2022-09-14 22:00:42 +03:00
Cosmin Truta
2733482d8e Fix a last-minute bug in the checking of the EXIF byte-order header
The check should fail if the EXIF byte-order header doesn't start with
a correct character, or if the two heading characters aren't identical.

Rewrite the check to make the code logic easier to follow.
2022-09-14 22:00:42 +03:00
Cosmin Truta
3d57708c91 Revert "Remove second call to write_eXIf"
The second call to png_write_eXIf should not have been removed.

The first call to png_write_eXIf is for writing the eXIf chunk that is
positioned before IDAT, while the second call is for writing the eXIf
chunk that is positioned after IDAT.

TODO:
Implement a correct fix which consists in ensuring that there are no
eXIf chunks simultaneously before and after IDAT.

This reverts commit cd03aaf7bf0e0c748b8c6cb34a56b402b40d61d0.
2022-09-14 22:00:42 +03:00
Cosmin Truta
abccfd7968 .gitignore: Update 2022-09-14 21:56:47 +03:00
Cosmin Truta
823ef44f01 scripts: Remove leftover references to the ci_* scripts from README.txt 2022-09-14 21:56:47 +03:00
Cosmin Truta
d72cda543c ci: Trace the paths of executable files found on the build machine
Also add markers to trace the boundaries of configuration and build
steps.
2022-09-14 21:56:47 +03:00
Cosmin Truta
3c67eeca51 scripts: Add makefile.emcc for building libpng with Emscripten
Adapt makefile.clang to invoke the Emscripten toolchain utilities.

Co-authored-by: Kirk Roerig <mr.possoms@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
2022-09-14 21:50:02 +03:00
Cosmin Truta
b60656ecdc scripts: Disable the hardware-optimized compilation in legacy makefiles
Fix the legacy makefile builds on ARM, MIPS and PowerPC, where
hardware-optimized compilation was enabled by default in the generic
source files, but without including the machine-specific source files.

Delete scripts/makefile.linux-opt.
2022-09-14 21:35:33 +03:00
Cosmin Truta
c64655d058 scripts: Set the compiler warning options to "-Wall -Wextra -Wundef"
Considering that "-Wextra" is a more descriptive alternative to "-W",
and that "-Wundef" is a highly useful warning option that has been
available in ancient versions of gcc (version 2.x), we replace all
occurrences of "-W -Wall" with "-Wall -Wextra -Wundef".

Also clean up the makefiles.
2022-09-14 21:18:20 +03:00
Cosmin Truta
8b7b99c1db scripts: Clean up the logging in makefile.std and pnglibconf.mak
The console logs produced by these scripts should be easy to follow,
especially on CI bots.

Delete the unnecessary macros ECHO and SED.
Add a new macro MV_F (for "mv -f"), alongside RM_F (for "rm -f").
2022-09-14 11:53:47 +03:00
Cosmin Truta
62c027d4df Fix handling incorrect hIST chunks of uneven size
The hIST chunks, used for storing image histograms, contain arrays of
16-bit unsigned integers, and the chunk size is expected to be an even
number. Raise a png_chunk_benign_error() if a hIST chunk fails to meet
this expectation.

Reported-by: Eugene Kliuchnikov <eustas@google.com>
2022-09-14 11:30:14 +03:00
Cosmin Truta
e9e9801a84 Simplify the definition of png_isaligned and avoid compiler warnings
The following pointer subtraction was unnecessary:
((const char*)(ptr)-(const char*)0)

In order to avoid further warnings about casting a wide pointer type
to a narrower integer type, we cast the pointer to the target integer
type through (size_t).

Also fix a comment and reformat the surrounding code.
2022-09-14 11:07:36 +03:00
Cosmin Truta
0c2388cdae projects: Delete the definition of _WINDOWS from the VStudio project
The _WINDOWS macro should not be defined on a modern Windows platform.
This macro was predefined by 16-bit Windows compilers only.
2022-09-14 08:54:57 +03:00
Cosmin Truta
9cb84c4cb9 Delete vestigial declarations formerly used on 16-bit platforms
Delete the structure members used in the 16-bit Turbo C memory models.
Delete the PNG_ABORT declaration used in the 16-bit Windows build.

Stop checking macros (e.g. _WINDOWS) predefined by 16-bit Windows
compilers (but do check the __NT__ macro, which was the only one
predefined by ancient Windows NT compilers).
2022-09-14 08:54:57 +03:00
Cosmin Truta
8c542ad9df arm: Do not allow PNG_ARM_NEON_CHECK_SUPPORTED on ARM64
ARM Neon is expected to be unconditionally available on ARM64.
Issue an #error if PNG_ARM_NEON_CHECK_SUPPORTED is defined on an
ARM64-based platform.

For the plain ARM platforms where ARM Neon checking is not yet
implemented, issue a slightly more descriptive #error, including
a suggested course of action.
2022-09-14 00:42:48 +03:00
Cosmin Truta
2abaf81e0f arm: Avoid compiler warnings in palette_neon_intrinsics.c
Use correct int types; wrap PNG_UNUSED around unused arguments.
2022-09-14 00:12:11 +03:00
Vadim Zeitlin
ad0245bb96 Avoid -Wundef for MIPS and PPC symbols too
This is similar to d532334ef (Avoid -Wundef warnings when building
libpng, 2017-11-13), but for the similar symbols used under the other
architectures: always define them, even if just as 0, to avoid gcc
warnings when comparing them with 0 later.
2022-09-14 00:12:11 +03:00
Vadim Zeitlin
1f974dd2a9 Avoid -Wundef warnings for PNG_ARM_NEON_IMPLEMENTATION
Define this symbol as 0 instead of leaving it undefined when not using
ARM NEON optimizations.

No real changes, but just avoid a bunch of

"PNG_ARM_NEON_IMPLEMENTATION" is not defined, evaluates to 0 [-Wundef]

warnings when building the library.
2022-09-14 00:12:11 +03:00
Sami Boukortt
3ec225dd41 Fix a memory leak in png_set_tRNS
This leak was discovered by OSS-Fuzz.

The old structure of the code was along the lines of:

  allocate trans_alpha;
  if (problem) {
    // Jumps away from this function
    png_warning("tRNS chunk has out-of-range samples for bit_depth");
  }
  mark trans_alpha as to-free;

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-13 14:11:33 +03:00
Cosmin Truta
36bd1bbd54 Fix a crash in png_convert_from_time_t with an invalid time_t argument
This bug was found by FUTAG, a program for generating automated
fuzz-targets of libraries.

TODO:
Implement a safe function, alternative to png_convert_from_time_t,
which takes a png_ptr argument and raises a png_error if the time_t
argument is invalid.

Reported-by: Tran Chi Thien <thientc@ispras.ru>
Reported-by: Shamil Kurmangaleev <kursh@ispras.ru>
2022-09-13 13:49:02 +03:00
Cosmin Truta
0406deb1ca Fix private macro png_constcast; delete private type png_ptruint
In order to appease the compiler warnings that might affect the uses
of png_constcast, it should be sufficient to cast the source pointer
type to (const void*), and then to (void*), and then to the destination
pointer type. An intermediate cast through an integer type, such as
(png_ptruint), should not be needed.
2022-09-13 01:54:17 +03:00
Peter Kasting
5f5f98a1a9 Fix an instance of -Wunused-but-set-variable.
Bug: chromium:1203071
2022-09-13 01:49:33 +03:00
xmuli
f10c6bb603 Add spaces around '/*' and '*/'
Like most other Qt coding styles, the necessary spaces should be added
to the sides of '/*' and '*/'
2022-09-13 01:37:02 +03:00
luz paz
f16427e58e Fix various typos
Found via `codespell -q 3 -S ./ltmain.sh,./scripts/libtool.m4 -L ake,ans,ba,bloc,crashers,doed,inout,lengthh,maked,paeth,parm,parms,redy,unx`
2022-09-13 01:35:28 +03:00
Cosmin Truta
6aff792b66 projects: Update the README file of the Visual Studio project 2022-09-13 01:23:52 +03:00
Gabor Kertesz
ed8840a36f projects: Add ARM64 to Visual Studio project 2022-09-13 01:23:52 +03:00
Gabor Kertesz
efdb24e54b projects: Fix C2220 warning errors for VS2019
It sets warning level lower and not treat as errors because of
C2220 warnings are escalated to errors in Visual Studio 2019.
2022-09-13 01:23:52 +03:00
Gabor Kertesz
1f20bc1e85 projects: Upgrade to Visual Studio 2019 2022-09-13 01:23:52 +03:00
Gabor Kertesz
bbab57105b scripts: Add makefile for win-arm64
This makefile is based on makefile.vcwin32, but includes Neon
intrinsic optimization.

Co-authored-by: Gabor Kertesz <gabor.kertesz@linaro.org>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-13 01:23:52 +03:00
Gabor Kertesz
a1a81cc2ac Fix arm neon config for win-arm64 with MSVC
Fixes #398
It adds win-arm64 as an arm64 platform, by using a define which
is set to 1 for compilations that target 64-bit ARM processors,
otherwise undefined.
2022-09-13 01:23:52 +03:00
Cosmin Truta
c3a1d8424c Update INSTALL 2022-09-13 00:56:32 +03:00
Samanta Navarro
eda0f47f46 Fix typo in libpng manual 2022-09-13 00:34:27 +03:00
Cosmin Truta
3848c73ab4 cmake: Refactor the PNGLIB variables that define the versioning scheme 2022-09-12 13:50:32 +03:00
Cosmin Truta
dd8db8105c cmake: Fix the shared build on Android
The ld version script should not be generated on Android.

Co-authored-by: Volker Krause <vkrause@kde.org>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 23:50:49 +03:00
Cameron Cawley
763c77e628 cmake: Fix compilation on systems without libm
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 22:31:28 +03:00
Christopher Sean Morrison
840af2eda6 cmake: Fix the build on Unix with source files checked out on Windows
The issue is that, by default, Git for Windows checks out text files
with CRLF line endings. This is a problem for awk, which is expecting
Unix-style LF line endings. When cloning on Windows and attempting to
compile on WSL, Mingw or Cygwin, there may be an error from awk.

The fix is to leverage CMake's ability to configure a file and perform
EOL conversions. We copy the awk scripts from the source directory to
the build directory. This portable method ensures they have LF endings,
and the build logic is updated to use the build directory version.

Intentionally avoiding .gitattributes to avoid setting precedent.

Co-authored-by: Christopher Sean Morrison <brlcad@gmail.com>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 22:02:00 +03:00
Owen Rudge
8a354b41e9 cmake: Fix cross-compilation on macOS
Co-authored-by: Owen Rudge <owen@owenrudge.net>
Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 21:31:13 +03:00
Cosmin Truta
0fe598d2f6 cmake: Rename the target "symbol-check" to "scripts_symbols_chk"
Follow the general conventions for naming CMake targets.
2022-09-10 20:45:21 +03:00
Gleb Mazovetskiy
cbf8c64b58 cmake: Correctly handle generated files
Generated files depend on other generated files, and this previously
resulted in the same custom command output being a dependency of
multiple other custom commands without a shared custom targets.

Adds a top-level target for each generated file and ensures that
commands that depend on generated files also depend on the corresponding
custom targets.

Per CMake documentation:

> Do not list the output in more than one independent target
> that may build in parallel or the two instances of the rule
> may conflict (instead use add_custom_target to drive the command
> and make the other targets depend on that one).

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-10 20:39:05 +03:00
Cosmin Truta
6a42bc1c8e configure: Initialize PNG_ARM_NEON_OPT and PNG_MIPS_MSA_OPT correctly 2022-09-05 21:03:20 +03:00
Cosmin Truta
9e32b6f1ad Rerun "./autogen.sh --maintainer" 2022-09-05 17:30:06 +03:00
Cosmin Truta
cc0e959722 Clean up configure.ac
Remove the obsolete autoconf macros:
AC_C_CONST, AC_HEADER_STDC, AC_TYPE_SIZE_T, AC_FUNC_STRTOD.

Clean up comments and whitespace.
2022-09-05 17:30:06 +03:00
Dan Field
403422674d Remove obsolete/incorrect __LLVM,__asm section
Contributed-by: Dan Field <dnfield@google.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2022-09-05 13:46:00 +03:00
Cosmin Truta
bfb0abe4d9 Update the configuration for Travis CI and AppVeyor CI
Apply the following changes:
 * Add FreeBSD (besides Linux and Mac) to the Travis CI testing.
 * Use cc instead of clang for Xcode in the Travis CI testing.
 * Upgrade the Windows test image from Visual Studio 2019 to
   Visual Studio 2022 for AppVeyor CI.
2022-09-04 20:21:30 +03:00
Cosmin Truta
081e6751ab ci: Update the CI scripts
Apply the following changes:
 * Set CI_CMAKE_GENERATOR to "Ninja" by default in ci_cmake.sh.
 * Set CI_CC to cc by default in ci_autotools.sh.
 * Rename CI_SYSNAME to CI_SYSTEM_NAME; add CI_MACHINE_NAME.
 * Apply other minor changes and fixes.
2022-09-04 19:41:33 +03:00
Cosmin Truta
103f8346e3 cmake: Set PNG_ARM_NEON to "on" by default on ARM64
Avoid build failures on all ARM64-based non-Linux systems.
PNG_ARM_NEON can be set to "check" on Linux/ARM32 only.
2022-08-26 03:27:42 +03:00
Cosmin Truta
723b2d9f2e Update the copyright year 2022-08-26 03:12:35 +03:00
Cosmin Truta
b7ea74c97d Update the copyright year 2021-03-15 20:23:26 -04:00
Cosmin Truta
8c3fdb0ac1 ci: Update the CI scripts
Implement the following updates:
 * Add CI_SYSNAME and set it to `uname -s`.
 * Set the default CI_CC value to "clang" on all BSD systems.
 * Replace CI_SRCDIR_REL_BUILDDIR and CI_INSTALLDIR_REL_BUILDDIR
   with CI_SRCDIR_NATIVE and CI_INSTALLDIR_NATIVE.
   The former variables were hard-coded and error-prone; the new
   variables are computed and safe to use.
2021-03-15 20:23:26 -04:00
Ben Bullock
a37d483651 Eliminate spaces between function name and ( 2021-03-13 02:37:00 -05:00
Ben Bullock
3796518809 Remove duplicate line 2021-03-13 02:37:00 -05:00
Ben Bullock
8ca01083d6 Fix typo in README 2021-03-13 02:37:00 -05:00
Ben Bullock
cd03aaf7bf Remove second call to write_eXIf
The second call to write_eXIf doesn't check whether the first call
succeeded; no other chunks except tIME and the text chunks seem to be
doubled like this.

The second call causes the eXIf chunk to incorrectly be written twice.
2021-03-13 02:37:00 -05:00
Qiang Zhou
c4bd411c35 Fix decode fail on image with invalid eXIf chunk 2021-03-13 02:10:50 -05:00
Kleber Tarcísio
2224c8ea7b Add a check to pngimage.c
Check the result of png_get_IHDR inside the compare_read function.

Contributed-by: Kleber Tarcísio
Signed-off-by: Cosmin Truta
2021-03-13 01:56:32 -05:00
Cosmin Truta
e2bb5e7512 contrib: Apply various fixes to libtests
pngimage.c:
Initialize sig_bits on a NOTREACHED path to avoid warnings about using
uninitialized variables.

pngstest.c:
Enlarge buffers and fix signedness to avoid legitimate warnings about
potential buffer overflows.

pngunknown.c:
pngvalid.c:
Use NULL instead of 0 for pointers and apply other style fixes.

makepng.c:
tarith.c:
Apply various style fixes.

Also remove the "last changed" version info from source comments.
The version control system maintains this information automatically.
2021-03-12 22:54:32 -05:00
Cosmin Truta
d6e13b2acd .gitignore: Add 2020-12-31 04:08:35 -05:00
Cosmin Truta
c2e2cd2ec5 ci: Fix the Visual Studio verification on AppVeyor CI
The Unix paths in Bash do not mix well with the Windows paths in CMake.
The uppercase and the lowercase environment variables do not mix well
in MSBuild. Et cetera.

On AppVeyor CI, verification of Windows builds with the Visual Studio
toolchain used to work, perhaps due to one or more lucky coincidences,
but it stopped working after an upgrade on the AppVeyor CI site.

Update ci_cmake.sh as follows:
 * Use POSIX commands like "mkdir" and "rm" instead of CMake commands
   like "make_directory" and "remove_directory".
 * Avoid using absolute paths in the CMake command line; use relative
   paths that are accessible from both Bash and Windows.
 * Clean up incidental mixtures of Windows and Bash-on-Windows
   environment variables like {$TEMP,$Temp,$temp} and {$TMP,$Tmp,$tmp}.
2020-12-31 03:29:11 -05:00
Cosmin Truta
c3f209178b ci: Recognize more CI_ variables for better cross-platform verification
For ci_autotools.sh, customize CPP, CPPFLAGS, AR, RANLIB, LD, LDFLAGS
via CI_CPP, CI_CPP_FLAGS, CI_AR, CI_RANLIB, CI_LD, CI_LD_FLAGS.

For ci_cmake.sh and ci_legacy.sh, customize AR, AR_RC and RANLIB via
CI_AR and CI_RANLIB.

Rewrite portions of ci_legacy.sh to match the style of ci_cmake.sh.
2020-12-31 00:41:01 -05:00
Cristian Rodríguez
dbe3e0c43e libpng.pc.in: zlib dependency is private
zlib should be injected only when pkgconfig is ran with the --static
option.
2020-05-24 23:28:35 -04:00
Cosmin Truta
2f753e260c ci: Verify the install target
Add support for the install target in ci_autotools.sh and ci_cmake.sh.
Also add the environment option CI_NO_INSTALL.
2020-05-24 22:09:45 -04:00
Cosmin Truta
f5d5f5ae0e cmake: Refactor the install target; reformat
Use standard CMake variables in the install target.
Reformulate comments and error messages.
Move all CMake keywords in front of their arguments.
Fix indentation.
2020-05-24 22:01:40 -04:00
Cosmin Truta
3676fd324a ci: Add a new top-level directory, dedicated for CI verification
Update the ci_*.sh scripts and move them to the more conventional
ci/ directory. Update .appveyor.yml and .travis.yml, as well as
the AUTHORS file, accordingly.

Speed up ci_cmake.sh: add "-DPNG_TESTS=OFF" to the list of CMake
variables if CI_NO_TEST is true.

Remove "sudo: false" from .travis.yml.

Refactor .appveyor.yml.
2020-05-18 21:30:30 -04:00
Alex Gaynor
28c0f8895e cmake: Add an option to enable/disable building of executables
Add the CMake option PNG_EXECUTABLES (on by default) in order to
allow or disallow the building of non-essential executable programs
associated with libpng.

Contributed-by: Alex Gaynor <alex.gaynor@gmail.com>
Contributed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2020-05-18 18:46:32 -04:00
Cosmin Truta
87378bc21d mips: Remove "last changed" version information from source comment
This information is maintained by the version control system.
2020-05-17 20:26:28 -04:00
gxw
6c6f7d105a mips: Fix initialization: always close "/proc/cpuinfo" 2020-05-17 20:26:28 -04:00
Simon Hausmann
6842c58adc Fix CMake build with Emscripten
When building with Emscripten, linkage to libm is neither required
nor working. As find_library will fail, M_LIBRARY will be set to
NOTFOUND and the build would fail later. The build works just fine
without libm linkage.
2020-05-17 20:13:17 -04:00
Dan Field
a6fc80300f Add an __LLVM,__asm section for clang builds on ARM 2020-05-17 20:00:46 -04:00
Steve Robinson
5e8b45c436 cmake: Fix a build error on iOS
Avoid the awk-based configuration when cross-compiling from macOS
to iOS.
2020-05-17 19:50:18 -04:00
Zack Middleton
6dd99ca9c8 Fix example.c 2020-04-27 01:27:07 -04:00
willson-chen
52ee167644 Fix a warning on Linux caused by _BSD_SOURCE
I got a warning while compiling under Ubuntu 18.04 and gcc 7.4:
"__BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

Quote from the Linux Programmer's Manual:
"To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and
_DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings,
define both _BSD_SOURCE and _DEFAULT_SOURCE."
2020-04-27 00:46:06 -04:00
skal
eb6767273a Fix memory leak if eXIf has incorrect crc
Problem description:
Imagine a bitstream with an eXIf data segment that has invalid CRC.
If png_crc_finish() fails at line 2090, info_ptr->eXIf_buf is not freed
(despite the free_me setting at line 2062) because png_free_data() is
not called. png_read_info() is actually looping several time over the
png_eXIf chunk, calling png_handle_eXIf() several time in a row without
freeing the buffer.

This patch fixes the problem by leaving info_ptr's content in a clean
state in case of failure, as it is done at line 2084.
2020-04-27 00:16:36 -04:00
David Callu
9f734b13f4 cmake: Use the correct ZLIB_* variable names
ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS are the official cmake variable
names.
2020-04-26 23:54:11 -04:00
Cosmin Truta
3cec1a16f5 scripts: Clean up the makefiles
Delete variables (ALIGN, ARCH, DOCS) and targets (writelock) that are
no longer necessary.

Reorder the object file lists alphabetically, consistently across all
makefiles and build scripts.

Apply other minor fixes.
2020-03-29 23:58:29 -04:00
Cosmin Truta
50bd1abdb1 scripts: Fix makefile.std and include it in the CI verification 2020-03-29 22:26:32 -04:00
Cosmin Truta
2dd5630eae Update configuration for Travis CI; add configuration for AppVeyor CI
Exclude the branch "libpng16" from testing. It's identical to "master".
Also exclude the other (non-current) "libpng[0-1][0-7]" branches.

Parallelize the builds and the unit tests.

For Travis CI, update the build matrix as follows:
 * On Linux, use both clang and gcc.
 * On macOS, use clang only, with and without Xcode.

For AppVeyor CI, add a build matrix as follows:
 * On Windows, use Microsoft Visual Studio 2019 on x86, x64 and arm64.
 * Also on Windows, use MSYS2 on x86 and x64.

Use the new scripts/ci_*.sh; remove the old scripts/travis.sh.
2020-03-29 01:11:42 -04:00
Cosmin Truta
b9155ce3fd scripts: Add general-purpose utilities for continuous integration
Currently, libpng supports three different types of build automation:
the GNU autotools, CMake, and a legacy of hand-made makefiles.

In order to simplify the continous integration of all of the above
build options, we introduce the following scripts:
 * ci_autotools.sh: CI utility for the Autotools build
 * ci_cmake.sh: CI utility for the CMake build
 * ci_legacy.sh: CI utility for the legacy makefiles
2020-03-29 00:41:33 -04:00
Cosmin Truta
2c0aee56a0 Update the copyright year 2020-02-02 20:02:00 -05:00
Christopher Thompson
301f7a1429 oss-fuzz: Add custom malloc with max limit to prevent OOM
This adds the custom malloc/free functions from the old
libpng_read_fuzzer to the upstream fuzzer to prevent clusterfuzz
running into OOM.

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=904054
Contributed-by: Christopher Thompson <cthomp@chromium.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2019-04-25 00:37:57 -04:00
Ryan VanderMeulen
386707c6d1 arm: Use <arm_neon.h> when compiling aarch64 intrinsics with clang-cl
MSVC's <arm64_neon.h> header contains cl.exe intrinsics that are not
recognized by clang-cl.

Contributed-by: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Contributed-by: Mike Klein <mtklein@google.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2019-04-24 23:57:14 -04:00
Cosmin Truta
216387f6f7 arm: Move a png_debug statement to its correct place
It should be placed immediately after all variable declarations.
2019-04-22 23:56:57 -04:00
Cosmin Truta
b9e811fa99 scripts: Delete makefile.clang-asan and makefile.gcc-asan
Travis CI is now running sanitizer-enabled test jobs.
2019-04-22 23:00:58 -04:00
Cosmin Truta
cdbb8ec7aa Add support for Travis CI 2019-04-22 23:00:58 -04:00
Cosmin Truta
72fa126446 Avoid random test failures by running pngtest sequentially only
It is unreliable to run pngtest in parallel, due to competing writes
to the same intermediate/output file ("pngout.png").

Customization of this output file name should be possible, but it is
currently broken.
2019-04-21 00:30:14 -04:00
Cosmin Truta
5df8e982e2 Bump version to 1.6.38.git 2019-04-14 14:10:32 -04:00
Cosmin Truta
a40189cf88 Release libpng version 1.6.37 2019-04-14 14:10:32 -04:00
Miguel Ojeda
8da8257d0b Fix typo in the new v2 license
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2019-04-14 11:15:51 -04:00
Cosmin Truta
27e8b99287 pngminus: Use the system zlib by default
If a zlib source tree exists besides the libpng source tree in the
same parent directory, the pngminus build may fail, unless the zlib
tree is built fully. In order to avoid this failing scenario, do not
use the custom-built zlib by default.

(The custom-built zlib is still necessary on platforms that lack a
system-built zlib.)
2019-04-10 22:23:25 -04:00
Willem van Schaik
62a56d4fcc pngminus: Change license to MIT, etc.
Change the license to MIT.
Move the license text from the source files to a LICENSE file.
Move the change log from the source files to a CHANGES file.
Delete the Turbo C makefile and simplify the Linux makefile heavily.
Create explicitly named static and shared executables in the makefile.
Refresh the README file a bit from the twenty year old one.

Signed-off-by: Willem van Schaik <willem@schaik.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
2019-04-10 22:23:25 -04:00
Cosmin Truta
3342fafa60 pngminus: Add a CMakeLists file 2019-04-10 22:23:25 -04:00
Cosmin Truta
3f0f1d5579 pngminus: Improve portability and fix style (cont'd) 2019-04-10 22:23:25 -04:00
Cosmin Truta
dcefbc7dcd pngminus: Improve portability and fix style 2019-04-10 22:23:25 -04:00
Cosmin Truta
1f0221fad7 pngminus: Fix a buffer overflow in tokenizer 2019-04-10 22:23:25 -04:00
Cosmin Truta
a627bd26a3 arm: Partially revert "Fix a memory leak in the riffled palette [...]"
The memory leak remains fixed, but the associated refactoring is
being reverted. Moving the initialization of the riffled palette
from png_do_read_transformations to png_init_palette_transformations
has caused a regression in some of the test programs.

Although png_init_palette_transformations is the proper place to
perform this initialization, and the test programs are technically
incorrect to fail, we are still undoing that refactoring for the
time being.
2019-04-07 19:50:12 -04:00
Cosmin Truta
82ae623ec9 arm: Rename all functions to the pattern png_*_neon; add debug traces 2019-03-31 09:44:45 -04:00
Cosmin Truta
9c0d5c77bf Call png_image_free_function without guarding it with png_safe_execute
png_image_free_function (or any other destructor) should never fail.
Destructors need not and must not be executed under png_safe_execute.

Reference: CVE-2019-7317, use-after-free in png_image_free
2019-02-03 22:40:56 -05:00
Cosmin Truta
8439534daa Fix a memory leak in pngtest.c
Ensure that row_buf is deallocated not only after a read error, but
also after a write error.

Use the format "%p" instead of "0x%08lx" for printf-ing row_buf in
a portable manner.
2019-02-03 21:00:49 -05:00
Cosmin Truta
70d122aac4 Fix a memory leak in the riffled palette optimization on ARM; refactor
Move deallocation of riffled_palette from png_write_destroy to
png_read_destroy. The reader (not the writer) is the owner of
riffled_palette.

Move allocation and initialization of riffled_palette from
png_do_read_transformations to png_init_palette_transformations.

Allow riffled_palette inside png_struct only if the ARM Neon
optimizations are enabled.

Rename png_riffle_palette_rgba to png_riffle_palette_rgba8, etc.,
to better indicate the strict applicability of these routines.

Fix an unused parameter warning in the build configurations where
riffled palette optimization is not enabled.

Fix indentation.
2019-02-03 19:51:18 -05:00
Cosmin Truta
0a882b5787 scripts: Add makefile.clang, makefile.clang-asan and makefile.gcc-asan
Also apply minor updates to makefile.gcc and makefile.msys
2019-01-20 22:21:48 -05:00
Cosmin Truta
fef895aa28 Update the copyright year 2019-01-19 19:01:19 -05:00
Cosmin Truta
43b4141839 scripts: Delete makefile.ne12bsd; clean up makefile.*bsd 2018-12-30 13:34:15 -05:00
Cosmin Truta
6a94d14567 Bump version to 1.6.37.git 2018-12-30 12:00:41 -05:00
Cosmin Truta
0e13545712 Join the branches 'libpng16' and 'master'
The branch 'libpng16' is for tracking libpng version 1.6.x.
The branch 'master' is for tracking the latest stable libpng version.

These branches will diverge again at the next major libpng upgrade.
2018-12-01 09:36:00 -05:00
Cosmin Truta
eddf902320 Release libpng version 1.6.36 2018-12-01 09:36:00 -05:00
Cosmin Truta
85acd919b9 [master] Imported from libpng-1.6.36.tar 2018-12-01 09:36:00 -05:00
Cosmin Truta
e79085a172 Introduce the PNG Reference Library License version 2
The new libpng license comprises the terms and conditions from the zlib
license, and the disclaimer from the Boost license.

The legacy libpng license, used until libpng-1.6.35, is appended to the
new license, following the precedent established in the Python Software
Foundation License version 2.

From now on, the list of contributing authors shall be maintained in a
separate AUTHORS file.

The lists of previous contributing authors, mentioned in the legacy
libpng license and considered to be an integral part of that license,
are kept intact, with no further updates.
2018-11-25 23:33:30 -05:00
Cosmin Truta
81a65de25d Clean up config, scripts, examples, etc. 2018-11-25 20:27:04 -05:00
Kyle Bentley
702a07e716 CMakeLists: Fix incorrect creation of pkg-config file
(Contributed by Kyle Bentley)
2018-11-23 18:58:18 +00:00
Cosmin Truta
7b2224cb6e CMakeLists: Require CMake version 3.1 or newer
Although CMake version 3.0.2 was previously required, the policies
CMP0053 and CMP0054, introduced only in CMake version 3.1 and used
in this CMakeLists file, can have surprising effects under an older
CMake version.

Simplify the CMakeLists file by setting the global policy version
to 3.1, and remove the specific policy settings.

As an added bonus, remove the vestigial workarounds for all ancient
CMake versions.
2018-11-17 23:39:15 -05:00
Cosmin Truta
ee7967eea4 CMakeLists: Fix detection of libm
Only use libm on Unix and Unix-like systems, except for Apple (where
it's unnecessary), and BeOS and Haiku (where it's unavailable).

Avoid searching for libm at explicit locations. They may be incorrect,
especially for cross-platform builds.
2018-11-17 21:31:55 -05:00
Cosmin Truta
a54a0562c5 Rerun autogen.sh 2018-09-04 01:10:21 -04:00
Cosmin Truta
94429a335b Remove the "last changed" version information from source comments 2018-09-04 00:58:55 -04:00
Cosmin Truta
1ceaa83a84 Fix the build with MSVC ARM64 2018-09-04 00:53:38 -04:00
Cosmin Truta
b66ed71131 Restore the ANSI C compliance after adding the ARM optimization
Also apply style and formatting fixes
2018-09-04 00:15:30 -04:00
Richard Townsend
7734cda20c Optimize png_do_expand_palette for ARM
ARM-specific optimization processes 8 or 4 pixels at once.
Improves performance by around 10-22% on a recent ARM Chromebook.
2018-09-04 00:04:58 -04:00
Cosmin Truta
2fc5ddff18 Restore the ANSI C compliance after applying the MSVC ARM64 fix 2018-09-03 22:27:45 -04:00
zzzzRuby
8033c96f32 Fix build errors with MSVC ARM64
(Contributed by Zhijie Liang)
2018-09-03 22:26:06 -04:00
Samuel Williams
d3d1baadb4 Prefer memcpy to manual pointer arithmetic. 2018-08-19 01:16:22 -04:00
luz.paz
a294c1bcb6 Some more trivial source typos
Found via `codespell` and `grep`
2018-08-19 00:57:20 -04:00
Cosmin Truta
ceb327789b Remove top-level const from function-scope variables
As per the const correctness rules, top-level const-ness of data
in automatic scopes does not propagate outside of these scopes
(unlike const-ness at lower levels, such as pointers to const data).

Previously, const was used liberally, but inconsistently across the
libpng codebase. Using const wherever applicable is not incorrect.
However, _consistent_ use of const is difficult to maintain in such
conditions.

In conclusion, we shall continue to use const only where doing so is
strictly necessary:

1. If a function guarantees that it will not modify an argument
   passed by pointer, the corresponding function parameter should be
   a pointer-to-const (const T *).

2. Static data should not be modified, therefore it should be const.

Reference:
Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html#Use_of_const
2018-08-18 22:47:16 -04:00
Cosmin Truta
1ef8882814 Replace the remaining uses of PNG_CONST with const
In v1.6.0, compiler support for const became a requirement.
It should be used consistently. To maintain backwards compatibility,
PNG_CONST is still maintained in deprecated form.
2018-08-18 21:01:02 -04:00
Cosmin Truta
58eedced25 CMakeLists: Update the contributor list 2018-08-18 19:49:56 -04:00
Cosmin Truta
1d89a5db66 CMakeLists: Fix style 2018-08-18 19:49:56 -04:00
Cosmin Truta
43446b735d Fix a build warning on OpenBSD
(Contributed by Theo Buehler)
2018-08-12 23:46:02 -04:00
Cosmin Truta
6c059f8f5b configure: Remove the memset check and the HAVE_MEMSET macro
The compatibility workaround png_memset() has been removed long ago.
The availability of memset() is a platform requirement.
2018-08-11 00:47:18 -04:00
Cosmin Truta
f5d48df418 CMakeLists: Remove the PNGARG option
Pre-ANSI function prototypes are no longer supported.
2018-08-11 00:47:18 -04:00
Cosmin Truta
9730362202 CMakeLists: Avoid symlinks on MSYS
create_symlink breaks the MSYS generator in the Windows CMake.
2018-08-10 00:58:48 -04:00
Cameron Cawley
7cb7afb43d CMake: Fix compilation on systems without libm 2018-08-01 00:24:48 -04:00
Cosmin Truta
1bd4214a42 Clean up the scripts/ directory
Delete the files that are unused, redundant, or fundamentally broken:
def.c, makefile.bor, makefile.knr, makefile.msc, makefile.solaris-x86,
makefile.tc3
2018-07-29 22:19:43 -04:00
Cosmin Truta
6d55a14c58 Update projects/vstudio 2018-07-29 21:51:48 -04:00
Cosmin Truta
8440326590 Update the documentation 2018-07-29 00:33:12 -04:00
Cosmin Truta
b729fff4a3 Remove the Y2K compliance statement
As of July 2018, this statement is no longer necessary.
2018-07-28 23:39:55 -04:00
Cosmin Truta
c36c09f004 Update the export control information
Also reformat the license text.
2018-07-28 23:00:48 -04:00
Cosmin Truta
a873893279 Remove the "last changed" version information from source comments
This information is maintained by the version control system.
2018-07-28 18:47:21 -04:00
Cosmin Truta
47f18784e4 Rerun autogen.sh 2018-07-28 18:34:58 -04:00
Cosmin Truta
d4fb621429 Bump version to 1.6.36.git and update copyright notice 2018-07-28 18:34:58 -04:00
Vicki Pfau
fb6312a9f9 ARM: Disable hand-written AArch32 NEON on AArch64 2018-07-16 22:52:24 -04:00
Vicki Pfau
ddc842bf06 CMakeLists: Fix passing "off" for PNG optimizations 2018-07-16 22:52:04 -04:00
Vicki Pfau
46924bd877 CMakeLists: Fix disabling hardware optimizations 2018-07-16 22:50:32 -04:00
Cosmin Truta
8da397423e [master] Imported from libpng-1.6.35.tar 2018-07-15 23:58:00 -04:00
Cosmin Truta
c17d164b44 Run autogen.sh 2018-07-15 23:58:00 -04:00
Cosmin Truta
46aedd8961 Release libpng version 1.6.35 2018-07-15 23:58:00 -04:00
Cosmin Truta
2471434d29 [libpng16] Added missing parentheses to a macro definition
(Contributed by github.com/irwir)
2018-07-01 23:32:08 -04:00
Cosmin Truta
8a05766cb7 [libpng16] Fix the calculation of row_factor in png_check_chunk_length
(Bug report by Thuan Pham, SourceForge issue #278)
2018-06-17 22:56:29 -04:00
Cosmin Truta
a74aa9a002 [libpng16] Replace the remaining uses of png_size_t with size_t
In v1.6.0, size_t became a required type. It should be used
consistently. To maintain backwards compatibility, png_size_t
is still maintained in deprecated form.
2018-06-17 22:37:44 -04:00
Glenn Randers-Pehrson
916117d970 [libpng16] Allow compresion-type to be NULL in png_set_iCCP(). 2018-03-29 10:37:12 -05:00
Glenn Randers-Pehrson
7784cd3f6f [libpng16] Fix png_get_iCCP() to allow null compression-type 2018-03-28 18:02:32 -05:00
Glenn Randers-Pehrson
cde1e1fe79 [libpng16] Bump version to 1.6.35beta02 2018-03-06 14:06:57 -06:00
Glenn Randers-Pehrson
0e06b5948c [libpng16] Imported from libpng-1.6.35beta01.tar 2018-03-06 14:06:24 -06:00
Glenn Randers-Pehrson
3fecfeada1 Merge branch 'more-misc-typos' of git://github.com/luzpaz/libpng into libpng16 2018-03-05 11:18:16 -06:00
taigacon
140f3aa280 Fix png_set_option to work. 2018-03-05 22:10:41 +08:00
luz.paz
eb91c0e4ed More misc. typos
found via `codespell-q 3`
please review
2018-02-09 06:57:29 -05:00
Glenn Randers-Pehrson
d5e4915ebe [libpng16] Update copyright year to 2018 in png.c 2018-01-07 20:06:11 -06:00
Glenn Randers-Pehrson
fe669f6f38 [libpng16] Update copyright year 2018-01-07 19:55:19 -06:00
Glenn Randers-Pehrson
84e6e35675 [libpng16] Fix potential problem with bKGD (Cosmin Truta) 2018-01-07 17:43:09 -06:00
Glenn Randers-Pehrson
28d0ee757d [libpng16] temporarily disable 16-to-8 downscaling in the fuzzer 2017-12-17 17:52:45 -06:00
Glenn Randers-Pehrson
f07b985ddb [libpng16] CHange "ASM C" to "C ASM" in CMakelists.txt 2017-12-17 17:49:26 -06:00
Vadim Zeitlin
d532334ef5 Avoid -Wundef warnings when building libpng
Always define PNG_INTEL_SSE_OPT and PNG_INTEL_SSE_IMPLEMENTATION before
comparing them with 0.
2017-11-13 22:06:01 +01:00
Glenn Randers-Pehrson
7292c861b1 [master] Imported from libpng-1.6.34.tar 2017-11-06 16:10:16 -06:00
Glenn Randers-Pehrson
fc32eb1662 [libpng16] Initialize entire 256-entry palette in png_set_PLTE(). 2017-11-04 16:31:45 -05:00
Glenn Randers-Pehrson
7ca2f0e078 [libpng16] Fix one more typo 2017-11-03 11:31:39 -05:00
Glenn Randers-Pehrson
babae66b48 [libpng16] Update CHANGES and ANNOUNCE 2017-11-03 11:30:36 -05:00
Glenn Randers-Pehrson
3403a6e387 Merge branch 'typos' of git://github.com/luzpaz/libpng into libpng16 2017-11-03 10:57:27 -05:00
Glenn Randers-Pehrson
b196bd6566 [Libpng16] Add typecast to NULL argument to png_do_expand() 2017-11-03 10:50:38 -05:00
Unknown
f23b41d7b1 Misc. typos
Some are user facing. Some are in actual code. Most are in source comments. Also, please double check the changes in contrib/tools/pngfix.c
2017-11-03 00:52:06 -04:00
Glenn Randers-Pehrson
7125401411 [libpng16] Undo recent pngrutil.c change that did not fix oss-fuzz issue 2017-10-31 20:58:19 -05:00
Glenn Randers-Pehrson
4b52ef8e76 [libpng16] Removed some unnecessary brackets in pngrtran.c 2017-10-31 20:57:23 -05:00
Glenn Randers-Pehrson
5d7b4ab289 [libpng16] Replace png_set_add_alpha with png_set_trns_to_alpha in fuzzer. 2017-10-30 15:16:33 -05:00
Glenn Randers-Pehrson
7ee802a5a2 [libpng16] Initialize trans_color.red, green, and blue == trans_color.gray
in attempt to stop an oss-fuzz "use of ininitialized value" issue
2017-10-29 17:49:38 -05:00
Glenn Randers-Pehrson
2f8b82ebca [libpng16] Revert recent changes that did not help with oss-fuzz issues 2017-10-29 10:30:42 -05:00
Glenn Randers-Pehrson
aea0ec4346 [libpng16] Initialize tRNS read buffers in pngrutil.c 2017-10-20 19:38:03 -05:00
Glenn Randers-Pehrson
af08094ba6 [libpng16] Use png_calloc instead of png_malloc in png_set_tRNS 2017-10-19 20:59:40 -05:00
Glenn Randers-Pehrson
9bddba26de [libpng16] Initialize entire palette array to zero in png_handle_PLTE(). 2017-10-17 16:22:22 -05:00
Glenn Randers-Pehrson
3b5bcea010 [libpng16] Revert recent changes to pngset.c 2017-10-17 15:20:31 -05:00
Glenn Randers-Pehrson
adefba1b03 [libpng16] Free tRNS chunk data when abandoning it 2017-10-16 21:03:43 -05:00
Glenn Randers-Pehrson
48a2460393 [libpng16] Do not enable tRNS having trans_color with out-of-range value. 2017-10-16 07:25:58 -05:00
Glenn Randers-Pehrson
2be0f33e7c [libpng16] Nullify trans_color with out-of-range value, to stop oss-fuzz issue. 2017-10-15 11:04:53 -05:00
Glenn Randers-Pehrson
ccc77d2a8d [libpng16] Add a call to png_set_packing() to the fuzzer. 2017-10-14 11:33:59 -05:00
Glenn Randers-Pehrson
f648294931 [libpng16] Removed call to png_read_start_image() from the fuzzer. In libpng16
it is an error to call that along with png_read_update_info().
2017-10-13 14:00:36 -05:00
Glenn Randers-Pehrson
83f27f018c [libpng16] Relocate png_read_update_info() wrt png_start_image() in fuzzer. 2017-10-12 20:10:40 -05:00
Glenn Randers-Pehrson
fefe0affc1 [libpng16] Update CHANGES and ANNOUNCE and last-changed date in the fuzzer. 2017-10-12 14:30:36 -05:00
Glenn Randers-Pehrson
a3d1057a73 [libpng16] Fix typo in fuzzer (png_info_ptr should be info_ptr) 2017-10-11 16:58:39 -05:00
Glenn Randers-Pehrson
12384eae6f [libpng16] Relocate malloc of row_ptr after png_read_update_info() in fuzzer 2017-10-11 16:28:14 -05:00
Glenn Randers-Pehrson
357af1f095 ]libpng16] Add png_read_update_info() where needed in the fuzzer 2017-10-11 11:56:30 -05:00
Glenn Randers-Pehrson
ab791fc9d6 [libpng16] Add some commonly-used transforms to the libpng fuzzer 2017-10-10 20:30:54 -05:00
Glenn Randers-Pehrson
f5f8b98dbb [libpng16] Remove "cd ../libpng" from oss-fuzz build.sh 2017-10-09 21:02:15 -05:00
Glenn Randers-Pehrson
293b6aaa59 [libpng16] Revert to using the system zlib with the libpng fuzzer 2017-10-07 12:38:04 -05:00
Glenn Randers-Pehrson
98a3b2a5c2 [libpng16] Use --with-libpng-prefix=OSS_FUZZ_ while building the fuzzer 2017-10-07 09:46:51 -05:00
Glenn Randers-Pehrson
78ad1208d6 [libpng16] Use "--with-zlib-prefix=z_" while building oss-fuzz fuzzer 2017-10-05 08:31:26 -05:00
Glenn Randers-Pehrson
477a241c10 [libpng16] Use --zprefix in oss-fuzz libpng build to avoid conflict with system libz. 2017-10-03 09:51:09 -05:00
Glenn Randers-Pehrson
edb1f47139 [libpng16] Clone zlib into the oss-fuzz zlib project and build zlib alongside libpng. 2017-10-01 16:21:16 -05:00
Glenn Randers-Pehrson
0f9f170e9f [libpng16] Restore bad interlaced files, in contrib/pngsuite/interlaced 2017-09-29 18:15:53 -05:00
Glenn Randers-Pehrson
99d4a62c9a [libpng16] Restored 21 of the contrib/pngsuite/i*.png, which were correct. 2017-09-29 11:06:17 -05:00
Glenn Randers-Pehrson
2227793efc [libpng16] Bump version to 1.6.35beta01 2017-09-29 10:52:22 -05:00
Glenn Randers-Pehrson
b78804f9a2 [libpng16] Imported from libpng-1.6.34.tar 2017-09-29 03:42:33 -05:00
Glenn Randers-Pehrson
345fc37fdc [libpng16] Bump version to 1.6.34beta01 2017-09-28 17:51:45 -05:00
Glenn Randers-Pehrson
c1effe1bbf [master] Imported from libpng-1.6.33.tar 2017-09-28 13:58:53 -05:00
Glenn Randers-Pehrson
2ee8cb0559 [libpng16] Imported from libpng-1.6.33.tar 2017-09-28 13:58:30 -05:00
Glenn Randers-Pehrson
414de98047 [libpng16] Add end_info structure to libpng fuzzer; add row_ptr to CLEANUP 2017-09-28 09:20:20 -05:00
Glenn Randers-Pehrson
0512c63533 [libpng16] Revert contrib/oss-fuzz/libpng_read_fuzzer.cc to libpng-1.6.32 status 2017-09-27 18:05:07 -05:00
Glenn Randers-Pehrson
cae11e3e43 [libpng16] Treat benign errors as warnings in the libpng fuzzer 2017-09-27 08:19:11 -05:00
Glenn Randers-Pehrson
4f0a0b9a94 [libpng16] Build fuzzer with "-O0" to defeat optimizer removing "dead" code 2017-09-25 08:15:51 -05:00
Glenn Randers-Pehrson
dc22583aca [libpng16] Undo another faulty attempt to defeat the compiler from
optimizing out the the core of libpng_read_fuzzer.cc
2017-09-25 03:54:22 -05:00
Glenn Randers-Pehrson
346cbf2c2a [libpng16] Another attempt to defeat the fuzzer optimizer 2017-09-24 09:25:12 -05:00
Glenn Randers-Pehrson
8eb79b3435 [libpng16] Undo faulty attempt to defeat the fuzzer optimizer 2017-09-24 08:31:08 -05:00
Glenn Randers-Pehrson
13a158690f [libpng16] Imported from libpng-1.6.33rc02.tar 2017-09-23 21:25:19 -05:00
Glenn Randers-Pehrson
e4c8312d31 [libpng16] Document alpha_mode choices in the man page 2017-09-23 21:23:59 -05:00
Glenn Randers-Pehrson
3d2d0b52a3 [libpng16] Fix Coverity defect regarding errmsg in pngrutil.c 2017-09-23 21:22:18 -05:00
Glenn Randers-Pehrson
073fe76f6a [libpng16] Add support for loading images with associated alpha in the
Simplified API (Samuel Williams).
2017-09-23 15:12:52 -05:00
Glenn Randers-Pehrson
4b7635ce72 [libpng16] Support associated alpha in the simplified api 2017-09-23 15:11:18 -05:00
Glenn Randers-Pehrson
96333b6bea [libpng16] Defeat optimization that removes reading rows in the fuzzer. 2017-09-23 10:34:40 -05:00
Glenn Randers-Pehrson
90dd185aed [libpng16] Removed more redundant tests (suggested by "irwir" in Github issue #180). 2017-09-22 17:29:59 -05:00
Glenn Randers-Pehrson
8746d57184 [libpng16] Fix some color types and bit depths in new pngsuite files 2017-09-22 16:15:12 -05:00
Glenn Randers-Pehrson
0165badb9d [libpng16] Relocate new memset() call in pngrutil.c (irwir). 2017-09-22 15:21:36 -05:00
Glenn Randers-Pehrson
60d297d592 [libpng16] Added interlaced versions of each file in contrib/pngsuite. 2017-09-21 20:09:50 -05:00
Glenn Randers-Pehrson
2da37077db [libpng16] Bump version to 1.6.33rc02 2017-09-20 18:40:13 -05:00
Glenn Randers-Pehrson
e1220aefc4 [libpng16] Imported from libpng-1.6.33rc01.tar 2017-09-20 18:13:17 -05:00
Glenn Randers-Pehrson
5efa483265 [libpng16] Removed a redundant test (suggested by "irwir" in Github issue #180). 2017-09-20 15:53:38 -05:00
Glenn Randers-Pehrson
5f0c9fabbc [libpng16] Bump version to 1.6.33rc01 2017-09-20 15:50:17 -05:00
Glenn Randers-Pehrson
397c7eea38 [libpng16] Add a memset() in png_read_buffer() 2017-09-19 18:52:21 -05:00
Glenn Randers-Pehrson
066cb34268 [libpng16] Fix some comments 2017-09-19 15:52:36 -05:00
Glenn Randers-Pehrson
721b96ef90 [libpng16] zero out memory allocated by png_inflate 2017-09-18 14:23:41 -05:00
Glenn Randers-Pehrson
562a68513e [libpng16] Initialize tag_start etc. in png_icc_check_tag_table(). 2017-09-16 20:53:21 -05:00
Glenn Randers-Pehrson
a7722aee32 [libpng16] Undo faulty attempt to stifle oss-fuzz complaint about
png_icc_check_tabler()
2017-09-16 08:37:54 -05:00
Glenn Randers-Pehrson
413de0a56a [libpng16] Undo another faulty attempt to stifle oss-fuzz complaint 2017-09-16 08:29:06 -05:00
Glenn Randers-Pehrson
04e16d2817 [libng16] Attempt to stop Use of Uninitialized Value in png_set_text_2() 2017-09-15 16:44:20 -05:00
Glenn Randers-Pehrson
d1a0937cae [libpng16] Still another attempt to fix oss-fuzz uninitialized value 2017-09-15 08:20:23 -05:00
Glenn Randers-Pehrson
1c98b85886 [libpng16] Bump version to 1.6.33beta04 2017-09-14 12:48:53 -05:00
Glenn Randers-Pehrson
4de130c255 [libpng16] Imported from libpng-1.6.33beta03.tar 2017-09-14 12:46:28 -05:00
Glenn Randers-Pehrson
4ddead1e1c [libpng16] Undo failed attempt to prevent UMR in png_icc_check_table(). 2017-09-14 07:21:58 -05:00
Glenn Randers-Pehrson
d7edcc40e4 [libpng16] Undo failed attempt to debug UMR in png_set_text_2(). 2017-09-13 19:34:51 -05:00
Glenn Randers-Pehrson
7d40b53fbf [libpng16] Use png_chunk_report when handling a truncated ICC chunk. 2017-09-13 06:09:10 -05:00
Glenn Randers-Pehrson
76b269b1f4 [libpng16] Attempt to debug Uninitialized Memory Read in png_set_text_2(),
detected by the oss-fuzz project.
2017-09-12 08:52:44 -05:00
Glenn Randers-Pehrson
61d29bfc80 [libpng16] Guard against Uninitialized Memory Read in png_check_icc_table(),
detected by the oss-fuzz project.
2017-09-12 08:22:09 -05:00
Glenn Randers-Pehrson
0f2adc19eb [libpng16] Trying to avoid a UMR in png_set_text_2((). 2017-09-10 09:47:29 -05:00
Glenn Randers-Pehrson
1aabcfdbae [libpng16] Trying to isolate oss-fuzz issue in png_set_text_2(). 2017-09-10 05:45:44 -05:00
Glenn Randers-Pehrson
b5ae93d72e [libpng16] Rearrange order of tests in png_iccp_check_tag_table() 2017-09-10 05:33:17 -05:00
Glenn Randers-Pehrson
6a2a762914 [libpng16] Fix typo in ANNOUNCE and CHANGES 2017-09-08 17:40:23 -05:00
Glenn Randers-Pehrson
50c9e15a7d [libpng16] Do not try to generate pngprefix.h on ANDROID 2017-09-08 14:57:09 -05:00
Glenn Randers-Pehrson
c0f02a8078 [libpng16] Use pnglibconf.h.prebuilt when building for ANDROID with cmake
Github issue 162, by rcdaily).
2017-09-08 12:26:18 -05:00
Glenn Randers-Pehrson
3789cba2f2 [libpng16] Attempt to isolate an oss-fuzz issue in png_set_text_2 2017-09-08 09:34:08 -05:00
Glenn Randers-Pehrson
8592873f24 [libpng16] Attempting to fix an oss-fuzz issue. 2017-09-08 08:27:10 -05:00
Glenn Randers-Pehrson
051dcaf877 [libpng16] Added a copy of Dockerfile to the contrib/oss-fuzz directory 2017-09-08 08:19:31 -05:00
Samuel Williams
95046512a4 Add support for loading images with associated alpha. 2017-09-06 17:22:46 +12:00
Glenn Randers-Pehrson
4e9839d453 [libpng16] Update "last changed" date in contrib/oss-fuzz/*.cc 2017-09-05 18:51:36 -05:00
Glenn Randers-Pehrson
d17041f052 Merge pull request #176 from kcc/patch-1
properly define PNG_CLEANUP
2017-09-05 19:46:00 -04:00
Kostya Serebryany
cbcb39932c properly define PNG_CLEANUP
Should fix https://github.com/google/oss-fuzz/issues/809
2017-09-05 14:02:15 -07:00
Glenn Randers-Pehrson
52a566af97 [libpng16] Fix typecast in pngtrans.c 2017-09-04 18:23:06 -05:00
Glenn Randers-Pehrson
9050c32365 [libpng16] Remove one remaining "png_handler." from contrib/oss-fuzz/*.cc 2017-09-04 16:52:46 -05:00
Glenn Randers-Pehrson
4911714f74 [libpng16] Fix incorrect typecast of "intent" (should be png_alloc_size_t,
was unsigned int).  Fixes github issue #175.
2017-09-04 16:45:45 -05:00
Glenn Randers-Pehrson
c77de19ba9 [libpng16] Revise contrib/oss-fuzz/libpng_read_fuzzer.cc 2017-09-04 08:22:39 -05:00
Glenn Randers-Pehrson
051d6cc19b [libpng16] Fixed incorrect typecast of some arguments to png_malloc() and
png_calloc() that were png_uint_32 instead of png_alloc_size_t
(Bug report by "irwir" in Github libpng issue #175).
2017-09-03 15:19:59 -05:00
Glenn Randers-Pehrson
61e0a38091 [libpng16] Reference CVE-2017-12652 in CHANGES. 2017-09-03 09:01:09 -05:00
Glenn Randers-Pehrson
fca1862ac9 [libpng16] Bump version to 1.6.33beta03 2017-09-02 19:48:40 -05:00
Glenn Randers-Pehrson
c2c8b398a9 [libpng16] Imported from libpng-1.6.33beta02.tar 2017-09-02 19:48:19 -05:00
Glenn Randers-Pehrson
9495ab477b [libpng16] Enabled ARM support in CMakeLists.txt (Bernd Kuhls). 2017-09-02 19:35:06 -05:00
Glenn Randers-Pehrson
62a2463211 [lbipng16] Use current date (DATE) instead of release-date (RDATE) in last
changed date of contrib/oss-fuzz files.
2017-09-02 17:17:55 -05:00
Glenn Randers-Pehrson
dcd3edaf87 [libpng16] Restored part of ~PngObjectHandler() that was deleted from
contrib/oss-fuzz/libpng_read_fuzzer.cc
2017-09-02 16:13:15 -05:00
Bernd Kuhls
b47e0f5ceb CMakeLists.txt: Enable building asm code
NEON support is provided by filter_neon.S which is currently not build
by cmake causing an error when linking with libpng16.so.16.32.0:

[ 97%] Linking C executable pngstest
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_avg4_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_paeth3_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_up_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_avg3_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_paeth4_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_sub4_neon'
libpng16.so.16.32.0: undefined reference to `png_read_filter_row_sub3_neon'
2017-09-02 15:09:30 +02:00
Glenn Randers-Pehrson
84a5bf83ff [libpng16] Nullify all pointers in PNG_CLEANUP of libpng_read_fuzzer.cc 2017-08-31 16:46:15 -05:00
Glenn Randers-Pehrson
f3a22d396a [libpng16] Trivial reordering of libpng_read_fuzzer.cc 2017-08-31 15:01:25 -05:00
Glenn Randers-Pehrson
eb2f42aa97 [libpng16] Compute a larger limit on IDAT because some applications write a
deflate buffer for each row (Bug report by Andrew Church).
2017-08-31 11:14:23 -05:00
Glenn Randers-Pehrson
47aa798127 [libpng16] Cosmetic changes to contrib/oss-fuzz/libpng_read_fuzzer.cc 2017-08-30 13:11:16 -05:00
Glenn Randers-Pehrson
5c27e93f51 [libpng16] Bump version to 1.6.33beta02 2017-08-30 07:03:12 -05:00
Glenn Randers-Pehrson
efaf42e5df [libpng16] Initialize png_handler.row_ptr in
contrib/oss-fuzz/libpng_read_fuzzer.cc
2017-08-30 06:47:55 -05:00
Glenn Randers-Pehrson
d3220babe2 [libpng16] Revised contrib/oss-fuzz/libpng_read_fuzzer.cc 2017-08-29 19:36:49 -05:00
Glenn Randers-Pehrson
a1b5be044f [libpng16] Update "last changed" date in pngtrans.c 2017-08-29 12:32:29 -05:00
Glenn Randers-Pehrson
58720d3c06 [libpng16] Fix "last changed" dates 2017-08-29 12:29:03 -05:00
Glenn Randers-Pehrson
d64c5ea1a8 [libpng16] Update ANNOUNCE and CHANGES about pnm2png.c fix 2017-08-28 19:07:27 -05:00
Glenn Randers-Pehrson
50d2d49220 [libpng16] Imported from libpng-1.6.33beta01.tar 2017-08-28 18:34:23 -05:00
Glenn Randers-Pehrson
d2b9af04ac [libpng16] Fixed off-by-one error in png_do_check_palette_indexes() (Bug report
by Mick P., Source Forge Issue #269).
2017-08-28 11:58:11 -05:00
Glenn Randers-Pehrson
321c24b0d7 [libpng16] Bump version to 1.6.33beta01 2017-08-28 11:30:44 -05:00
Christian Hesse
14a8996fe6 [libpng] Updated PNGMINUS_UNUSED macro and comments in contrib/pngminus/p*.c 2017-08-28 11:28:18 -05:00
Glenn Randers-Pehrson
ef76b1f688 [libpng16] Free row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc PNG_CLEANUP
to fix google/oss-fuzz issue 3193.
2017-08-28 11:07:10 -05:00
Glenn Randers-Pehrson
5c616548a0 [libpng16] Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added
missing parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian
Hesse).
2017-08-28 07:13:22 -05:00
Glenn Randers-Pehrson
da923d334d [libpng16] Add calls to png_read_update_info() and png_read_end()
to contrib/oss-fuzz/libpng_read_fuzzer.cc, trying to increase coverage.
2017-08-26 20:39:50 -05:00
Glenn Randers-Pehrson
e06ec26906 [libpng16] Revise contrib/oss-fuzz/build.sh links to other oss-fuzz files 2017-08-25 18:56:37 -05:00
Glenn Randers-Pehrson
f6ca33d42c [libpng16] Bump version to 1.6.33beta01 2017-08-25 18:54:30 -05:00
Glenn Randers-Pehrson
f8110669f0 [master] Imported from libpng-1.6.32.tar 2017-08-24 16:39:24 -05:00
Glenn Randers-Pehrson
df7e9dae0c [libpng16] Imported from libpng-1.6.32.tar 2017-08-24 16:39:02 -05:00
Glenn Randers-Pehrson
4760bac13d [libpng16] Removed mention of the .yaml file in the oss-fuzz README.txt 2017-08-23 21:09:59 -05:00
Glenn Randers-Pehrson
737f347f23 [libpng16] Removed contrib/-ss-fuzz/project.yaml which belongs in
google/oss-fuzz/projects/libpng
2017-08-23 21:02:57 -05:00
Glenn Randers-Pehrson
1257369169 [libpng16] Bump version to 1.6.32rc03 2017-08-22 20:06:04 -05:00
Glenn Randers-Pehrson
de315dfaad [libpng16] Imported from libpng-1.6.32rc02.tar 2017-08-22 16:31:50 -05:00
Glenn Randers-Pehrson
ba5f7f6a3e [libpng16] Bump version to 1.6.32rc02 2017-08-22 14:01:00 -05:00
Glenn Randers-Pehrson
b0d14c7d13 'libpng16] Imported more files into the contrib/oss-fuzz directory 2017-08-22 13:58:59 -05:00
Glenn Randers-Pehrson
735fde494a [lbpng16] Clarified licensing info in contrib/oss-fuzz/* 2017-08-21 20:34:26 -05:00
Glenn Randers-Pehrson
d2533b96f3 [libpng16] Use png_handler.png_ptr instead of read_ptr in png_set_options(() 2017-08-21 20:19:43 -05:00
Glenn Randers-Pehrson
ddabd0c70a [libpng16] Added contrib/oss-fuzz directory 2017-08-21 19:14:39 -05:00
Glenn Randers-Pehrson
945759162e [libpng16] Imported from libpng-1.6.32rc01.tar 2017-08-18 20:01:11 -05:00
Glenn Randers-Pehrson
bcb739a864 [libpng16]Fix several "{" that were written in a different coding style;
update version number and copyright year
2017-08-11 10:14:33 -05:00
Glenn Randers-Pehrson
90b437e372 [libpng16] specify full path name of huge_*safe_to_copy.png in pngtest-badpngs 2017-08-11 07:48:19 -05:00
Glenn Randers-Pehrson
ab3ea490fd [libpng16] Revise tests/pngtest-badpngs to include the two renamed huge* files. 2017-08-11 07:42:38 -05:00
Glenn Randers-Pehrson
d19e8b9a4b [libpng16] Renamed chunks in contrib/testpngs/crashers to avoid having files
whose names differ only in case; this causes problems with some platforms
(github issue #172).
2017-08-11 06:39:26 -05:00
Glenn Randers-Pehrson
c5f801c82b [libpng16] Fix typo 2017-08-07 14:35:06 -05:00
Glenn Randers-Pehrson
7b8b7115d9 [libpng16] Bump version to 1.6.32beta12 2017-08-07 14:25:51 -05:00
Glenn Randers-Pehrson
646fad9d55 [libpng16] Check for 0 return from png_get_rowbytes() in contrib/pngminus/*.c
to stop some Coverity issues (162705, 162706, and 162707).
2017-08-07 14:22:56 -05:00
Glenn Randers-Pehrson
06ec4252a4 [libpng16] Made the huge_*_chunk.png files smaller. I could have removed the
IEND chunks, too, but although no application will read them, they give humans
something to look at.
2017-08-07 13:15:31 -05:00
Glenn Randers-Pehrson
33848546a3 [libpng16] Added contrib/testpngs/crashers/huge-XXXX-chunk.png 2017-08-07 12:27:07 -05:00
Glenn Randers-Pehrson
fa2f72258a [libpng16] Imported from libpng-1.6.32beta11.tar 2017-08-07 09:44:32 -05:00
Glenn Randers-Pehrson
7653aaa4b1 [libpng16] Rename bad_iccp.png, huge_idat.png to bad_iCCP.png, huge_iDAT.png
in the contrib/testpngs/crashers directory.
2017-08-07 07:34:02 -05:00
Glenn Randers-Pehrson
c362a8c80e [libpng16] Free eXIf_buf when detecting bad byte-order specifier. 2017-08-07 06:31:58 -05:00
Glenn Randers-Pehrson
c339da7fc2 [libpng16] Removed JuNK and JuNk chunks from empty_ancillary_chunks.png test file. 2017-08-06 10:52:01 -05:00
Glenn Randers-Pehrson
33787340a4 Fix typo (1 should be 2) in png_handle_eXIf 2017-08-06 10:35:23 -05:00
Glenn Randers-Pehrson
cf713fb0ab [libpng16] Check that the eXIf chunk has at least 2 bytes and begins
with "II" or "MM".
2017-08-06 10:24:04 -05:00
Glenn Randers-Pehrson
c82ae40e9f [libpng16] Test or 11 bytes instead of 14 after the iCCP keyword has been read. 2017-08-06 08:37:48 -05:00
Glenn Randers-Pehrson
099558d100 [libpng16] Relocate the iCCP length test to a point after reading the keyword 2017-08-06 08:25:56 -05:00
Glenn Randers-Pehrson
8ed418b042 [libpng16] Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(),
to account for the minimum 'deflate' stream.
2017-08-06 07:59:02 -05:00
Glenn Randers-Pehrson
39d84f4f6a [lbpng16] Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue. 2017-08-05 20:51:23 -05:00
Glenn Randers-Pehrson
c5c778bcfc [libpng16] Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue. 2017-08-05 20:15:52 -05:00
Glenn Randers-Pehrson
1ebe4f75cc [Libpng16] Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak. 2017-08-05 19:58:41 -05:00
Glenn Randers-Pehrson
13bc0b6b1f [libpng16] Make png_check_chunk_length|name() parameters const 2017-08-05 15:35:45 -05:00
Glenn Randers-Pehrson
fcd1bb9312 [libpng16] Removed unused chunk_name parameter from png_check_chunk_length(). 2017-08-05 15:08:40 -05:00
Glenn Randers-Pehrson
c33d624988 [libpng] Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers
Make pngtest --strict, --relax, --xfail options imply -m (multiple).
2017-08-05 11:01:18 -05:00
Glenn Randers-Pehrson
0ec733ce61 [libpng16] Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks(). 2017-08-05 08:01:53 -05:00
Glenn Randers-Pehrson
dbdeb1f3fa [libpng16] Bump version to 1.6.32beta11 2017-08-04 20:09:13 -05:00
Glenn Randers-Pehrson
3d7f3e57b5 [libpng16] Imported from libpng-1.6.32beta10.tar 2017-08-04 20:06:23 -05:00
Glenn Randers-Pehrson
a64c8ca9e9 [libpng16] Insert a newline at beginning of libpng warning in pngtest.c 2017-08-04 20:04:58 -05:00
Glenn Randers-Pehrson
378e926d78 [libpng16] Added contrib/testpngs/crashers/bad_iccp.png 2017-08-04 19:29:23 -05:00
Glenn Randers-Pehrson
3a957dd96f [lbipng16] Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
num_exif argument to png_get_eXIf_1() (Github Issue 171).
2017-08-04 16:29:06 -05:00
Glenn Randers-Pehrson
554d4400ab [libpng16] Fix "const" declaration info_ptr argument to png_get_eXIf_1(). 2017-08-04 15:38:41 -05:00
Clifford Yapp
2037030d50 [lbpng16] Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp). 2017-08-04 14:46:17 -05:00
Glenn Randers-Pehrson
207392821d [libpng16] Moved bad pngs from tests to contrib/libtests/crashers
Moved testing of bad pngs into a separate tests/pngtest-badpngs script
Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
    in the output but PASS for the libpng test.
2017-08-04 14:17:28 -05:00
Glenn Randers-Pehrson
2dca15686f [libpng16] Moved chunk-length check into a png_check_chunk_length() private
function (Suggested by Max Stepin).
2017-08-04 14:09:27 -05:00
Glenn Randers-Pehrson
469317d9bd [libpng16] Removed a left-over debugging "printf" statement from pngrutil.c 2017-08-04 12:14:39 -05:00
Glenn Randers-Pehrson
894a9869dd [libpng16] Bump version to 1.6.32beta10 2017-08-03 18:15:46 -05:00
Glenn Randers-Pehrson
c14be73428 [libpng16] Imported from libpng-1.6.32beta09.tar 2017-08-03 18:15:21 -05:00
Glenn Randers-Pehrson
2dbef2f2a9 [libpng16] Restored IDAT length check. Previously the calculated limit was five
bytes too small (neglected to account for a partial DEFLATE buffer)
2017-08-03 18:03:12 -05:00
Glenn Randers-Pehrson
4ac8b5e0d6 [libpng16] Use png_debug2() instead of printf() for bug reporting. 2017-08-03 16:29:58 -05:00
Glenn Randers-Pehrson
9d4215e6c0 [libpng16] Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
no longer using deprecated cmake LOCATION feature (Clifford Yapp).
2017-08-03 16:10:27 -05:00
Glenn Randers-Pehrson
d683af0f12 [libpng16] Temporarily disable IDAT length-limiting. 2017-08-03 16:04:22 -05:00
Glenn Randers-Pehrson
095b4ce16b [libpng16] Disabled new limit test on IDAT chunks. It was producing too small
a limit for some files.
2017-08-03 12:43:56 -05:00
Glenn Randers-Pehrson
bfdabdacff [libpng16] Bump version to 1.6.32beta09 2017-08-03 10:57:55 -05:00
Glenn Randers-Pehrson
6f89dff45e [libpng16] Imported from libpng-1.6.32beta08.tar 2017-08-03 10:57:37 -05:00
Glenn Randers-Pehrson
d930d36155 [libpng16] Restored png_get_eXIf_1() and png_set_eXIf_1() because strlen(eXIf_buf)
does not work (the eXIf chunk data can contain zeroes).
2017-08-03 10:29:10 -05:00
Glenn Randers-Pehrson
a1fe2c9848 [libpng16] Check length of IDAT against maximum possible IDAT size, accounting
for height, rowbytes, interlacing and zlib/deflate overhead.
2017-08-03 10:01:35 -05:00
Glenn Randers-Pehrson
6b53a5ed7b [libpng16] Update manpage about user malloc_max limit 2017-08-02 19:58:31 -05:00
Glenn Randers-Pehrson
70041f4038 [libpng16] Bump version to 1.6.32beta08 2017-08-02 19:30:40 -05:00
Glenn Randers-Pehrson
96b65b3644 [libpng16] Imported from libpng-1.6.32beta07.tar 2017-08-02 19:30:21 -05:00
Glenn Randers-Pehrson
347538efbd [libng16] Check length of all chunks except IDAT against user limit. 2017-08-02 19:21:19 -05:00
Glenn Randers-Pehrson
2b37d46564 [libpng16] Bump version to 1.6.32beta07 2017-08-02 17:32:15 -05:00
Glenn Randers-Pehrson
2df5c96352 [libpng16] Imported from libpng-1.6.32beta06.tar 2017-08-02 17:31:55 -05:00
Glenn Randers-Pehrson
3fa1df48a1 [libpng16] Removed png_get_eXIf_1() and png_set_eXIf_1(). 2017-08-02 17:27:41 -05:00
Glenn Randers-Pehrson
f30f1ae3ea [libpng16] Imported from libpng-1.6.32beta05.tar 2017-08-02 16:50:30 -05:00
Glenn Randers-Pehrson
7c709f039f [libpng16] Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability. 2017-08-02 16:48:11 -05:00
Glenn Randers-Pehrson
f8de55da04 [libpng16] Fix descriptions of eXIf function calls in the manpage. 2017-08-02 06:56:19 -05:00
Glenn Randers-Pehrson
fd6b87253c [libpng16] Eliminate local eXIf_buf from png_handle_eXIf() 2017-08-02 06:35:15 -05:00
Glenn Randers-Pehrson
821b1dcf34 [libpng16] Bump version to 1.6.32beta04 2017-08-01 22:07:53 -05:00
Glenn Randers-Pehrson
611b29acd8 [libpng16] Imported from libpng-1.6.32beta03.tar 2017-08-01 22:07:34 -05:00
Glenn Randers-Pehrson
71a56180e5 [libpng16] Stop memory leak when returning from png_handle_eXIf() with an error
(Bug report from the OSS-fuzz project).
2017-08-01 21:42:16 -05:00
Glenn Randers-Pehrson
cb628b2e4e [libpng16] Bump version to 1.6.32beta03 2017-08-01 15:26:36 -05:00
Glenn Randers-Pehrson
bc68c41d5f [libpng16] Initialized btoa[] in pngstest.c; stop memory leak in png_handle_eXIf()
when returning with an error.
2017-08-01 15:24:21 -05:00
Glenn Randers-Pehrson
4aad3c0eb0 [libpng16] Imported from libpng-1.6.32beta02.tar 2017-08-01 07:59:07 -05:00
Glenn Randers-Pehrson
68a80b10fe [libpng16] updated tests/pngunknown-sAPI; it works now. 2017-07-31 20:22:08 -05:00
Glenn Randers-Pehrson
c17b7b38b0 [libpng16] Updated contrib/libtests/pngunknown.c with eXIf chunk. Note:
the unknown-sAPI test is failing.
2017-07-31 19:04:15 -05:00
Glenn Randers-Pehrson
91540c56af [libpng16] Update png_get|set_eXIf_1() prototypes in libpng.3 2017-07-31 17:19:01 -05:00
Glenn Randers-Pehrson
90d3ff290f [libpng16] Bump version to 1.6.32beta02 2017-07-31 17:07:42 -05:00
Glenn Randers-Pehrson
619cf868e6 [libpng16] Imported from libpng-1.6.32beta01.tar 2017-07-31 17:07:23 -05:00
Glenn Randers-Pehrson
3524b0d201 [libpng16] Update "Last changed" dates and some copyright years 2017-07-31 17:03:17 -05:00
Glenn Randers-Pehrson
3e753f5cbe [libpng16] Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1()
and png_set_eXIf_1(), respectively, to avoid breaking API compatibility
with libpng-1.6.31.
2017-07-31 16:56:30 -05:00
Glenn Randers-Pehrson
c77274ffa9 [libpng16] Committed png.h and pngpriv.h that were omitted from previous checkin 2017-07-31 16:43:19 -05:00
Glenn Randers-Pehrson
323c8655cf [libpng16] Updated pngread.c with calls to png_handle_eXIf() omitted from previous checkin 2017-07-31 15:23:06 -05:00
Glenn Randers-Pehrson
40afb68570 [libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf()
in pngwrite.c, and made various other fixes to png_write_eXIf().
Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
  to arguments for png_get_eXIf() and png_set_eXIf().
2017-07-31 14:21:46 -05:00
Glenn Randers-Pehrson
4ab78af90a [libpng16] Avoid possible NULL dereference in png_handle_eXIf when benign_errors
are allowed. Avoid leaking the input buffer "eXIf_buf".
2017-07-30 19:36:25 -05:00
Glenn Randers-Pehrson
b73c891891 [libpng16] Bump version to 1.6.32beta01 2017-07-27 14:18:21 -05:00
Glenn Randers-Pehrson
fbff8986e7 [master] Imported from libpng-1.6.31.tar 2017-07-27 05:27:39 -05:00
Glenn Randers-Pehrson
9fcb846402 [libpng16] Imported from libpng-1.6.31.tar 2017-07-27 05:27:17 -05:00
Glenn Randers-Pehrson
136b3203f4 [libpng16] Imported from libpng-1.6.31rc02.tar 2017-07-25 15:33:58 -05:00
Glenn Randers-Pehrson
1ed0b3f7ca [libpng16] Fixed typo in example.c (png_free_image should be png_image_free)
(Bug report by John Smith)
2017-07-25 15:32:19 -05:00
Glenn Randers-Pehrson
a354e5c1ff [libpng16] Imported from libpng-1.6.31rc01.tar 2017-07-19 09:51:35 -05:00
Glenn Randers-Pehrson
3de6fa1122 [libpng16] Imported from libpng-1.6.31beta07.tar 2017-07-18 06:42:54 -05:00
Glenn Randers-Pehrson
db16b27d11 [libpng16] Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning. 2017-07-18 06:41:18 -05:00
Glenn Randers-Pehrson
d2fcc41eec [libpng16] Imported from libpng-1.6.31beta06.tar 2017-07-17 06:09:30 -05:00
Glenn Randers-Pehrson
cd37210184 [libpng16] Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
tags) to pngtest.png.
2017-07-16 16:38:01 -05:00
Glenn Randers-Pehrson
a5b6751bbd [libpng16] Bump version to 1.6.31beta06 2017-07-13 11:28:18 -05:00
Glenn Randers-Pehrson
cd8eb93ecb [libpng16] Imported from libpng-1.6.31beta05.tar 2017-07-13 11:25:51 -05:00
Glenn Randers-Pehrson
68cb0aaee3 [libpng16] Implement eXIf chunk support 2017-07-13 11:22:48 -05:00
Glenn Randers-Pehrson
40943eb67a [libpng16] Bump version to 1.6.31beta05 2017-07-11 12:30:36 -05:00
Glenn Randers-Pehrson
f78a3e7326 [libpng16] Imported from libpng-1.6.31beta04.tar 2017-07-11 12:29:53 -05:00
John Bowler
72d07d3202 [libpng16] Removed one of the GCC-7.1.0 'strict-overflow' warnings that
result when integers appear on both sides of a compare.  Worked around the
  others by forcing the strict-overflow setting in the relevant functions to
  a level where they are not reported.
Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
  the space.
Worked around some C-style casts from (void*) because g++ 5.4.0 objects
  to them.
Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
  overflow' check that is on by default with -Wall -Wextra.
2017-07-11 08:47:05 -05:00
Glenn Randers-Pehrson
ecea632c4c [libpng16] Cross-reference scripts/makefile.linux-opt in INSTALL 2017-07-09 19:35:10 -05:00
Glenn Randers-Pehrson
fd9c48fd9c [libpng16]Fixed release numbering in makefile.linux,linux-opt, msys 2017-07-09 17:23:56 -05:00
Glenn Randers-Pehrson
f2621c5137 [libpng16] Bump version to 1.6.31beta04 2017-07-09 16:31:45 -05:00
Glenn Randers-Pehrson
a947052ec2 [libpng16] Imported from libpng-1.6.31beta03.tar 2017-07-09 16:31:25 -05:00
Glenn Randers-Pehrson
0a9d2719c5 [libpng16] Added scripts/makefile-linux-opt, which has hardware optimizations
enabled.
2017-07-09 16:27:15 -05:00
Glenn Randers-Pehrson
aa6e0482fa [libpng16] Quieted "declaration after statement" warnings in intel/filter_sse2.c. 2017-07-09 11:51:42 -05:00
Glenn Randers-Pehrson
77a063af16 [libpng16] Balance an if/endif pair in CMakeLists.txt 2017-07-09 08:28:03 -05:00
Glenn Randers-Pehrson
5cc23552a7 [libpng16]Change "int" to "png_uint_32" in intel/filter_sse2.c to prevent
possible integer overflow (Bug report by John Bowler).
2017-07-09 08:26:54 -05:00
Glenn Randers-Pehrson
76b3a7e78f [libpng16] Add "libpng_mips_sources" to CMakeLists.txt when building MIPS_MSA 2017-07-08 20:09:07 -05:00
Glenn Randers-Pehrson
2b80b401be [libpng16] Mention cmake "PNG_HARDWARE_OPTIMIZATIONS" in INSTALL 2017-07-08 19:25:08 -05:00
Glenn Randers-Pehrson
f16c3406cd [libpng16] Updated CMakeLists.txt to add INTEL_SSE and MIPS_MSA platforms. 2017-07-08 19:10:49 -05:00
Glenn Randers-Pehrson
918a6ac2b4 [libpng16] Bump version to 1.6.31beta03 2017-07-08 13:26:36 -05:00
Glenn Randers-Pehrson
bd5a826d37 [libpng16] Imported from libpng-1.6.31beta02.tar 2017-07-08 13:15:10 -05:00
Glenn Randers-Pehrson
50b6df5389 [libpng16] Added "--enable-hardware-optimizations" configuration flag to enable
or disable all hardware optimizations with one flag.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net

Glenn R-P
2017-07-08 12:59:23 -05:00
Glenn Randers-Pehrson
857ef82edf [libpng16] Expand INSTALL instructions about enabling hardware optimizations. 2017-07-06 20:17:09 -05:00
Glenn Randers-Pehrson
f380ae5243 [libpng16] Added instructions for disabling hardware optimizations in INSTALL. 2017-07-05 19:20:57 -05:00
Glenn Randers-Pehrson
23b51990e3 [libpng16] Bump version to 1.6.31beta02 2017-07-05 06:46:10 -05:00
Glenn Randers-Pehrson
77417b8ea0 [libpng16] Imported from libpng-1.6.31beta01.tar 2017-07-05 06:45:46 -05:00
Glenn Randers-Pehrson
eed9efec4e [libpng16] Added special case for FreeBSD in arm/filter_neon.S (Maya Rashish). 2017-07-05 05:36:59 -05:00
Glenn Randers-Pehrson
b5c16f8bfc [libpng16] Added note about png_get_rowbytes() being affected by transforms 2017-07-03 11:11:44 -05:00
Glenn Randers-Pehrson
89b8c133e7 [libpng16] Added "Requires: zlib" to libpng.pc.in (Pieter Neerincx). 2017-07-03 10:08:31 -05:00
Glenn Randers-Pehrson
54126d5c59 [libpng16] Revised pngpriv.h to use PNG_VERSION_INFO_ONLY instead of
PNG_ARM_NEON_IMPLEMENTATION == 2 to exclude some definitions that assembler
cannot recognize.
2017-07-02 07:35:17 -05:00
Glenn Randers-Pehrson
660ce58597 [libpng16] Revised pngpriv.h to work around failure to compile arm/filter_neon.S
("typedef" directive is unrecognized by the assembler).
2017-07-01 16:29:42 -05:00
Glenn Randers-Pehrson
9f7134c3fc [libpng16] Update some "last changed" dates 2017-06-29 17:52:18 -05:00
Glenn Randers-Pehrson
145361aaac [libpng16] Bump version to 1.6.31beta01 2017-06-28 14:39:39 -05:00
Glenn Randers-Pehrson
8c552ddf5b [master] Imported from libpng-1.6.30.tar 2017-06-28 13:50:50 -05:00
Glenn Randers-Pehrson
58649f19cb [libpng16] Imported from libpng-1.6.30.tar 2017-06-28 13:50:29 -05:00
Glenn Randers-Pehrson
14be73c8a3 [libpng16] Imported from libpng-1.6.30rc02.tar 2017-06-25 13:46:37 -05:00
Glenn Randers-Pehrson
87cd2dc07d [libpng16] Imported from libpng-1.6.30rc01.tar 2017-06-14 10:11:47 -05:00
Glenn Randers-Pehrson
2d306c4b15 [libpng16] Bump version to 1.6.30beta05 2017-06-06 19:44:20 -05:00
Glenn Randers-Pehrson
5aaf6e889c [libpng16] Imported from libpng-1.6.30beta04.tar 2017-06-06 19:38:17 -05:00
Glenn Randers-Pehrson
c548328904 [libpng16] Avoid writing an empty IDAT when the last IDAT exactly fills the
compression buffer (bug report by Brian Baird).  This bug was introduced in
libpng-1.6.0.
2017-06-06 18:40:45 -05:00
Glenn Randers-Pehrson
11629b1c1a [libpng16] Mention github issues and pull requests as a bug-reporting method. 2017-05-27 13:12:37 -05:00
Glenn Randers-Pehrson
774922da91 [libpng] Update GIT URL in documentation 2017-05-27 12:33:48 -05:00
Glenn Randers-Pehrson
7da2ea45b9 Merge branch 'ssl' of git://github.com/vszakats/libpng into libpng16
to update zlib.net URLs
2017-05-27 12:25:20 -05:00
Viktor Szakats
95f3c07d6f use HTTPS for zlib.net 2017-05-27 13:54:30 +00:00
Glenn Randers-Pehrson
a315efe3b2 [libpng16] Mention CVE-2016-5737 in CHANGES, update intel "last changed" date 2017-05-24 09:58:09 -05:00
Glenn Randers-Pehrson
6155c6629d [libpng16] Bump version to 1.6.30beta04 2017-05-22 10:03:26 -05:00
Glenn Randers-Pehrson
d40ac082ef [libpng16] Imported from libpng-1.6.30beta03.tar 2017-05-22 10:03:04 -05:00
Glenn Randers-Pehrson
d2ac910a53 [libpng16] Fix urls 2017-05-19 17:34:31 -05:00
Glenn Randers-Pehrson
a1577bf965 [libpng16] Test CMAKE_HOST_WIN32 instead of WIN32 in CMakeLists.txt 2017-05-18 18:15:50 -05:00
Glenn Randers-Pehrson
e486c76253 [libpng16] Update ftp site mentioned in README 2017-05-16 17:34:45 -05:00
Glenn Randers-Pehrson
30d1f909ed [libpng16] Do not double evaluate CMAKE_SYSTEM_PROCESSOR in CMakeLists.txt 2017-05-16 16:12:42 -05:00
Glenn Randers-Pehrson
8359b90057 [libpng16] Fix typo recently introduced in rpng-win.c 2017-04-24 15:48:45 -05:00
Glenn Randers-Pehrson
11c25c0e9e [libng16] Update copyright notices in revised "contrib" files. 2017-04-23 18:48:32 -05:00
Glenn Randers-Pehrson
b99308a33c [libpng16] Check for integer overflow in contrib/tools/genpng. 2017-04-23 18:41:28 -05:00
Glenn Randers-Pehrson
170a44b222 [libpng16] Check for integer overflow in contrib/visupng. 2017-04-23 17:33:10 -05:00
Glenn Randers-Pehrson
0808d75851 [libpng16] Bump version to 1.6.30beta03 2017-04-22 15:52:24 -05:00
Glenn Randers-Pehrson
2eff8ef504 [libpng16] Imported from libpng-1.6.30beta02.tar 2017-04-22 15:46:59 -05:00
Glenn Randers-Pehrson
60d8ae1003 [libpng16] Removed reference to the obsolete PNG_SAFE_LIMITS macro in
the documentation.
2017-04-22 15:45:37 -05:00
Glenn Randers-Pehrson
53f22aed41 [libpng16] Document need to check for integer overflow when allocating a pixel
buffer for multiple rows in contrib/gregbook, contrib/pngminus, example.c, and
in the manual (suggested by Jaeseung Choi).
2017-04-22 15:21:58 -05:00
Glenn Randers-Pehrson
13370c536c [libng16] Update CHANGES about a bugfix in libpng-1.6.27 related to ADLER32
handling.
2017-04-16 15:01:42 -05:00
Viktor Szakats
054be18721 fix URL regressions 2017-04-03 21:23:09 +00:00
Glenn Randers-Pehrson
64f81108db [libpng16] Re-apply URL patch to libpng-manual.txt and libpng.3 2017-04-03 15:25:40 -05:00
Glenn Randers-Pehrson
ead7079f1d [libpng16] Bump version to 1.6.30beta02 2017-04-01 11:14:04 -05:00
Glenn Randers-Pehrson
82add753e5 [libpng16] Imported from libpng-1.6.30beta01.tar 2017-04-01 11:08:09 -05:00
Viktor Szakats
b3ffdc5991 URL updates 2017-03-31 23:25:57 +00:00
Glenn Randers-Pehrson
e744ee1338 [libpng16] Update CHANGES, ANNOUNCE, and "last changed" dates. 2017-03-30 12:24:55 -05:00
Glenn Randers-Pehrson
ab8dbdcce5 Merge branch 'conststrip' of git://github.com/vszakats/libpng into libpng16 2017-03-30 12:23:15 -05:00
Viktor Szakats
7bbd665b34 tweak 2017-03-30 12:25:33 +00:00
Viktor Szakats
dce241c107 silence clang -Wcast-qual const drop warnings 2017-03-30 00:12:53 +00:00
Viktor Szakats
8c50acb9d2 silence clang -Wcomma warnings 2017-03-29 23:54:40 +00:00
Glenn Randers-Pehrson
92fcd25e9d [libpng16] Further revised documentation of png_get_error_ptr(). 2017-03-28 12:47:49 -05:00
Glenn Randers-Pehrson
9b0170dd03 [libpng16] Revised documentation of png_get_error_ptr() in the libpng manual. 2017-03-28 12:38:47 -05:00
Glenn Randers-Pehrson
2239961279 [libpng16] Fix "last changed" dates in powerpc/*.c 2017-03-21 19:37:27 -05:00
Glenn Randers-Pehrson
18834ff62b [libpng16] Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
makefile.linux and makefile.solaris-x86 (Cosmin).
2017-03-16 12:40:49 -05:00
Glenn Randers-Pehrson
03a6f3f9c9 [libpng16] Bump version to 1.6.30beta01 2017-03-16 10:40:01 -05:00
Glenn Randers-Pehrson
b363e01e6b [master] Imported from libpng-1.6.29.tar 2017-03-16 07:27:43 -05:00
Glenn Randers-Pehrson
d42e88d5b3 [libpng16] Imported from libpng-1.6.29.tar 2017-03-16 07:26:33 -05:00
Glenn Randers-Pehrson
fae874c8ca [libpng16] Imported from libpng-1.6.29rc01.tar 2017-03-08 17:08:36 -06:00
Glenn Randers-Pehrson
0b1f7e412b [libpng16] Bump version to 1.6.29beta04 2017-03-01 07:15:58 -06:00
Glenn Randers-Pehrson
a8de1a70d1 [libpng16] Imported from libpng-1.6.29beta03.tar 2017-03-01 07:15:29 -06:00
Glenn Randers-Pehrson
7db98a18fe [libpng16] Suppress clang warnings about implicit sign changes in png.c 2017-03-01 07:09:05 -06:00
Glenn Randers-Pehrson
a7029a5b4c [libpng16] Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in
pngrutil.c because Solaris 11 distributes zlib-1.2.8.f that is older
than 1.2.8.1.
2017-03-01 06:52:16 -06:00
Glenn Randers-Pehrson
4f31b7f242 [libpng16= Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer). 2017-02-27 20:17:56 -06:00
Glenn Randers-Pehrson
b475d0593c [libpng16] Update credits and copyright information about powerpc-vsx code 2017-02-22 15:14:22 -06:00
Glenn Randers-Pehrson
862a2858b0 [libpng16] Bump version to 1.6.29beta03 2017-02-22 14:41:30 -06:00
Glenn Randers-Pehrson
364450bf8d [libpng16] Imported from libpng-1.6.29beta02.tar 2017-02-22 14:34:14 -06:00
Glenn Randers-Pehrson
f6d358ff42 [libpng16] Update CHANGES and ANNOUNCE 2017-02-21 20:45:49 -06:00
Glenn Randers-Pehrson
7980c79d69 Merge branch 'libpng16' of git://github.com/barkovv/libpng into libpng16 2017-02-21 20:41:27 -06:00
Glenn Randers-Pehrson
5e8c50cc8d [libpng16] Update CHANGES and ANNOUNCE 2017-02-21 20:11:47 -06:00
John Bowler
7218761fe1 Fix right code in the wrong place.
The recovery stuff was in the wrong if branches; the comments were
correct.

Signed-off-by: John Bowler <jbowler@acm.org>
2017-02-21 15:15:48 -08:00
Vadim Barkov
3644db298b Added VSX code to libconfig scripts 2017-02-12 12:19:01 +00:00
Vadim Barkov
29775cef5e Fixed VSX compilation time checks
__ppc64__ -> __PPC64__
2017-02-12 09:57:16 +00:00
Vadim Barkov
a343882c74 Made VSX code pedantic strict C90 compliant
Fixed signed/unsigned comparations, png_byte and summations. Also
fixed combound literals which are permited by C90.
2017-02-11 21:33:32 +00:00
Vadim Barkov
6f6c396604 Added prefix to cmake VSX check warning 2017-02-10 07:38:28 +00:00
Vadim Barkov
483bcad21d Changed minimum supported PowerPC CPU comment
Changed it from POWER8 to POWER7 due to the last one
supports VSX too.
2017-02-10 07:33:06 +00:00
Vadim Barkov
310dee21f7 Refactoring
Now all defines in filter VSX file are prefixed with VSX
and have more clear names
2017-02-10 07:20:59 +00:00
Vadim Barkov
d1c12e85c1 Added support for ppc64 big endian for filter_paeth VSX 2017-02-09 19:11:31 +00:00
Vadim Barkov
99d7285f20 Fixed filter_paeth for PowerPC VSX
Now all tests are fine for ppc64le
2017-02-09 18:57:53 +00:00
Vadim Barkov
d4bdca45b3 Fixed multiple bugs in VSX filter functions
Now up,sub and avg filter VSX functions pass tests
2017-02-08 14:02:44 +00:00
Vadim Barkov
58e9d5d59d Refactoring 2017-02-02 22:37:36 +00:00
John Bowler
7428ca944d Merge branch 'libpng16' of ../../libpng into libpng16 2017-02-02 14:05:46 -08:00
Vadim Barkov
ae15e839d9 Small bugfix 2017-02-02 04:51:56 +00:00
Vadim Barkov
8a242668fd Added warning with supported OSes list for VSX check 2017-02-01 14:26:02 +00:00
Vadim Barkov
b42e8bce3a Added PNG_UNUSED macro in contrib/powerpc/linux{_aux}.c 2017-02-01 14:03:57 +00:00
Vadim Barkov
b1be78460a Fixed mixed tabs and spaces in contrib/powerpc/linux_aux.c 2017-02-01 13:58:54 +00:00
Vadim Barkov
d57bed7838 Fixed mixed tabs and spacing and comments in contrib/powerpc/linux.c 2017-02-01 13:57:50 +00:00
Glenn Randers-Pehrson
b8afc73b73 [libpng16] Added "mips" and "mips-msa" to the directory listing in README 2017-01-31 08:20:23 -06:00
Vadim Barkov
19425d32f3 Update README 2017-01-31 16:48:17 +03:00
Vadim Barkov
9bd58f9387 Removed PNG_ALIGN check in VSX code since it is not used 2017-01-31 12:15:45 +00:00
Vadim Barkov
f2b829166d Removed commentary about contrib/powerpc/READM 2017-01-31 12:13:39 +00:00
Vadim Barkov
ab2a639a2a Removed trailing spaces 2017-01-31 15:12:00 +03:00
Vadim Barkov
0aa1b967f0 Removed PNG_ALIGN dependency from VSX since it is not needed 2017-01-31 15:09:48 +03:00
Vadim Barkov
80041d15b2 Update contrib/powerpc/linux_aux.c header 2017-01-31 15:07:14 +03:00
Vadim Barkov
2cc569eab7 Removed remark about poor supporting VSX check code 2017-01-31 12:00:02 +00:00
Vadim Barkov
bea573d370 Added auxv-based VSX detection method for PowerPC and enabled it by default 2017-01-31 11:59:11 +00:00
Vadim Barkov
d0d310f1cb Added cmake support for PowerPC VSX optimizations 2017-01-31 03:56:23 +00:00
debian
3907feb306 Added ppc64le to arch's in configure.ac script 2017-01-31 03:53:12 +00:00
Vadim Barkov
acb155d893 Implemented filter_paeth PowerPC VSX variant 2017-01-31 04:05:19 +03:00
Vadim Barkov
c47ddcf22b Merge branch 'libpng16' into libpng16 2017-01-30 18:44:09 +03:00
Vadim Barkov
565d4beea2 Updated CFLAGS recomendations 2017-01-29 19:07:12 +03:00
Vadim Barkov
c43aaa8b20 Implemented filter_avg for PowerPC VXS 2017-01-29 18:44:54 +03:00
Vadim Barkov
6ddcd33daa Fixed potential align errors for PowerPC VSX filter functions
The problem is that row and prev_row may not be aligned to the same
byte count. This situation leaded to undefined behaviour.
2017-01-29 18:37:53 +03:00
John Bowler
24b27e5948 Merge branch 'libpng16' of ../../libpng into libpng16 2017-01-23 19:01:45 -08:00
Glenn Randers-Pehrson
f604c74a5f [libpng16] Avoid conditional directives that break statements in pngrutil.c (Romero
Malaquias)
2017-01-20 14:46:21 -06:00
Romero B. de S. Malaquias
c3f4e5fb1a Avoiding conditional directives that break statements 2017-01-20 16:31:54 -03:00
Vadim Barkov
adbf1d6d1c Fixed missing defines for VSX filter_sub 2017-01-19 18:12:13 +03:00
Vadim Barkov
9b0311a4d8 Implemented filter_sub optimisation for PowerPC VSX 2017-01-19 02:11:34 +03:00
Vadim Barkov
b455622aa8 Fixed potential bug on align calculation for VSX filter_up 2017-01-19 01:29:24 +03:00
Vadim Barkov
ccef5edbfe Fixed bug with unaligned input on VSX filter_up 2017-01-16 19:45:17 +03:00
Vadim Barkov
91acd4baf8 Implemented png_read_filter_up_vsx 2017-01-15 20:20:29 +03:00
root
6ff408d423 Modified CFLAGS recomendations for PowerPC VSX 2017-01-14 18:35:36 +03:00
Vadim Barkov
ee5804fa14 Added PowerPC detection code for linux 2017-01-14 16:47:10 +03:00
Vadim Barkov
2b6e59d968 Added initial code for PowerPC VSX optimisation 2017-01-14 16:05:33 +03:00
Glenn Randers-Pehrson
ae794eefaa [libpng16] Bump version to 1.6.29beta02 2017-01-12 17:52:05 -06:00
Glenn Randers-Pehrson
dd24a6ca15 [libpng16] Imported from libpng-1.6.29beta01.tar 2017-01-12 10:02:56 -06:00
Glenn Randers-Pehrson
a0e3160ad4 Merge branch 'libpng16' of ssh://git.code.sf.net/p/libpng/code into libpng16 2017-01-12 09:49:15 -06:00
Glenn Randers-Pehrson
4c0740c8de [libpng16] Simplified conditional compilation in pngvalid.c, for AIX (Michael Felt). 2017-01-12 09:48:12 -06:00
Glenn Randers-Pehrson
8c6c9e6d56 [libpng16] Update credits to include Google Inc, for the Intel/SSE patch. 2017-01-12 09:45:02 -06:00
John Bowler
f8fe5f8560 Merge branch 'libpng16' of ../../libpng into libpng16 2017-01-06 08:45:05 -08:00
Glenn Randers-Pehrson
eaca53a2d9 [libpng16] Update credits to include Google Inc, for the Intel/SSE patch. 2017-01-05 18:11:59 -06:00
Glenn Randers-Pehrson
bef76802de [libpng16] Moved SSE2 optimization code into the main libpng source directory.
Configure libpng with "configure --enable-intel-sse" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.  This patch was
previously applied to libpng-1.6.28rc03 but withdrawn to allow time for QA.
2017-01-05 18:09:33 -06:00
Glenn Randers-Pehrson
ebede25ceb [libpng16] Readded "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco
Costamagna).
2017-01-05 11:51:54 -06:00
Glenn Randers-Pehrson
4ddac468c4 [libpng16] Bump version to 1.6.29beta01 2017-01-05 11:37:54 -06:00
Glenn Randers-Pehrson
0a181e1665 [master] Imported from libpng-1.6.28.tar 2017-01-05 11:50:11 -05:00
Glenn Randers-Pehrson
17ad597dba [libpng16] Imported from libpng-1.6.28.tar 2017-01-05 07:59:36 -06:00
John Bowler
b784934049 Merge branch 'libpng16' of ../../libpng into libpng16 2017-01-04 13:22:53 -08:00
Glenn Randers-Pehrson
93b3476358 [libpng16] Imported from libpng-1.6.28rc03.tar 2017-01-03 22:25:10 -06:00
Glenn Randers-Pehrson
6df2225c55 [libpng16] Fix version numbers in ANNOUNCE 2017-01-03 19:50:07 -06:00
Glenn Randers-Pehrson
562751dcc9 [libpng16] Fix typo in CHANGES: it should say "configure --enable-intel-sse"
to enable the SSE optimization
2017-01-03 19:32:33 -06:00
Glenn Randers-Pehrson
3785125faf [libpng16] Imported from libpng-1.6.28rc02.tar 2017-01-03 19:23:10 -06:00
Glenn Randers-Pehrson
edef058e18 [libpng16] Moved SSE2 optimization code into the main libpng source directory.
Configure libpng with "configure --enable-intel-see" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
2017-01-03 19:15:15 -06:00
John Bowler
16fe975928 Merge branch 'libpng16' of ../../libpng into libpng16 2017-01-03 16:38:52 -08:00
Glenn Randers-Pehrson
24dfd3f2d7 [libpng16] Imported from libpng-1.6.28rc01.tar 2017-01-03 12:51:38 -06:00
Glenn Randers-Pehrson
f8bdbd4d8f [libpng16] Changed png_ptr->options from a png_byte to png_uint_32, to
accomodate up to 16 options.
2017-01-02 19:03:36 -06:00
Glenn Randers-Pehrson
f981826204 [libpng16] Update CHANGES and ANNOUNCE with recent CMakeLists.txt update. 2017-01-02 09:40:23 -06:00
Sam Serrels
14e885a54c Added option to Cmake build allowing a custom location of Zlib to be specified. This is useful in a scenario where libpng is being built as a subproject alongside zlib by another project.. 2017-01-02 01:36:47 +00:00
Glenn Randers-Pehrson
dd8aa3e939 [libpng16] Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna) 2016-12-31 13:03:23 -06:00
John Bowler
29b9fd605e Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-31 09:18:27 -08:00
Glenn Randers-Pehrson
aa5bb2c3dd [libpng16] Clean up LICENSE, mention CVE-2016-10087 in CHANGES. 2016-12-30 14:00:19 -06:00
John Bowler
993bd61329 Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-30 09:03:40 -08:00
Glenn Randers-Pehrson
b9b490c7f5 [libpng16] Bump version to 1.6.28beta01 2016-12-30 08:29:24 -06:00
John Bowler
09fae1b5d3 Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-29 19:14:43 -08:00
Glenn Randers-Pehrson
e4b59e5583 [master] Imported from libpng-1.6.27.tar 2016-12-29 08:10:06 -06:00
Glenn Randers-Pehrson
e9c3d83d5a [libpng16] Bump version to 1.6.27 2016-12-29 07:52:43 -06:00
Glenn Randers-Pehrson
812768d7a9 [libpng16] Fixed a potential null pointer dereference in png_set_text_2()
(bug report and patch by Patrick Keshishian).
2016-12-29 07:52:27 -06:00
Glenn Randers-Pehrson
a3b5edc934 [libpng16] Bump version to 1.6.27 2016-12-29 07:50:33 -06:00
John Bowler
aaed6782e8 Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-27 13:28:55 -08:00
Glenn Randers-Pehrson
fd3a683b2a [libpng16] Add CHANGES entry about CMakeLists.txt ARM support 2016-12-27 11:14:18 -06:00
John Bowler
08d00b25d8 Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-27 08:21:12 -08:00
Glenn Randers-Pehrson
61a9a054fd [libpng16] Imported from libpng-1.6.27rc01.tar 2016-12-27 08:24:22 -06:00
John Bowler
bf90247a63 Merge branch 'libpng16' of ../../libpng into libpng16 2016-12-26 18:16:55 -08:00
Glenn Randers-Pehrson
4708ca268e [libpng16] Update CHANGES and ANNOUNCE 2016-12-26 19:44:25 -06:00
Glenn Randers-Pehrson
7bb00afec3 Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-12-26 19:36:00 -06:00
John Bowler
13a354f81e Remove 'defined' within macro
This removes the use of a macro containing the pre-processor 'defined'
operator.  It is unclear whether this is valid; a macro which
"generates" 'defined' is not permitted, but the use of the work
"generates" within the C90 standard seems to imply more than simple
substitution of an expression itself containing a well-formed defined
operation.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-12-26 16:43:15 -08:00
Glenn Randers-Pehrson
8187ba1518 [libpng16] PNG_IGNORE_ALDLER32_SUPPORTED -> PNG_IGNORE_ADLER32 in pngtest.c 2016-12-26 18:15:02 -06:00
Glenn Randers-Pehrson
dbb5fce3d8 [libpng16] Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. 2016-12-26 18:00:46 -06:00
Glenn Randers-Pehrson
d65a92b951 [libpng16] Revert ADLER32 error handling in pngrutil.c and pngpread.c. 2016-11-08 16:04:08 -06:00
Glenn Randers-Pehrson
a69dd76eac [libpng16] Bump version to 1.6.27beta02 2016-11-02 17:54:15 -05:00
Glenn Randers-Pehrson
e36003e9b8 [libpng16] Imported from libpng-1.6.27beta01.tar 2016-11-02 17:37:21 -05:00
Glenn Randers-Pehrson
2accfbd6f3 [libpng16] Restrict the new ADLER32-skipping to IDAT chunks. It broke iCCP
chunk handling.
2016-10-28 15:50:46 -05:00
Glenn Randers-Pehrson
858cb585d7 [libpng16] Bump version to 1.6.27beta01 2016-10-28 15:25:26 -05:00
Glenn Randers-Pehrson
35cbe7640b [master] Imported from libpng-1.6.26.tar 2016-10-19 19:11:48 -05:00
Glenn Randers-Pehrson
0c440812db [libpng16] Imported from libpng-1.6.26.tar 2016-10-19 19:11:38 -05:00
Glenn Randers-Pehrson
436ce2c6e9 [libpng16] Bump version to 1.6.26rc02 2016-10-17 12:46:41 -05:00
Glenn Randers-Pehrson
a1312f7b19 [libpng16] Cosmetic change "ptr != 0" to "ptr != NULL" in png.c and pngrutil.c 2016-10-16 14:34:40 -05:00
Glenn Randers-Pehrson
01e99bbac1 [libpng16] Imported from libpng-1.6.26rc01.tar 2016-10-12 08:16:13 -05:00
Glenn Randers-Pehrson
dd6d7f031f [libpng16] Bump version to 1.6.26beta07 2016-10-07 15:57:32 -05:00
Glenn Randers-Pehrson
f7fe4db91b [libpng16] Imported from libpng-1.6.26beta06.tar 2016-10-07 15:57:10 -05:00
Glenn Randers-Pehrson
a106899acd [libpng16] Use zlib-1.2.8.1 inflateValidate() instead of inflateReset2() to
avoid ADLER32 evaluation.
2016-10-07 13:33:50 -05:00
Glenn Randers-Pehrson
ffaeff82d3 [libpng16] Bump version to 1.6.26beta06 2016-10-05 19:43:55 -05:00
Glenn Randers-Pehrson
13bdd8bcdf [libpng16] Imported from libpng-1.6.26beta05.tar 2016-10-05 19:43:35 -05:00
Glenn Randers-Pehrson
7d7694ae6a [libpng16] Changed integer constant 4294967294 to unsigned 4294967294U in pngconf.h
to avoid a signed/unsigned compare in the preprocessor.
2016-10-05 09:23:08 -05:00
Glenn Randers-Pehrson
b3540f9932 [libpng16] Bump version to 1.6.26beta05 2016-10-03 12:31:18 -05:00
Glenn Randers-Pehrson
a5084f1522 [libpng16] Imported from libpng-1.6.26beta04.tar 2016-10-03 12:31:06 -05:00
Glenn Randers-Pehrson
565a751ca2 [libpng16] Quieted (bogus?) clang warnings about "absolute value has no effect". 2016-10-02 20:16:36 -05:00
Glenn Randers-Pehrson
f6497e03d1 i[lbpng16] Quieted (bogus?) clang warnings about "absolute value has no effect".
Fixed offsets in contrib/intel/intel_sse.patch
2016-10-02 20:07:22 -05:00
Glenn Randers-Pehrson
b7b59b7fe9 [libpng16] Bump version to 1.6.26beta04 2016-10-02 19:18:29 -05:00
Glenn Randers-Pehrson
890611200a [libpng16] Imported from libpng-1.6.26beta03.tar 2016-10-02 19:10:10 -05:00
Glenn Randers-Pehrson
ce45f85c61 [lbpng16] Removed contrib/libtests/*.orig and *.rej that slipped into the
tarballs.
2016-10-02 19:03:57 -05:00
Glenn Randers-Pehrson
761d833372 [libpng16] Quieted all remaining -Wconversion compiler warnings 2016-10-02 18:46:35 -05:00
Glenn Randers-Pehrson
3875d9af4c [libpng16] Quieted 45 (out of 86 remaining) -Wconversion compiler warnings 2016-10-02 17:08:46 -05:00
Glenn Randers-Pehrson
ad3318ddc8 [libpng16] Bump version to 1.6.26beta03 2016-10-01 19:44:42 -05:00
Glenn Randers-Pehrson
7184475a98 [libpng16] Imported from libpng-1.6.26beta02.tar 2016-10-01 19:44:32 -05:00
Glenn Randers-Pehrson
c180e7a437 [libpng16] Updated CHANGES and ANNOUNCE 2016-09-30 21:54:06 -05:00
Glenn Randers-Pehrson
fbe3e002bc Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-09-30 21:51:27 -05:00
Glenn Randers-Pehrson
b5b77a72b4 Revert "[libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,"
This reverts commit 97dfccb6325e54d45c4440b6dd037619d88688cc.
2016-09-30 21:34:21 -05:00
Glenn Randers-Pehrson
97dfccb632 [libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,
pngwrite.c, pngunknown.c, and pngvalid.c.  Several warnings still remain
in pngvalid.c
2016-09-30 21:02:03 -05:00
John Bowler
319c9852bf Unsigned overflow
Remove all currently detected cases of unsigned overflow.  Detection is
runtime, so test case dependent.  The changes to pngvalid.c eliminate
spurious and probably invalid tests with one while loop exception.

Apart from that and the change to the dependence on the intended
unsigned overflow in pngtrans.c the changes are limited to altering the
meme for an unsigned 'x' from:

   while (x-- > 0)

to

   for (; x > 0; --x)

This works because, in all cases, the control variable is not used in
the loop.  The 'while' meme was, at one time, warn'ed by GCC so it is
probably a good change, for some weird religious value of good.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-30 18:37:22 -07:00
Glenn Randers-Pehrson
1b363fa6b0 [libpng16] Quieted 116 (out of 288) -Wconversion compiler warnings by changing
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes
in png.c, pngread.c, and pngwutil.c.
2016-09-30 17:19:12 -05:00
Glenn Randers-Pehrson
fa24421216 [libpng16] Quieted 74 (out of 288) -Wconversion compiler warnings by changing
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU.
2016-09-30 16:26:07 -05:00
Glenn Randers-Pehrson
d84fd77bf8 [libpng16] Quieted a warning from clang-3.8 in pngtrans.c. 2016-09-30 14:22:57 -05:00
Glenn Randers-Pehrson
04dab1e82d [libpng16] Updated the documentation about CRC and ADLER32 handling. 2016-09-26 11:15:22 -05:00
Glenn Randers-Pehrson
394be58371 [libpng16] Bump version to 1.6.26beta02 2016-09-26 08:58:04 -05:00
Glenn Randers-Pehrson
217546ae43 [libpng16] Imported from libpng-1.6.26beta01.tar 2016-09-26 08:57:44 -05:00
Glenn Randers-Pehrson
8aa1638ccc [libpng16] Add tests/badcrc.png and tests/badadler.png to tests/pngtest.
Merged pngtest.c with libpng-1.7.0beta84/pngtest.c
2016-09-26 08:09:44 -05:00
Glenn Randers-Pehrson
89ea081433 [libpng16] If CRC handling of critical chunks has been set to PNG_CRC_QUIET_USE,
ignore the ADLER32 checksum in the IDAT chunk as well as the chunk CRCs.
2016-09-25 17:42:15 -05:00
Glenn Randers-Pehrson
7835716cef [libpng16] Changed PNG_ZLIB_VERNUM to ZLIB_VERNUM in pngpriv.h, pngstruct.h,
and pngrutil.c.
2016-09-19 16:46:54 -05:00
Glenn Randers-Pehrson
cb1787f033 [libpng16] Conditionally compile png_set_benign_error in pngtest.c 2016-09-11 22:02:57 -05:00
Glenn Randers-Pehrson
1842d7c865 [libpng16] Issue a png_benign_error instead of a png_error on ADLER32 mismatch
while decoding compressed data chunks.
2016-09-11 22:02:05 -05:00
Glenn Randers-Pehrson
bc2bb96cd7 [libpng16] Conditionally compile png_set_benign_errors() in pngread.c 2016-09-11 19:22:28 -05:00
Glenn Randers-Pehrson
5cb1700702 [libpng16] Update CHANGES and ANNOUNCE and last-changed date in pngset.c 2016-09-03 11:51:29 -05:00
John Bowler
7dc0329250 [libpng16] png_set_pCAL: do not png_error on read
Because png_handle_pCAL has allocated memory to free.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-02 19:26:42 -07:00
Glenn Randers-Pehrson
90ea4af4a1 [libpng16] Update CHANGES and ANNOUNCE 2016-09-01 17:28:08 -05:00
Glenn Randers-Pehrson
a744b11975 Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-09-01 17:11:57 -05:00
John Bowler
597b1a1b5e Merge branch 'libpng16' of ../../libpng into libpng16 2016-09-01 13:27:58 -07:00
John Bowler
f0b453bc3e [libpng16] pngfix zero-length IDAT fix
When an input file contains a zero length IDAT and pngfix is not applying the
IDAT rechunking (--max) option pngfix will go into a loop writing the zero
length IDAT for ever.

This is a fairly minor issue for interactive use; zero length IDAT is very rare,
the problem is obvious (pngfix hangs) and the fix (use --max, or --max=4096
etc), while not obvious, is easy.

For non-interactive use, e.g. trying to automatically repair a PNG that cannot
be read by libpng, there are security consequences:

1) pngfix hangs.  This may permit a DoS attack.
2) When the --out option is used pngfix will just keep writing.  This is a very
likely DoS scenario.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-09-01 07:22:40 -07:00
Glenn Randers-Pehrson
c9d7b865b6 [libpng16] Bump version to 1.6.26beta01 2016-08-31 23:19:25 -05:00
Glenn Randers-Pehrson
eb5cdf0c64 [master] Imported from libpng-1.6.25.tar 2016-08-31 22:30:55 -05:00
Glenn Randers-Pehrson
e3a6631123 [libpng16] Imported from libpng-1.6.25.tar 2016-08-31 22:30:47 -05:00
Glenn Randers-Pehrson
434aecf327 [libpng16] Bump version to 1.6.25rc06 2016-08-30 11:21:11 -05:00
Glenn Randers-Pehrson
abd88841ef [libpng16] Imported from libpng-1.6.25rc05.tar 2016-08-30 11:15:49 -05:00
Glenn Randers-Pehrson
42e5441888 [libpng16] Bump version to 1.6.25rc05 2016-08-30 10:46:51 -05:00
Glenn Randers-Pehrson
01b6ca34b7 [libpng16] Imported from libpng-1.6.25rc04.tar 2016-08-30 10:46:43 -05:00
Glenn Randers-Pehrson
4ade4e8a0d [libpng16] Updated CHANGES and ANNOUNCE 2016-08-30 04:26:29 -05:00
Mandar Sahastrabuddhe
d1f14c829a Added MIPS MSA optimization for following functions:
1. png_read_filter_row_sub4_msa
    2. png_read_filter_row_avg4_msa
    3. png_read_filter_row_paeth4_msa
    4. png_read_filter_row_sub3_msa
    5. png_read_filter_row_avg3_msa
    6. png_read_filter_row_paeth3_msa

Signed-off-by: Mandar Sahastrabuddhe <Mandar.Sahastrabuddhe@imgtec.com>
2016-08-30 13:51:25 +05:30
Mandar Sahastrabuddhe
b43133b361 Merge pull request #1 from glennrp/libpng16
Update from original
2016-08-30 11:13:12 +05:30
Glenn Randers-Pehrson
2e2330bf25 [libpng16] Bump version to 1.6.25rc04 2016-08-29 16:15:28 -05:00
Glenn Randers-Pehrson
0a2d496d58 [libpng16] Imported from libpng-1.6.25rc03.tar 2016-08-29 16:10:33 -05:00
Glenn Randers-Pehrson
000f07bfbe [libpng16] Bump version to 1.6.25rc03 2016-08-29 10:57:26 -05:00
Glenn Randers-Pehrson
2e7c3a6e70 [libpng16] Imported from libpng-1.6.25rc02.tar 2016-08-29 10:45:13 -05:00
Glenn Randers-Pehrson
05a4db1fcd [libpng16] Update CHANGES, ANNOUNCE with entry about MIPS support 2016-08-29 09:13:09 -05:00
Mandar Sahastrabuddhe
ee5e39835c Added build support for MIPS MSA
Also added one msa optimized function: png_read_filter_row_up_msa

Signed-off-by: Mandar Sahastrabuddhe <Mandar.Sahastrabuddhe@imgtec.com>
2016-08-29 19:07:25 +05:30
Glenn Randers-Pehrson
143434ac78 [libpng16] Bump version to 1.6.25beta03 2016-08-18 12:23:08 -05:00
Glenn Randers-Pehrson
4dc4b2efac [libpng16] Imported from libpng-1.6.25beta02.tar 2016-08-18 12:17:31 -05:00
Glenn Randers-Pehrson
e175eb1ffb [libpng16] Further trivial editing of whitespace in INSTALL 2016-08-18 12:15:53 -05:00
Glenn Randers-Pehrson
4be85e1b37 [libpng16] Rebased contrib/intel/intel_sse.patch 2016-08-17 06:52:07 -05:00
Glenn Randers-Pehrson
9cab7a24fd [libpng16] Minor editing of INSTALL, (whitespace, added copyright line) 2016-08-17 06:39:26 -05:00
Glenn Randers-Pehrson
39df0ced18 [libpng16] Don't install pngcp; it conflicts with pngcp in the pngtools package.
Moved it from bin_PROGRAMS to check_PROGRAMS in Makefile.am so it will be
built but not installed.
2016-08-13 21:23:42 -05:00
Glenn Randers-Pehrson
2705f55221 [libpng16] Bump version to 1.6.25beta02 2016-08-12 07:05:46 -05:00
Glenn Randers-Pehrson
4679be7c2b [libpng16] Imported from libpng-1.6.25beta01.tar 2016-08-12 07:00:44 -05:00
Glenn Randers-Pehrson
935676cdad [libpng16] Revert use of png_malloc_array in iCCP chunk reader 2016-08-12 06:58:15 -05:00
Glenn Randers-Pehrson
8ff2ed2fe1 [libng16] Conditionally compile png_inflate(). It's not needed for iCCP
chunk reading.
2016-08-11 20:13:33 -05:00
Glenn Randers-Pehrson
6bdaf38d12 [libpng16] Revert change to png_malloc_array(). It's not needed
now that iCCP profile_length honors PNG_USER_CHUNK_MALLOC_MAX.
2016-08-10 22:26:12 -05:00
Glenn Randers-Pehrson
e018ab98be Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-08-10 20:49:48 -05:00
John Bowler
92a7c79db2 [libpng16] Reject oversized iCCP profile length
The code now validates the ICC profile length against the user chunk limit
before the buffer is allocated, as opposed to doing it while the buffer is read.

This removes the potential to consume virtual address space with a carefully
crafted ICC profile; only an issue on 32-bit systems where a valid profile can
be up to 2^32-4 bytes in length.  libpng never writes beyond the application
supplied limit, but previously it did allocate a buffer of the size specified in
the profile header.  The exploitability of this is almost zero; the address
space is released as soon as the PNG read completes.

Also clean up PNG_DEBUG compile of pngtest.c.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-08-10 15:35:09 -07:00
Glenn Randers-Pehrson
19fefd3a4b [libpng16] Return NULL from png_malloc_array() with a warning instead of calling
png_error() on failure.  Reject oversized iCCP profile immediately.
2016-08-10 12:09:22 -05:00
Glenn Randers-Pehrson
cdc0e74ee6 [libpng16] Bump version to 1.6.25beta01 2016-08-03 21:59:27 -05:00
Glenn Randers-Pehrson
0c29ab2b31 [master] Imported from libpng-1.6.24.tar 2016-08-03 21:42:00 -05:00
Glenn Randers-Pehrson
b50d5cea2b [libpng16] Imported from libpng-1.6.24.tar 2016-08-03 21:32:26 -05:00
Glenn Randers-Pehrson
3d3c23b39f [libpng16] Bump version to 1.6.24rc04 2016-08-02 12:58:15 -05:00
Glenn Randers-Pehrson
2bb9ee89fa [libpng16] Imported from libpng-1.6.24rc03.tar 2016-08-02 12:58:07 -05:00
Glenn Randers-Pehrson
96db0fff50 [libpng16] Conditionally compile ARM_NEON headers in pngpriv.h
Updated contrib/intel/intel_sse.patch
2016-08-02 09:31:05 -05:00
Glenn Randers-Pehrson
99663e95f8 [libpng16] Bump version to 1.6.24rc03 2016-08-01 18:00:51 -05:00
Glenn Randers-Pehrson
1153ddccb6 [libpng16] Imported from libpng-1.6.24rc02.tar 2016-08-01 18:00:40 -05:00
Glenn Randers-Pehrson
8d091a640b [libpng16] Conditionally compile png_decompress_chunk(). 2016-08-01 17:50:42 -05:00
Glenn Randers-Pehrson
2c0b7a8ff6 [libpng16] Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch 2016-07-31 21:22:06 -05:00
Glenn Randers-Pehrson
faa3e537e1 [libpng16] Imported from libpng-1.6.24rc01.tar 2016-07-25 07:53:38 -05:00
Glenn Randers-Pehrson
0a5e99d7ee [libpng16] Rebased contrib/intel/intel_sse.patch 2016-07-24 19:39:43 -05:00
Glenn Randers-Pehrson
d1f9149d8a [libpng16] Bump version to 1.6.24beta07 2016-07-19 17:01:50 -05:00
Glenn Randers-Pehrson
ee079481c9 [libpng16] Imported from libpng-1.6.24beta06.tar 2016-07-19 17:00:00 -05:00
Glenn Randers-Pehrson
639b48625f [libpng16] Eliminated unnecessary tests of boolean png_isaligned() vs 0. 2016-07-15 17:22:10 -05:00
Glenn Randers-Pehrson
dd70604cec [libpng16] Fixed more indentation 2016-07-15 11:20:46 -05:00
Glenn Randers-Pehrson
34c783e2fe [libpng16] Fix permission on reindent; add license info to contrib/tools/chkfmt 2016-07-14 18:53:30 -05:00
Glenn Randers-Pehrson
82d0009885 [libpng16] Add PD license to new "reindent" tool; remove unused environment var
I didn't intend to distribute this but it leaked into the libpng16 source,
so here it is.
2016-07-14 17:40:37 -05:00
Glenn Randers-Pehrson
baed0e32f9 [libpng16] Bump version to 1.6.24beta06 2016-07-14 09:55:45 -05:00
Glenn Randers-Pehrson
3c7c436303 [libpng16] Imported from libpng-1.6.24beta05.tar 2016-07-14 09:55:35 -05:00
Glenn Randers-Pehrson
9b14f5f85a [libpng16] Fix a bad indent in pngvalid.c 2016-07-13 17:21:31 -05:00
Glenn Randers-Pehrson
0fd9a249de [libpng16] Update "last changed" dates 2016-07-13 16:29:22 -05:00
Glenn Randers-Pehrson
7a18a2de59 [libpng16] Undo bad indentation change in example.c 2016-07-13 16:26:00 -05:00
Glenn Randers-Pehrson
5d7c7d5132 [libpng16] Fixed a harmless typo in pngwutil.c 2016-07-13 14:45:10 -05:00
Glenn Randers-Pehrson
192e92d681 [libpng16] Fixed some indentation to comply with our coding style. 2016-07-13 14:43:42 -05:00
Glenn Randers-Pehrson
1b9f4817c8 [libpng16] Bump version to 1.6.24beta05 2016-07-08 10:14:50 -05:00
Glenn Randers-Pehrson
d9940f6207 [libpng16] Imported from libpng-1.6.24beta04.tar 2016-07-08 10:14:42 -05:00
Glenn Randers-Pehrson
f7d5419816 [libpng16] Avoid filter-selection heuristic sum calculations in cases where
only one filter is a candidate for selection. This trades off code size (added
png_setup_*_row_only() functions) for speed.
2016-07-08 10:09:25 -05:00
Glenn Randers-Pehrson
9928ee0a52 [libpng16] Bump version to 1.6.24beta04 2016-07-04 09:55:49 -05:00
Glenn Randers-Pehrson
66f796e74c [libpng16] Imported from libpng-1.6.24beta03.tar 2016-07-04 09:55:12 -05:00
Glenn Randers-Pehrson
a3eac818d5 [libpng16] Update CHANGES and ANNOUNCE 2016-07-03 18:10:21 -05:00
John Bowler
cfc19ff1b6 pngcp bug fixes
The fixed size buffer for the file name being processed could have a byte
written beyond the end; a bug where the test was updated without changing the
size of the buffer.  This commit reduces the buffer to the system maximum.

png_getrowbytes could, in theory, return 0; probably only if there is a bug in
libpng but the code now checks.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-03 13:49:36 -07:00
Glenn Randers-Pehrson
80495124b2 [libpng16] Don't call png_icc_set_sRGB() when it's not compiled. 2016-07-03 10:28:54 -05:00
Glenn Randers-Pehrson
2c21a4778d [libpng16] Relocated misplaced #endif in png.c sRGB profile checking. 2016-07-02 21:17:56 -05:00
Glenn Randers-Pehrson
14b8dee96f Merge branch 'libpng16' of ssh://git.code.sf.net/p/libpng/code into libpng16 2016-07-02 14:32:37 -05:00
Glenn Randers-Pehrson
11c88033d4 [libpng16] Added "Common linking failures" section to INSTALL 2016-07-02 14:29:29 -05:00
Glenn Randers-Pehrson
25bb30c9b8 [libpng16] Added "Common linking failures" section to INSTALL 2016-07-02 12:00:07 -05:00
John Bowler
54feb0ad2a pngimage: correct #define checking
In libpng 1.7 pngimage needs to check PNG_WRITE_PNG_SUPPORTED (new in 1.7), not
PNG_WRITE_SUPPORTED because png_write_png can be disabled without disabling
PNG_WRITE_SUPPORTED.  Copied the approach from 1.6 pngcp.c (so this still works
in 1.6 as well.)
2016-07-02 08:03:09 -07:00
Glenn Randers-Pehrson
b733c50bc0 [libpng16] Updated CHANGES and ANNOUNCE 2016-07-01 18:42:07 -05:00
John Bowler
a93744423d pngcp.c: correct total time output
Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:29:58 -07:00
John Bowler
9957c45073 pngcp: add high resolution timing
If PNG_PNGCP_TIMING_SUPPORTED is defined maximal resolution CPU time logging of
png_read_png and png_write_png is enabled via the --time command line option.
This is not on by default but is enabled by contrib/conftests/pngcp.dfa

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:29:45 -07:00
John Bowler
0ac91cc657 pngcp: tool to copy PNG files
This adds pngcp to the build together with a pngcp.dfa configuration test; the
test revealed some configuration bugs which are fixed by corrections to the
_SUPPORTED macros.

pngcp builds on all tested configurations and a number of bugs have been fixed
to make this happen relative to the version in libpng 1.7 contrib/examples.
pngcp.dfa will have to be different for 1.7 but pngcp.c should work fine (not
yet tested).  pngcp itself is still missing a usage message; this is a
preliminary version, although since it behaves the same way as 'cp' most unoids
shouldn't have a problem using it correctly.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:27:43 -07:00
Glenn Randers-Pehrson
d9779744f9 [libpng16] Optimized absolute value calculation in filter selection, similar to
code in the PAETH decoder in pngrutil.c. Build with PNG_USE_ABS to use this.
2016-06-29 21:53:57 -05:00
Glenn Randers-Pehrson
ed5a01d922 [libpng16] Update ANNOUNCE 2016-06-23 11:53:31 -05:00
Glenn Randers-Pehrson
d43f93ff93 [libpng16] Bump version to 1.6.24beta03 2016-06-23 11:27:12 -05:00
Glenn Randers-Pehrson
3f2879bf60 [libpng16] Imported from libpng-1.6.24beta02.tar 2016-06-23 11:26:59 -05:00
Glenn Randers-Pehrson
ee1e535298 [libpng16] Bump version to 1.6.24beta03 2016-06-23 11:08:14 -05:00
Glenn Randers-Pehrson
4b4a9583b4 [libpng16] Imported from libpng-1.6.24beta02.tar 2016-06-23 11:08:06 -05:00
John Bowler
da2ba024a5 [libpng16] Update CHANGES and ANNOUNCE 2016-06-23 10:51:44 -05:00
John Bowler
e5d468ea9c projects/vstudio: enthusiastic warnings
The commit removes the three compile warning options from the individual project
files into the zlib.props globals (this should probably be renamed in 1.7).  It
increases the warning level from 4 to All and adds a list of the warnings which
need to be turned off.  This is semi-documentary; the intent is to tell users of
libpng which warnings have been examined and judged non-fixable at present.

The warning about structure padding *IS* fixable, but it is a signficant change
(moving structure members around).  It is currently partially fixed in 1.7, but
only partially.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:40:06 -07:00
John Bowler
21d9e6e0fb SKIP definition in pngstest.c misplaced
The SKIP definition needs to come after the png.h include (see all the other .c
files in contrib/libtests) because it depends on PNG_LIBPNG_VER.  This commit
puts it in the correct place.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:38:56 -07:00
John Bowler
98af505439 Fix MSVC Level 4 warning
MSVC does not like (uInt) = -(unsigned) (i.e. as an initializer), but it is fine
with it if the conversion is explicitly invoked by a cast.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:37:20 -07:00
John Bowler
1df0ace0b4 Fix MSVC Level 2 warning
MSVC doesn't like '-(unsigned)', so replace it by 0U-(unsigned) (in 1.6).

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-22 17:35:49 -07:00
John Bowler
4af267c07b Merge branch 'libpng16' of ../../libpng into libpng16 2016-06-20 09:23:59 -07:00
Glenn Randers-Pehrson
6c7c5a04b8 [libpng16] More efficient absolute value calculation on SSE2 (Matthieu Darbois). 2016-06-20 08:28:34 -05:00
Glenn Randers-Pehrson
42069e9432 Merge branch 'tryagain' of git://github.com/mattsarett/libpng into libpng16 2016-06-20 08:27:24 -05:00
Matt Sarett
36762ac4b4 More efficient absolute value on SSE2 2016-06-20 09:06:25 -04:00
Glenn Randers-Pehrson
147dc568da [libpng16] Backed out previous optimization; the compiler should handle that. 2016-06-19 22:20:52 -05:00
Glenn Randers-Pehrson
29135161d7 [libpng16] Avoid filter-selection heuristic sum calculations in cases where
only one filter is a candidate for selection. This trades off code size (added
png_setup_*_row_only() functions) for speed.
2016-06-19 18:43:35 -05:00
John Bowler
9c04f57cab [libpng15] Corrected filter heuristic overflow handling. 2016-06-19 18:01:33 -05:00
John Bowler
e1123aa80c Merge branch 'libpng16' of ../../libpng into libpng16 2016-06-12 06:51:09 -07:00
Glenn Randers-Pehrson
4a8105e925 [libpng16] Bump version to 1.6.24beta02 2016-06-11 18:07:44 -05:00
Glenn Randers-Pehrson
51df269afe [libpng16] Imported from libpng-1.6.24beta01.tar 2016-06-11 18:07:22 -05:00
John Bowler
bf2613b975 Merge branch 'libpng16' of ../../libpng into libpng16 2016-06-11 14:18:35 -07:00
John Bowler
5c6b7e177c [libpng16] Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macro
is not used within libpng, but is used in some of the examples.
2016-06-11 14:11:09 -05:00
Glenn Randers-Pehrson
428f5ddabd [libpng16] Bump version to 1.6.24beta01 2016-06-11 14:10:03 -05:00
John Bowler
a4b26efa1f Change image size checks
This covers the case where PNG_IMAGE_BUFFER_SIZE can overflow in the application
as a result of the application using an increased 'row_stride'; previously
png_image_finish_read only checked for overflow on the base calculation of
components.  (I.e. it checked for overflow of a 32-bit number on the total
number of pixel components in the output format, not the possibly padded row
length and not the number of bytes, which for linear formats is twice the number
of components.)

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-11 10:04:28 -07:00
Glenn Randers-Pehrson
5a8b04137f [master] Imported from libpng-1.6.23.tar 2016-06-09 07:08:36 -05:00
Glenn Randers-Pehrson
ed6db9d86b [libpng16] Imported from libpng-1.6.23.tar 2016-06-09 06:49:42 -05:00
Glenn Randers-Pehrson
ee3c4e43ae [libpng16] Fixed bad link to RFC2083 in png.5 (Nikola Forro). 2016-06-07 08:22:18 -05:00
Glenn Randers-Pehrson
6d4e4d0cce [libpng16] Imported from libpng-1.6.23rc02.tar 2016-06-03 21:28:20 -05:00
Glenn Randers-Pehrson
89158b9ad1 [libpng16] Fixed undefined behavior in png_push_save_buffer(). Do not call
memcpy() with a null source, even if count is zero (Leon Scroggins III).
2016-06-03 18:40:42 -05:00
Glenn Randers-Pehrson
1fdac25f66 [libpng16] Imported from libpng-1.6.23rc01.tar 2016-06-01 19:17:57 -05:00
Glenn Randers-Pehrson
1017744c94 [libpng16] Added missing ")" in pngerror.c (Matt Sarrett). 2016-06-01 08:59:48 -05:00
Glenn Randers-Pehrson
f757d74898 [libpng16] Moved sse2 prototype from pngpriv.h to contrib/intel/intel_sse.patch. 2016-05-31 09:45:17 -05:00
John Bowler
bd2370c054 pngvalid.c: don't use size_t count arguments
Coverity rejects code where an array element count has type size_t, this
elminates the code in question from contrib/libtests/pngvalid.c

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-30 08:12:51 -07:00
Glenn Randers-Pehrson
dbfd68ae3a [libpng16] Update CHANGES, ANNOUNCE, and change date in pngvalid.c 2016-05-29 15:47:57 -05:00
John Bowler
801b925edf pngvalid.c: correct progressive read input buffer
The previous version of the code invariably passed just one byte at a time to
libpng.  The intention was to pass a random number of bytes in the range 0..511
(and this is what happens now).

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-29 09:30:00 -07:00
Glenn Randers-Pehrson
a201f859cd [libpng16] Bump version to 1.6.23beta02 2016-05-29 09:52:31 -05:00
Glenn Randers-Pehrson
84cc738166 [libpng16] Imported from libpng-1.6.23beta01.tar 2016-05-29 09:47:30 -05:00
John Bowler
81f0273d54 [libpng16] Added tests in pngvalid.c to check zero-length IDAT chunks in various
positions.  Fixed the sequential reader to handle these more robustly
(John Bowler).
2016-05-29 09:45:33 -05:00
Timothy Nikkel
3f46c67c69 [libpng16] Fixed the progressive reader to handle empty first IDAT chunk
properly (patch by Timothy Nikkel).
2016-05-29 09:44:04 -05:00
Glenn Randers-Pehrson
6c7459e455 [libpng16] Ensure png_ptr->trans_values is set in png_set_tRNS(). 2016-05-27 20:09:23 -05:00
Glenn Randers-Pehrson
8d16725373 [libpng16] Stop a potential memleak in png_set_tRNS() (Bug report by Ted Ying). 2016-05-27 19:55:44 -05:00
Glenn Randers-Pehrson
4e34fd3b8a [libpng16] Bump version to 1.6.23beta01 2016-05-27 19:48:24 -05:00
Glenn Randers-Pehrson
87c14c528a [master] Imported from libpng-1.6.22.tar 2016-05-26 07:25:22 -05:00
Glenn Randers-Pehrson
ac43a87820 [libpng16] Imported from libpng-1.6.22.tar 2016-05-26 07:25:14 -05:00
Glenn Randers-Pehrson
474751e6b2 [libpng16] Bump version to 1.6.22rc04 2016-05-18 07:32:07 -05:00
Glenn Randers-Pehrson
37ab4d946c [libpng16] Imported from libpng-1.6.22rc03.tar 2016-05-18 07:26:06 -05:00
Glenn Randers-Pehrson
d6e5a72c84 [libpng16] Restored contrib/timepng to default build but check for check for
presence of clock_gettime() in configure.ac and Makefile.am.
2016-05-17 18:35:59 -05:00
Glenn Randers-Pehrson
add4581894 [libpng16] Imported from libpng-1.6.22rc02.tar 2016-05-16 16:18:48 -05:00
Glenn Randers-Pehrson
45ad37b31b [libpng16] Removed contrib/timepng from default build; it does not build
on platforms that don't supply clock_gettime().
2016-05-16 16:14:12 -05:00
Glenn Randers-Pehrson
f6ca49c863 [libpng16] Imported from libpng-1.6.22rc01.tar 2016-05-14 09:47:55 -05:00
Glenn Randers-Pehrson
7fa1b5b26c [libpng16] Bump version to 1.6.22beta07 2016-05-05 19:38:04 -05:00
Glenn Randers-Pehrson
0794fee913 [libpng16] Imported from libpng-1.6.22beta06.tar 2016-05-05 19:37:54 -05:00
David Capello
319a7b842b Fix genout compilation when CMAKE_OSX_ARCHITECTURES isn't specified 2016-05-04 11:30:43 -03:00
Glenn Randers-Pehrson
50d41533d2 [libpng16] Log changes to scripts/genout.cmake.in (David Capello, Nixon Kwok): 2016-05-01 19:38:12 -05:00
Glenn Randers-Pehrson
8e89b13c47 [libpng16] Fixed issues with scripts/genout.cmake.in (pull requests from dacap@github):
Added support to use multiple directories in ZLIBINCDIR variable,
    Fixed CMAKE_C_FLAGS with multiple values when genout is compiled on MSVC,
    Fixed pnglibconf.c compilation on OS X including the sysroot path.
2016-05-01 19:27:30 -05:00
Glenn Randers-Pehrson
f962ee9dc6 Merge branch 'fix-pnglibconf-on-osx' of git://github.com/aseprite/libpng into libpng16 2016-05-01 19:04:25 -05:00
Glenn Randers-Pehrson
a271625928 Merge branch 'fix-genout-with-multiple-zlib-inc-dirs' of git://github.com/aseprite/libpng into libpng16 2016-05-01 19:03:46 -05:00
Glenn Randers-Pehrson
9f642c1bbc Merge branch 'fix-genout-with-multiple-c-flags' of git://github.com/aseprite/libpng into libpng16 2016-05-01 19:02:49 -05:00
Glenn Randers-Pehrson
21939d36ec [libpng16] Use PNG_UINT_31_MAX instead of constant 0x7fffffff in timepng.c 2016-04-29 21:48:52 -05:00
Glenn Randers-Pehrson
8c754b1834 [libpng16] Quieted two Coverity issues in contrib/libtests/timepng.c. 2016-04-28 21:23:37 -05:00
Glenn Randers-Pehrson
2b9f68631c [libpng16] Rebased contrib/intel_sse.patch. 2016-04-27 22:40:39 -05:00
Glenn Randers-Pehrson
830608b4b8 [libpng16] Bump version to 1.6.22beta06 2016-04-27 13:01:29 -05:00
Glenn Randers-Pehrson
eefd9127ca [libpng16] Imported from libpng-1.6.22beta05.tar 2016-04-27 13:01:14 -05:00
Glenn Randers-Pehrson
0392e36e94 [libpng16] Fixed typo (missing underscore) in #define PNG_READ_16_TO_8_SUPPORTED
(Bug report by Y.Ohashik).
2016-04-19 08:35:09 -05:00
Glenn Randers-Pehrson
a967818235 [libpng16] Moved INTEL-SSE code from pngpriv.h to contrib/intel/intel_sse.patch. 2016-04-19 08:23:10 -05:00
Glenn Randers-Pehrson
8eaa434163 [libpng16] Update CHANGES and ANNOUNCE about timepng.c changes 2016-04-15 11:29:29 -05:00
John Bowler
af9d06e06a timepng: better errors, fix signed overflow
Too many input files would overflow nfiles

Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-13 10:04:08 -07:00
John Bowler
703944c39d timepng: C++ fixes, correct add_one_file
timepng would could a file as added even if it failed and the assembly file got
rewound.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-13 09:37:25 -07:00
John Bowler
e81f16bf5d timepng: more support requirements
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:17:22 -07:00
John Bowler
7572840cd0 timepng requires STDIO
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:10:04 -07:00
John Bowler
569a1d27b4 Fix timepng 'skip' return code.
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:04:27 -07:00
John Bowler
d642eede9a timepng: fix builds when there is no read support
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 21:01:50 -07:00
John Bowler
5b0a0ded05 ANSI C overlength string fix
Signed-off-by: John Bowler <jbowler@acm.org>
2016-04-12 20:43:29 -07:00
John Bowler
819b125e6e Merge branch 'libpng16' of ../../libpng into libpng16 2016-04-12 20:10:55 -07:00
Glenn Randers-Pehrson
fa551df95e [libpng16] Added PNG_FAST_FILTERS macro (defined as
PNG_FILTER_NONE|PNG_FILTER_SUB|PNG_FILTER_UP).
2016-04-11 08:23:16 -05:00
John Bowler
76531da252 Merge branch 'libpng16' of ../../libpng into libpng16 2016-04-05 18:52:26 -07:00
Glenn Randers-Pehrson
daf2169797 [libpng16] Bump version to 1.6.22beta05 2016-04-05 19:38:42 -05:00
Glenn Randers-Pehrson
e0acad59cb [libpng16] Imported from libpng-1.6.22beta04.tar 2016-04-05 19:38:22 -05:00
Glenn Randers-Pehrson
5765a22249 [libpng16] Eliminate PNG_NO_INTEL_SSE_3BPP from intel INSTALL 2016-04-05 12:33:17 -05:00
Glenn Randers-Pehrson
f47e1d4995 [libpng16] Eliminated PNG_NO_INTEL_SSE_3BPP which was just for testing. 2016-04-05 12:16:27 -05:00
Mike Klein
8f506d3257 SSE filter speed improvements for bpp=3.
- memcpy-free implementations of load3() / store3().
    These should have less variance compiler to compiler.

    - call load3() only when needed at the end of a scanline.
    In the middle, we can use the faster load4(), ignoring that byte.
2016-04-04 16:10:09 -04:00
David Capello
d960ced6e1 Fix pnglibconf.c compilation on OS X including the sysroot path
Without these flags pnglibconf.c compilation fails because it
includes zlib.h -> zconf.h -> sys/types.h which is not found until we
give a correct SDK path with -isysroot flag.
2016-03-31 17:41:16 -03:00
David Capello
7cf9a34ade Fix CMAKE_C_FLAGS with multiple values when genout is compiled on MSVC
Without this patch, CMAKE_C_FLAGS will be processed as a
string/filename on MSVC (e.g. when CMAKE_C_FLAGS is equal
to " /D_WIN32 /D_WINDOWS /W3") and the whole compilation fails.
2016-03-31 14:28:45 -03:00
David Capello
5ef8d1bfbf Add support to use multiple directories in ZLIBINCDIR variable
For example, ZLIB_INCLUDE_DIR might include the directory where zlib.h
is located (source dir) and the zconf.h file is located (binary dir).
2016-03-31 14:18:27 -03:00
John Bowler
6ee90f06ab Merge branch 'libpng16' of ../../libpng into libpng16 2016-03-18 11:49:11 -07:00
Glenn Randers-Pehrson
46861bc41e [libpng16] Reformatted the new code in configure.ac 2016-03-15 07:55:41 -05:00
Dagobert Michelsen
12e63e91af Force back to C89 if needed. This fixes #245 2016-03-14 16:21:06 +01:00
Glenn Randers-Pehrson
edad4639cf [libpng16] Bump version to 1.6.22beta04 2016-03-09 12:04:48 -06:00
Glenn Randers-Pehrson
1a3fa1e091 [libpng16] Imported from libpng-1.6.22beta03.tar 2016-03-09 12:04:40 -06:00
Glenn Randers-Pehrson
9295264b6f [libpng16] Update CHANGES and ANNOUNCE 2016-03-07 07:17:28 -06:00
Krishnaraj Bhat
46c47291e8 gcc6: fix misleading indentation warning
Although not a bug in this case, but shows up when -Wall is used
2016-03-07 13:56:15 +05:30
John Bowler
e25323e81b Merge remote-tracking branch 'local/libpng16' into libpng16 2016-02-28 17:44:34 -08:00
John Bowler
2a25fc41f6 [libpng16] timepng usage message, ability to cache the test set
This makes tests slightly quicker by allowing the temporary file to be created
beforehand.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-28 12:24:52 -06:00
John Bowler
4b4700ceca Usage message, ability to cache the test set
This makes tests slightly quicker by allowing the temporary file to be created
beforehand.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-27 21:35:29 -08:00
Glenn Randers-Pehrson
0df91242a2 [libpng16] Update CHANGES and ANNOUNCE, about timepng.c 2016-02-26 19:35:59 -06:00
John Bowler
9821954ecc contrib/libtests/timepng: make robust, improve
The code no longer gives up/fails on invalid PNG data, it just skips it (with
error messages).  The code no longer fails on PNG files with data beyond IEND.
Options exist to use png_read_png (reading the whole image, not by row) and, in
that case, to apply any of the supported transforms.  This makes for more
realistic testing; the decoded data actually gets used in a meaningful fashion.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-02-26 16:33:38 -08:00
Glenn Randers-Pehrson
e2d113cadf [libpng16] Updated INSTALL instructions for intel SSE code 2016-02-23 09:29:08 -06:00
Glenn Randers-Pehrson
b4f9f5d041 [libpng16] Fixed cut-and-paste errors in the new intel_sse.patch
and added PNG_NO_INTEL_SSE_3BPP macro.
2016-02-22 18:50:59 -06:00
Glenn Randers-Pehrson
6c3d5bd2a0 [libpng16] Moved contrib/intel/*.patch into INSTALL and added intel_sse.patch 2016-02-22 16:38:10 -06:00
Glenn Randers-Pehrson
da9d1d7aa6 [libpng16] Added pngdebug() statements to the new intel code and the arm code. 2016-02-19 14:58:59 -06:00
Glenn Randers-Pehrson
52846504da [libpng16] Fix copyright in sse code, use C-style comments 2016-02-19 09:46:51 -06:00
Glenn Randers-Pehrson
d06d66e899 [libpng16] Added contrib/intel/INSTALL 2016-02-18 22:17:46 -06:00
Glenn Randers-Pehrson
cdd9a23fd4 [libpng16] Fixed include directives in two new intel files to reflect
their new location in contrib/intel/* (was intel/*)
2016-02-18 21:23:24 -06:00
Glenn Randers-Pehrson
4233766b1d [libpng16] Added Intel SSE support (Matt Sarrett, Google Inc.) 2016-02-18 21:20:28 -06:00
Glenn Randers-Pehrson
f78d1cd47a [libpng16] Updated LICENSE to say files in the contrib directory are not
necessarily under the libpng license, and that some makefiles have
other copyright owners.
2016-02-18 21:10:52 -06:00
Matt Sarett
c3a45944e2 Fix paths in Makefile.am.patch 2016-02-18 12:45:13 -05:00
Matt Sarett
342c4eab2a Move sse opts into contrib/intel 2016-02-18 12:43:50 -05:00
Matt Sarett
fb375429b5 Fix host_cpu check 2016-02-17 11:52:09 -05:00
Matt Sarett
9a308a3344 Add intel opts to Makefile and configure.ac 2016-02-17 11:43:34 -05:00
Glenn Randers-Pehrson
0348a407e5 [libpng16] Add ${INCLUDES} in scripts/genout.cmake.in (Bug report by Nixon Kwok). 2016-02-16 14:38:28 -06:00
Matt Sarett
5bc58a0ebc Use immintrin, tweak checks for SSE4, SSSE3 2016-02-16 10:53:36 -05:00
Matt Sarett
577c1f0305 Reformat a bit, add MSVS checks, add SSE4 2016-02-16 10:10:11 -05:00
Matt Sarett
f84f957881 Use PNG_INTEL_SSE_OPT instead of PNG_INTEL_SSE2_OPT 2016-02-15 14:45:14 -05:00
Matt Sarett
9c946e22fc Add SSSE3 and SSE2 optimized png filter functions 2016-02-15 14:41:27 -05:00
Glenn Randers-Pehrson
1099cdcb5a [libpng16] Removed dubious "#if INT_MAX" test from png.h that was added to
libpng-1.6.19bet02 (John Bowler).
2016-02-13 15:02:16 -06:00
Robert C. Seacord
0c27c8633e [libpng16] Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU
(Robert C. Seacord).
2016-02-13 12:59:39 -06:00
Glenn Randers-Pehrson
baf301d122 [libpng16] Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
were accidentally removed from libpng-1.6.17.
2016-02-13 12:01:35 -06:00
Glenn Randers-Pehrson
08bd7654bc [libpng16] Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page.
2016-02-10 11:46:31 -06:00
Glenn Randers-Pehrson
7684bcae7d [libpng16] Make cmake install public header pnglibconf.h 2016-02-09 09:08:46 -06:00
Glenn Randers-Pehrson
461c7e45b5 [libpng16] Bump version to 1.6.22beta03 2016-02-08 17:13:14 -06:00
Glenn Randers-Pehrson
a4a54aa1bf [libpng16] Imported from libpng-1.6.22beta02.tar 2016-02-08 17:13:06 -06:00
Roger Leigh
337c694971 [libpng16] Remove extra pngvalid test from CMakeLists.txt 2016-01-30 17:06:13 -06:00
Glenn Randers-Pehrson
05591abeb1 [libpng16] Updated CHANGES, ANNOUNCE, change date in pngrtran.c 2016-01-30 10:08:47 -06:00
Glenn Randers-Pehrson
196a50a4bd Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-01-30 10:00:51 -06:00
Glenn Randers-Pehrson
84a5b7a0f8 [libpng16] Remove redundante dependencies from CMakeLists.txt 2016-01-30 09:49:45 -06:00
Glenn Randers-Pehrson
ed23815985 [libpng16] Removed pngstest-pngsuite test from CMakeLists.txt 2016-01-30 09:32:25 -06:00
John Bowler
f1eafe8b01 Relax limit checks on gamma values.
As suggested in the comments gamma values outside the range currently permitted
by png_set_alpha_mode are useful for HDR data encoding.  These values are
already permitted by png_set_gamma so it is reasonable caution to extend the
png_set_alpha_mode range as HDR imaging systems are starting to emerge.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-29 18:09:49 -08:00
Glenn Randers-Pehrson
2d3bd021d0 Merge branch 'libpng16' of git://github.com/jbowler/libpng into libpng16 2016-01-29 16:23:51 -06:00
Glenn Randers-Pehrson
2a28a4320a [libpng16] Update copyright information in cmake scripts. 2016-01-29 09:14:41 -06:00
Roger Leigh
8fb55653d1 [libpng16] cmake: Sort test file lists for consistency 2016-01-29 08:25:14 -06:00
John Bowler
e717842a54 pngstest: options to fix per-file seed
Also avoid command output substition in tests/pngstest and fix the collation
locale to ASCII/C/POSIX

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-28 23:10:04 -08:00
Roger Leigh
74e481c743 [libpng16] Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
and test.cmake.in
2016-01-28 15:58:45 -06:00
John Bowler
98c6fa2495 PNG_IMAGE_PNG_SIZE_MAX error correction
The macro underreported the size (by up to 512 bytes) of an 8-bit non-color
palette based memory format because it failed to take into account that the
memory palette has to be expanded to full RGB when it is written to PNG.

This is not likely to be a serious bug because the macro is new, the memory
format in question is likely to be rarely used and the result of an undersized
buffer fails in a safe way.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-27 16:22:51 -08:00
Glenn Randers-Pehrson
4dac51d260 [libpng16] Update CHANGES and ANNOUNCE 2016-01-27 06:57:02 -06:00
John Bowler
ac796d3f9a Only use exit(77) in configure builds
Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-26 17:55:39 -08:00
Glenn Randers-Pehrson
e0ce90ea0a [libpng16] Bump version to 1.6.22beta02 2016-01-23 14:58:07 -06:00
Glenn Randers-Pehrson
f6a23fe205 [libpng16] Imported from libpng-1.6.22beta01.tar 2016-01-23 14:06:39 -06:00
Glenn Randers-Pehrson
d2b8d46658 [libpng16] Document new png_image_write_to_memory() API 2016-01-23 14:01:44 -06:00
Glenn Randers-Pehrson
93a3bc7343 [libpng16] Revised workaround for Coverity issue in pngvalid.c 2016-01-23 10:09:18 -06:00
John Bowler
7f576964d8 pngunknown.c: handle unknown IDAT
This is the test backported from 1.7 to ensure that when treating IDATs as
unknown the test does not fail if there are more than one IDAT chunks in the
file.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 19:19:14 -08:00
Glenn Randers-Pehrson
0873ae8242 Merge branch 'libpng16-simple-memory-II' of git://github.com/jbowler/libpng-1 into libpng16 2016-01-18 13:01:19 -06:00
Glenn Randers-Pehrson
571abc9a67 [libpng16] Update CHANGES and ANNOUNCE, fix typos in png.h comments 2016-01-18 12:55:51 -06:00
John Bowler
c68f20cecc Merge branch 'libpng16' into libpng16-simple-memory-II 2016-01-18 10:50:46 -08:00
Glenn Randers-Pehrson
94f4e972b5 Merge branch 'libpng16-simple-memory-II' of git://github.com/jbowler/libpng-1 into libpng16 2016-01-18 12:43:36 -06:00
John Bowler
175a126a1a Simplified API: write-to-memory, overflow handling
This implements an API and provides a number of assist macros to allow an
application which uses the simplified API write to bypass stdio and write
directly to memory.

It also includes some warnings (png.h) and some check code to detect *possible*
overflow in the ROW_STRIDE and simplified image SIZE macros.  This disallows
image width/height/format that *might* overflow.  A quiet API change that limits
in-memory image size (uncompressed) to less that 4GByte and image row size
(stride) to less than 2GByte.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 09:53:38 -08:00
Glenn Randers-Pehrson
95d2726ecc [libpng16] Update change dates in pngvalid.c and pngfix.c 2016-01-18 09:24:23 -06:00
Glenn Randers-Pehrson
b8dbd78de8 [libpng16] Updated CHANGES, ANNOUNCE, and copyright notice in pngunknown.c 2016-01-18 09:09:33 -06:00
John Bowler
777dbf46dc pngunknown: fix NO_STDIO build
pngunknown.c calls png_init_io (always), skip the test if there is no stdio.h
support.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-18 05:08:27 -08:00
Glenn Randers-Pehrson
e8558d2160 [libpng16] Changed PNG_USE_MKSTEMP to __COVERITY__ to select alternate
"tmpfile()" implementation in contrib/libtests/pngstest.c
2016-01-17 16:08:39 -06:00
Glenn Randers-Pehrson
5031c77d85 [libpng16] Bump version to 1.6.22beta01 2016-01-16 08:00:09 -06:00
Glenn Randers-Pehrson
5756fcab2f [master] Imported from libpng-1.6.21.tar 2016-01-15 14:04:53 -06:00
Glenn Randers-Pehrson
fc0786a442 [libpng16] Imported from libpng-1.6.21.tar 2016-01-15 13:51:06 -06:00
Glenn Randers-Pehrson
780079e771 [libpng16] Worked around a false-positive Coverity issue in pngvalid.c. 2016-01-13 09:50:41 -06:00
Glenn Randers-Pehrson
253326c52d [libpng16] Deleted a left-over cut-and-paste line in png_get_copyright(). 2016-01-08 06:30:15 -06:00
Glenn Randers-Pehrson
81dfc2163b [libpng16] Imported from libpng-1.6.21rc02.tar 2016-01-07 09:31:16 -06:00
Glenn Randers-Pehrson
9b54f0037a [libpng16] Update CHANGES and ANNOUNCE 2016-01-06 15:59:49 -06:00
John Bowler
b416dc5fc8 Mark 'limit' UNUSED in transform_range_check
Only affects release builds

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-06 12:58:01 -08:00
Glenn Randers-Pehrson
ecc022ee5f [libpng16] Bump version to libpng-1.6.21rc02.tar 2016-01-06 13:26:32 -06:00
Glenn Randers-Pehrson
092b8d7bf3 [libpng16] Imported from libpng-1.6.21rc01.tar 2016-01-04 08:24:14 -06:00
Glenn Randers-Pehrson
912f030532 [libpng16] Removed redundant "option WRITE" from scripts/pnglibconf.dfa 2016-01-02 13:43:52 -06:00
Glenn Randers-Pehrson
66db757dd4 [libpng16] Happy 2016! Updated copyright year 2016-01-02 13:40:27 -06:00
Glenn Randers-Pehrson
9616bf6882 [libpng16] In projects/vstudio, combined readme.txt and WARNING into README.txt 2015-12-29 08:24:38 -06:00
Glenn Randers-Pehrson
dea53bb460 [libpng16] Bump version to 1.6.21beta04 2015-12-19 10:48:20 -06:00
Glenn Randers-Pehrson
35a5a6c16d [libpng16] Imported from libpng-1.6.21beta03.tar 2015-12-19 10:48:12 -06:00
Glenn Randers-Pehrson
42b438b7dc [libpng16] Update CHANGES and ANNOUNCE 2015-12-17 20:51:13 -06:00
John Bowler
18765d0032 Fix undefined behavior in pngvalid.c
Undefined because (png_byte) << shift is undefined if it changes the signed bit
(because png_byte is promoted to int).  The libpng exported functions
png_get_uint_32 and png_get_uint_16 handle this.

Bug reported by David Drysdale as a result of reports from UBSAN in clang 3.8.

This changes pngvalid to use BE random numbers; this used to produce errors but
these should not be fixed as a result of the previous changes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-17 12:53:08 -08:00
Glenn Randers-Pehrson
4aa590288b [libpng16] Updated CHANGES and ANNOUNCE 2015-12-15 12:55:56 -06:00
Glenn Randers-Pehrson
315b39c73a Merge branch 'libpng16' of git://github.com/jbowler/libpng-1 into libpng16 2015-12-15 12:28:33 -06:00
John Bowler
2225ca0a54 pngvalid with 'limit' checks disabled in RC+
This widens the 'limit' check on the internally calculated error limits in the
'DIGITIZE' case (the code used prior to 1.7 for rgb_to_gray error checks) and it
changes the check to only operate in non-release builds (base build type not RC
or RELEASE.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-15 08:28:47 -08:00
Glenn Randers-Pehrson
ad29c03711 [libpng16] Bump version to 1.6.21beta03 2015-12-13 23:24:36 -06:00
Glenn Randers-Pehrson
0a4967ce0c [libpng16] Imported from libpng-1.6.21beta02.tar 2015-12-13 23:23:41 -06:00
Glenn Randers-Pehrson
b3d3a5ed6a [libpng16] Imported from libpng-1.6.21beta02.tar 2015-12-13 22:44:31 -06:00
Glenn Randers-Pehrson
4d8de33979 [libpng16] Update copyright uears in source files. 2015-12-13 22:41:17 -06:00
Glenn Randers-Pehrson
32629bb522 [libpng16] Update CHANGES and ANNOUNCE 2015-12-13 20:35:15 -06:00
Glenn Randers-Pehrson
0bc972fbc2 [libpng16] Fix typo in "last-changed" date. 2015-12-13 20:19:36 -06:00
John Bowler
6cc84b3c44 Fix rgb_to_gray graylo==0 errors, build issues
Fixes to pngvalid for various reduced build configurations (eliminate unused
statics) and a fix for the case in rgb_to_gray when the digitize option reduces
graylo to 0, producing a large error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 18:00:41 -08:00
John Bowler
c5e81c51d9 Remove LE/BE dependencies in pngvalid
This 'fixes' the current problem in the BE tests by not testing it, making the
BE code the same as the LE version.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 17:15:02 -08:00
John Bowler
cbe5d34f6f Backport pngvalid.c from libpng17
One fix is required for libpng16 LE, more for libpng16 BE

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-13 17:07:36 -08:00
Glenn Randers-Pehrson
975cbbb029 [libpng16] Moved png_check_keyword() from pngwutil.c to pngset.c 2015-12-13 15:04:18 -06:00
Glenn Randers-Pehrson
f3da771890 [libpng16] Bump version to 1.6.21beta02 2015-12-11 19:21:01 -06:00
Glenn Randers-Pehrson
2edfd187f2 [libpng16] Imported from libpng-1.6.21beta01.tar 2015-12-11 16:39:54 -06:00
John Bowler
2c8a90ef52 [libpng16] Changed "( ... )" to " ... " in tests/pngstest (John Bowler) 2015-12-09 13:16:28 -06:00
Glenn Randers-Pehrson
0de0101fdd [libpng16] Bump version to 1.6.21beta01 2015-12-08 22:19:15 -06:00
Glenn Randers-Pehrson
1dbfb07c08 [libpng16] Fixed a syntax error in tests/pngstest that some shells other than
bash could not parse (Bug report by Nelson Beebe).
2015-12-08 22:18:01 -06:00
Glenn Randers-Pehrson
047737496a [master] Imported from libpng-1.6.20.tar 2015-12-02 22:37:04 -06:00
Glenn Randers-Pehrson
5b6a6f914b [libpng16] Imported from libpng-1.6.20.tar 2015-12-02 22:30:37 -06:00
Glenn Randers-Pehrson
4fa5f90346 [libpng16] Imported from libpng-1.6.20rc02.tar 2015-11-29 16:46:56 -06:00
Glenn Randers-Pehrson
ebeca5bd9b [libng16] Update CHANGES 2015-11-29 16:46:04 -06:00
Glenn Randers-Pehrson
9dcf45c65c Merge branch 'libpng16' of git://github.com/jbowler/libpng-1 into libpng16 2015-11-29 16:20:54 -06:00
Glenn Randers-Pehrson
030e12ec39 [libpng16] Bump version to libpng-1.6.20rc02.tar 2015-11-29 16:10:46 -06:00
John Bowler
12bebfe0f9 Merge branch 'libpng16' of ../../libpng into libpng16 2015-11-28 00:08:20 -08:00
John Bowler
28a1cdfc2e Fix inconsistent handling of invalid zlib data
In libpng 1.6 zlib initialization was changed to use the window size in the zlib
stream, not a fixed value.  This causes some invalid images, ones where CINFO is
too large, to display 'correctly' if the rest of the data is valid.  This
provides a work-round for zlib versions where the error arises (ones that
support the API change to use the window size in the stream).

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-27 23:57:39 -08:00
Glenn Randers-Pehrson
e7092bc59c [libpng16] Imported from libpng-1.6.20rc01.tar 2015-11-26 07:04:24 -06:00
Glenn Randers-Pehrson
87049cbf84 [libpng16] Update CHANGES, ANNOUNCE, minor editing of contrib/*/*.c 2015-11-25 15:55:01 -06:00
Glenn Randers-Pehrson
19ffb62903 [libpng16] Update CHANGES and ANNOUNCE about pngfix.c 2015-11-25 15:25:40 -06:00
John Bowler
f5778c8fbb Fix error in handling of bad zlib CMINFO field
Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-25 12:59:42 -08:00
Glenn Randers-Pehrson
92ec30a3b1 [libpng16] Imported from libpng-1.6.20beta03.tar 2015-11-24 09:34:02 -06:00
John Bowler
8a08b6457a Test backport
Tests backported from the multi-version compatible ones in libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-23 20:15:51 -08:00
Glenn Randers-Pehrson
9a2065c5ee [libpng16] Imported from libpng-1.6.20beta02.tar 2015-11-23 09:29:44 -06:00
Glenn Randers-Pehrson
27f08ac11d [lbpng16] Revert 12 -> 12U change in pngrutil.c 2015-11-22 22:59:47 -06:00
Glenn Randers-Pehrson
0a9afc12de [libpng16] Fixed bug recently introduced in png_set_PLTE() that uses png_ptr
not info_ptr.
2015-11-22 20:53:02 -06:00
Glenn Randers-Pehrson
a1a2ae2a25 [libpng16] Bump version to 1.6.20beta02 2015-11-22 14:11:29 -06:00
Glenn Randers-Pehrson
26942c818e [libpng16] Imported from libpng-1.6.20beta01.tar 2015-11-22 14:08:52 -06:00
Glenn Randers-Pehrson
8ba160ba94 [libpng16] Use unsigned constants in buffer length comparisons 2015-11-21 14:31:59 -06:00
John Bowler
1ceedd0bf6 [libpng16] Another whack at png_handle_sPLT() pointer calculation. 2015-11-19 20:45:08 -06:00
Viktor Szakats
4db6127658 pngread: avoid clang warning for unreachable code
```
pngread.c:2841:10: warning: 'break' will never be executed [-Wunreachable-code-break]
         break;
         ^~~~~
```
2015-11-19 19:54:01 +01:00
Glenn Randers-Pehrson
c4b2282fee [libpng16] Removed new redundant check for length < 12 in pngrutil.c 2015-11-17 16:36:06 -06:00
Glenn Randers-Pehrson
001513c9ca [libpng16] Removed new redundant check for libpng < 12 in pngrutil.c 2015-11-17 16:23:51 -06:00
Glenn Randers-Pehrson
162f9f87f9 [libpng16] Remove newly-added useless typecasts. 2015-11-16 09:23:25 -06:00
Glenn Randers-Pehrson
9965f63a44 [libpng16] Changed size_t to png_uint_32 in new buffer checks (John Bowler) 2015-11-15 15:27:22 -06:00
Glenn Randers-Pehrson
070a0eb58f [libpng16] Revised recent pngrutil.c patch as suggested by pascal 2015-11-14 16:45:26 -06:00
Glenn Randers-Pehrson
0b4e7deab1 [libpng16] Avoid potential pointer overflow in png_handle_sPLT() and
png_handle_pCAL() (Bug report by John Regehr).
2015-11-13 11:05:27 -06:00
Glenn Randers-Pehrson
f1cdf4e1ca [libpng16] Bump version to 1.6.20beta01 2015-11-13 10:18:18 -06:00
Glenn Randers-Pehrson
b9c62013ef [master] Imported from libpng-1.6.19.tar 2015-11-12 07:18:03 -06:00
Glenn Randers-Pehrson
415d26805a [libpng16] Imported from libpng-1.6.19.tar 2015-11-12 07:13:31 -06:00
Glenn Randers-Pehrson
83f4c735c8 [libpng16] Clean up coding style in png_handle_PLTE() 2015-11-05 11:18:44 -06:00
Glenn Randers-Pehrson
64fef09b67 [libpng16] Imported from libpng-1.6.19rc04.tar 2015-11-05 06:59:34 -06:00
Glenn Randers-Pehrson
9f2ad4928e [libpng16] Fixed new bug with CRC error after reading an over-length palette. 2015-11-04 23:47:42 -06:00
Glenn Randers-Pehrson
0e30044094 [libpng16] Imported from libpng-1.6.19rc03.tar 2015-11-03 09:57:01 -06:00
Glenn Randers-Pehrson
fc8450833a [libpng16] Clarified COPYRIGHT information to state explicitly that versions
are derived from previous versions.
Removed much of the long list of previous versions from png.h and
    libpng.3.
2015-11-03 08:24:56 -06:00
Glenn Randers-Pehrson
6761aacbfa [libpng16] Bump version to 1.6.19rc03 2015-11-03 08:15:06 -06:00
Glenn Randers-Pehrson
408dbac801 [libpng16] Fixed some inconsequential cut-and-paste typos
in png_set_cHRM_XYZ_fixed().
2015-11-01 12:38:33 -06:00
Glenn Randers-Pehrson
b00d986d54 [libpng16] Imported from libpng-1.6.19rc02.tar 2015-10-31 09:04:18 -05:00
Glenn Randers-Pehrson
305ada6672 Merge branch 'libpng16' of https://github.com/jbowler/libpng-1 into libpng16 2015-10-30 12:48:07 -05:00
Glenn Randers-Pehrson
1bef8e9799 [libpng16] Silently truncate over-length PLTE chunk while reading. 2015-10-30 11:34:37 -05:00
Glenn Randers-Pehrson
a901eb3ce6 [libpng16] Prevent reading over-length PLTE chunk (Cosmin Truta). 2015-10-30 07:57:49 -05:00
John Bowler
896c3cfb76 rowbytes check correction
The old code incorrectly calculated the output rowbytes when the
application decreased either the number of channels or the bit depth (or
both) in a user transform.  This was safe; libpng overallocated buffer
space (potentially by quite a lot; up to 4 times the amount required)
but, from 1.5.4 on, resulted in a png_error.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-10-29 18:16:48 -07:00
Glenn Randers-Pehrson
06509be841 [libpng16] Bump version to 1.6.19rc02 2015-10-29 09:28:33 -05:00
Glenn Randers-Pehrson
81f44665cc [libpng16] Reject attempt to write over-length PLTE chunk 2015-10-29 09:26:41 -05:00
Glenn Randers-Pehrson
9c7ed35a65 [libpng16] Imported from libpng-1.6.19rc01.tar 2015-10-23 09:30:20 -05:00
Glenn Randers-Pehrson
05e81e18d2 [libpng16] Bump version to 1.6.19beta05 2015-10-14 22:25:29 -05:00
Glenn Randers-Pehrson
6ca8ee1518 [libpng16] Imported from libpng-1.6.19beta04.tar 2015-10-14 22:25:21 -05:00
Glenn Randers-Pehrson
59e655b020 [libpng16] Added sPLT support to pngtest.c 2015-10-10 12:05:55 -05:00
Glenn Randers-Pehrson
5bd9d66098 [libpng16] Updated CHANGES and ANNOUNCE 2015-10-03 15:16:53 -05:00
John Bowler
2163c930b0 pow and sbit fixes backported to pngvalid from 1.7
Signed-off-by: John Bowler <jbowler@acm.org>
2015-10-03 11:14:43 -07:00
John Bowler
18f0bd1d63 Merge remote-tracking branch 'local/libpng16' into libpng16 2015-09-27 08:52:50 -07:00
Glenn Randers-Pehrson
5b9c044332 Revert "[libpng16] Fix bad merge of contrib/libtests/pngvalid.c"
This reverts commit 9517f7b6367045b298619310587307e8471808a7.
2015-09-27 09:17:45 -05:00
John Bowler
dc3069bcb1 Merge branch 'libpng16' into libpng16-pngvalid-rgb-to-gray-digitize-issues 2015-09-26 21:29:06 -07:00
Glenn Randers-Pehrson
9517f7b636 [libpng16] Fix bad merge of contrib/libtests/pngvalid.c 2015-09-26 23:11:15 -05:00
Glenn Randers-Pehrson
b77d929217 [libpng16] Restored Makefile.am and configure.ac (they had been
inadvertently replaced with libpng17 versions).
2015-09-26 22:54:51 -05:00
Glenn Randers-Pehrson
b939ce06be [libpng17] Makefile.am and configure.ac were out of date. 2015-09-26 22:26:44 -05:00
Glenn Randers-Pehrson
f9e37f54eb [libpng16] Worked around rgb-to-gray issues in libpng 1.6. The previous
attempts to ignore the errors in the code aren't quite enough to
deal with the 'channel selection' encoding added to libpng 1.7; abort.
2015-09-26 21:31:53 -05:00
John Bowler
04402a9126 Fix (work round) rgb-to-gray issues in libpng 1.6
The previous attempts to ignore the errors in the code aren't quite enough to
deal with the 'channel selection' encoding added to libpng 1.7; abort.
pngvalid.c is changed to drop this encoding in prior versions.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-26 17:41:02 -07:00
Glenn Randers-Pehrson
068cb3a64c [libpng16] Bump version to 1.6.19beta04 2015-09-26 09:44:43 -05:00
Glenn Randers-Pehrson
f4302a73ac [libpng16] Imported from libpng-1.6.19beta03.tar 2015-09-26 09:44:34 -05:00
John Bowler
23ddeb58a5 pngvalid tests: add --strict, fix test names
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 17:06:58 -07:00
John Bowler
956f295d48 Merge remote-tracking branch 'local/libpng16' into libpng16 2015-09-25 16:58:43 -07:00
Glenn Randers-Pehrson
61257bc2de [libpng16] Update CHANGES and ANNOUNCE 2015-09-25 18:25:08 -05:00
John Bowler
6297297708 Enable low-bit-depth gray tests in pngvalid
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 16:21:45 -07:00
John Bowler
fd42ef9b06 pngstest 1.6 error limit and warning revisions
Remove the '--strict' in 1.6 because of the double-gamma-correction warning,
update pngstest-errors.h for the errors detected with the new contrib/testspngs
PNG test files.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 13:40:18 -07:00
John Bowler
a2671a7f49 test PNG files (contrib/testpngs)
Back ported from libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 13:10:13 -07:00
John Bowler
fa5ba2e026 New test PNG files incorporated into make check
tests/pngstest-* are changed so that the new test files are divided into 8
groups by gamma and alpha channel.  This makes each test take just under 5
seconds on a moderately up-to-date x86_64 system using libpng16 (test times are
somewhat variable under libpng17 at present because of the lack of optimization
in some gamma processing paths.)

These tests have considerably better code and pixel-value coverage than
contrib/pngsuite however coverage is still incomplete.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 12:41:56 -07:00
Glenn Randers-Pehrson
01a0e8062d [libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()
functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha()
which now work properly with 16-bit images.
2015-09-24 22:39:53 -05:00
Glenn Randers-Pehrson
5b038f83e7 [libpng16] Fix typo in manual 2015-09-23 22:27:14 -05:00
Glenn Randers-Pehrson
efe4e5d10d [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit
input that was made in version 1.6.17beta01, to preserve legacy
behavior even though it was incorrect.  Instead, added new API
png_set_filter_16() and png_set_add_alpha_16() that set a flag to
make png_do_read_filter() interpret the filler bytes properly.
2015-09-23 22:08:04 -05:00
John Bowler
d6eb4b71ac Updated pngstest-errors.h
This update incorporates errors resulting from the more extensive image test
suite used in libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-20 20:59:10 -07:00
Glenn Randers-Pehrson
4c9c43d4d4 [libpng16] Added license info to pngstest-errors.h and its generator. 2015-09-19 20:17:44 -05:00
Glenn Randers-Pehrson
0cc11b86ba [libpng16] Update ANNOUNCE and CHANGES with recent pngstest updates. 2015-09-19 19:57:59 -05:00
John Bowler
93b4568fc0 pngstest: make error limits version specific
Splitting the machine generated error structs out to a file allows the values to
be updated without changing pngstest.c itself, since libpng 1.6 and 1.7 have
slightly different error limits this simplifies maintenance.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-19 16:34:30 -07:00
Glenn Randers-Pehrson
f6cd8f2d65 [libpng16] Updated description of filler-byte bugfix in CHANGES. 2015-09-18 23:37:25 -05:00
Glenn Randers-Pehrson
8bfcb4c7a7 [libpng16] Copied contrib/libtests/pngvalid.c from libpng17. 2015-09-18 14:24:49 -05:00
Glenn Randers-Pehrson
eb0bf4f468 [libpng16] Updated pngvalid.c with recent changes from libpng17 2015-09-18 13:09:57 -05:00
John Bowler
e8c554661c Back-port pngvalid corrections and enhancements
This is a patch for libpng16.
It incorporates fixes to the low-bit-depth gray background handling from
libpng17 and turns one of the low-bit-depth gray cases that does work (and,
indeed, did work before) in libpng16

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-17 07:56:30 -07:00
John Bowler
c3e7e7d715 [libpng16] tests backported from libpng 1.7
This updates libpng16 with all the test changes from libpng17,
including changes to pngvalid.c to ensure that the original,
distributed, version of contrib/visupng/cexcept.h can be used.

pngvalid contains the correction to the use of SAVE/STORE_
UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7.  More
tests contain the --strict option to detect warnings and the
pngvalid-standard test has been corrected so that it does not
turn on progresive-read (there is a separate test which does
that.)

Some signed/unsigned fixes have been made.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-15 15:38:52 -07:00
Glenn Randers-Pehrson
1e16e8829d [libpng16] Fix typo (extra "*/") in contrib/libtests/fakepng.c 2015-09-15 17:07:34 -05:00
John Bowler
33a97c5c8a [libpng16] Fixed png_save_int_32 when int is not 2's complement (John Bowler). 2015-08-21 14:42:00 -05:00
Glenn Randers-Pehrson
39be3b81da [libpng16] Bump version to 1.6.19beta03 2015-08-19 12:58:26 -05:00
Glenn Randers-Pehrson
4c02a5930a [libpng16] Imported from libpng-1.6.19beta02.tar 2015-08-19 12:58:14 -05:00
John Bowler
2d62f7406f [libpng16] Fixed the recently reported 1's complement security issue by
replacing the value that is illegal in the PNG spec, in both signed and
unsigned values, with 0. Illegal unsigned values (anything greater than or equal
to  0x80000000) can still pass through, but since these are not illegal
in ANSI-C (unlike 0x80000000 in the signed case) the checking that
occurs later can catch them (John Bowler).
2015-08-19 12:56:48 -05:00
Glenn Randers-Pehrson
6530e3898d [libpng16] Restored previous handling of negative input to png_set_sig_bytes(). 2015-08-17 21:56:03 -05:00
Glenn Randers-Pehrson
5a26171dd7 [libpng16] Mention the change in png_set_sig_bytes() behavior in the man page. 2015-08-17 21:39:22 -05:00
Robert C. Seacord
167b5e4c27 [libpng16] Safely convert num_bytes to a png_byte in png_set_sig_bytes() 2015-08-17 21:20:34 -05:00
Glenn Randers-Pehrson
a8242fe6fb [libng16] Reverted recent mistaken change of 0xnnnn to 0xnnnnUL 2015-08-17 20:46:27 -05:00
Glenn Randers-Pehrson
15e69748f1 [libpng16] Removed new unnecessary typecast in pngrutil.c 2015-08-17 12:52:56 -05:00
Glenn Randers-Pehrson
268c7bf68b [libpng16] Use unsigned hex constants in "reciprocal" computations 2015-08-17 12:40:19 -05:00
Glenn Randers-Pehrson
d8b93c29a7 [libpng16] Appended more "UL" to hex constants. 2015-08-17 10:56:17 -05:00
Glenn Randers-Pehrson
b9ba8d6a57 [libpng16] Mention in manual that 16-bit platform support has been dropped. 2015-08-16 23:32:04 -05:00
John Bowler
751cee5ef1 [libpng16] Added signed/unsigned 16-bit safety net. This removes the dubious
0x8000 flag definitions on 16-bit systems. They aren't supported
yet the defs *probably* work, however it seems much safer to do this
and be advised if anyone, contrary to advice, is building libpng 1.6
on a 16-bit system. It also adds back various switch default clauses
for GCC; GCC errors out if they are not present (with an appropriately
high level of warnings).
2015-08-16 22:54:21 -05:00
Glenn Randers-Pehrson
8ba4b13c55 [libpng16] Changed 0xnnnn constants to 0xnnnnUL. 2015-08-16 22:49:58 -05:00
Glenn Randers-Pehrson
8b83ff3704 [libpng16] Change "n bit" to "n-bit" in comments. 2015-08-13 20:57:18 -05:00
Glenn Randers-Pehrson
a472858297 [libpng16] Fix links in man page 2015-08-11 15:34:08 -05:00
Glenn Randers-Pehrson
682f4ba2d5 [libpng16] Fix links in man page 2015-08-11 13:04:01 -05:00
Glenn Randers-Pehrson
656720fb42 [libpng16] Fixed dead link in man page 2015-08-11 12:12:46 -05:00
Glenn Randers-Pehrson
fd8ef4c428 [libpng16] Add #ifdef PNG_DEBUG/#endif around normally unreachable code
in pngread.c
2015-08-07 14:43:34 -05:00
Victor Szakats
4e1d299e6b [libpng16] Removed unreachable "break" statements in png.c, pngread.c, and
pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
2015-08-07 14:31:11 -05:00
Glenn Randers-Pehrson
0e9cd91609 [libpng16] Moved config.h.in~ from the "libpng_autotools_files" list to the
"libpng_autotools_extra" list in autogen.sh because it was causing a
false positive for missing files (bug report by Robert C. Seacord).
2015-08-02 21:51:11 -05:00
Glenn Randers-Pehrson
52d159a784 [libpng16] Bump version to 1.6.19beta02 2015-07-30 11:24:53 -05:00
Glenn Randers-Pehrson
67806d44c1 [libpng16] Imported from libpng-1.6.19beta01.tar 2015-07-30 11:18:15 -05:00
Glenn Randers-Pehrson
8510247b5f [libpng16] Fixed uninitialized variable in contrib/gregbook/rpng2-x.c and
fixed potential leak of png_pixels in contrib/pngminus/pnm2png.c
2015-07-30 11:16:29 -05:00
Glenn Randers-Pehrson
77becc566f [libpng16] Suppressed warnings from the Borland C++ 5.5.1/5.82 compiler in png.c 2015-07-29 08:01:12 -05:00
Glenn Randers-Pehrson
e1b505cd1d [libpng16]Suppressed a warning from the Borland C++ 5.5.1/5.82 compiler 2015-07-29 07:42:19 -05:00
Glenn Randers-Pehrson
e485a09e0e [libpng16] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).  Several warnings remain and are
unavoidable, where we test for overflow.
2015-07-29 07:29:17 -05:00
Glenn Randers-Pehrson
1fa62ae734 [libpng16] Rearranged png.h to put the major sections in the same order as
in libpng17.
2015-07-25 20:50:21 -05:00
Glenn Randers-Pehrson
262c396666 [libpng16] More edits to libpng.3 and libpng-manual.txt 2015-07-25 08:30:12 -05:00
Glenn Randers-Pehrson
59a82b40b0 [libpng16] Avoid potentially dereferencing NULL info_ptr in png_info_init_3(). 2015-07-25 08:03:05 -05:00
Glenn Randers-Pehrson
e10b7e73db [libpng16] Updated obsolete information about the simplified API macros in the
manual pages (Bug report by Arc Riley).
2015-07-25 08:01:34 -05:00
Glenn Randers-Pehrson
476250ebd2 [libpng16] Bump version to 1.6.19beta01 2015-07-23 20:20:53 -05:00
Glenn Randers-Pehrson
287fb89248 [master] Imported from libpng-1.6.18.tar 2015-07-22 22:41:05 -05:00
Glenn Randers-Pehrson
e6172809bd [libpng16] Imported from libpng-1.6.18.tar 2015-07-22 22:40:52 -05:00
Glenn Randers-Pehrson
db8704e1f4 [libpng16] Imported from libpng-1.6.18rc03.tar 2015-07-15 21:24:11 -05:00
Glenn Randers-Pehrson
1a73305ac2 [libpng16] Removed WEIGHTED_FILTER info from the man page. 2015-07-13 14:53:27 -05:00
Glenn Randers-Pehrson
285a9b22c7 [libpng16] Bump version to 1.6.18rc03 2015-07-13 08:31:05 -05:00
Glenn Randers-Pehrson
be55943d45 [libpng16] Imported from libpng-1.6.18rc02.tar 2015-07-13 07:09:33 -05:00
Glenn Randers-Pehrson
e0874e1934 [libpng16] Restored unused WEIGHTED_FILTER macros removed at libpng-1.6.18beta08
to png.h to avoid compatibility warnings.
2015-07-13 07:08:15 -05:00
Glenn Randers-Pehrson
4cb6607c89 [libpng16] Imported from libpng-1.6.18rc01.tar 2015-07-09 11:14:03 -05:00
Glenn Randers-Pehrson
751eb368a8 [libpng16] Added Mans Rullgard and James Yu to the list of Contributing Authors 2015-07-09 11:11:49 -05:00
Glenn Randers-Pehrson
f7654a0c61 [libpng16] Fixed new typo in LICENSE 2015-07-04 20:58:24 -05:00
Glenn Randers-Pehrson
d78eb10f29 [libpng16] Bump version to 1.6.18beta10 2015-07-04 20:43:09 -05:00
Glenn Randers-Pehrson
d2a35c6088 [libpng16] Imported from libpng-1.6.18beta09.tar 2015-07-04 20:42:56 -05:00
Glenn Randers-Pehrson
b9e5e5f5a8 [libpng16] Replaced arbitrary use of 'extern' with #define PNG_LINKAGE_*. To
preserve API compatibility, the new defines all default to "extern"
(requested by Jan Nijtmans).
2015-07-03 16:07:54 -05:00
Glenn Randers-Pehrson
a390897ba4 [libpng16] Fixed a new signed-unsigned comparison in pngrtran.c (Max Stepin).
Removed some useless typecasts from contrib/tools/png-fix-itxt.c
2015-07-01 14:06:39 -05:00
Glenn Randers-Pehrson
4e5ac72254 [libpng16] Bump version to 1.6.18beta09 2015-06-30 10:54:55 -05:00
Glenn Randers-Pehrson
9d4ea3014b [libpng16] Imported from libpng-1.6.18beta08.tar 2015-06-30 10:54:44 -05:00
Glenn Randers-Pehrson
f86720c6c0 [libpng16] Fix some indentation. 2015-06-11 22:00:14 -05:00
Glenn Randers-Pehrson
c6f629ffdd [libpng16] Unlink temporary file immediately in pngstest (PNG_USE_MKSTEMP) 2015-06-11 16:28:54 -05:00
Glenn Randers-Pehrson
81487c8b54 [libpng16] Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h 2015-06-10 07:06:42 -05:00
Glenn Randers-Pehrson
f6e7551f06 [libpng16] Eliminated the final two Coverity defects (insecure temporary file
handling in contrib/libtests/pngstest.c; possible overflow of
unsigned char in contrib/tools/png-fix-itxt.c). To use the "secure"
file handling, define PNG_USE_MKSTEMP, otherwise "tmpfile()" will
continue to be used.
2015-06-10 07:05:18 -05:00
Glenn Randers-Pehrson
4293254bef [libpng16] Bump version to 1.6.18beta08 2015-06-06 17:03:35 -05:00
Glenn Randers-Pehrson
867f2ec058 [libpng16] Imported from libpng-1.6.18beta07.tar 2015-06-06 17:03:14 -05:00
Glenn Randers-Pehrson
b26b51d154 [libpng16] Quieted Coverity issues in pngfix.c, png-fix-itxt.c, pngvalid.c,
pngstest.c, and pngimage.c. Most seem harmless, but png-fix-itxt
would only work with iTXt chunks with length 255 or less.
2015-06-03 16:07:01 -05:00
Glenn Randers-Pehrson
f50b593ac0 [libpng16] Update revision information in cexcept.h as required by the license. 2015-06-03 15:41:46 -05:00
John Bowler
7023d871e8 [libpng16] Fix g++ build breaks 2015-06-03 15:04:03 -05:00
John Bowler
2dfcf65981 [libpng16] Fixed NO_WRITE_FILTER and -Wconversion build breaks (John Bowler). 2015-06-03 14:58:18 -05:00
John Bowler
b780eba4e4 [libpng16] Fixed cexcept.h in which GCC 5 now reports that one of the auto
variables in the Try macro needs to be volatile to prevent value
being lost over the setjmp.
2015-06-03 14:46:34 -05:00
John Bowler
25bfb13770 [libpng16] Removed non-working progressive reader 'skip' function. This
function has apparently never been used. It was implemented
to support back-door modification of png_struct in libpng-1.4.x
but was apparently never tested (because it does nothing and cannot
do anything).
2015-06-03 14:31:08 -05:00
Glenn Randers-Pehrson
1a6841c99c [libpng16] Bump version to 1.6.18beta07 2015-06-01 09:33:33 -05:00
Glenn Randers-Pehrson
1d4f804bc1 [libpng16] Imported from libpng-1.6.18beta06.tar 2015-06-01 09:33:23 -05:00
Glenn Randers-Pehrson
89edbf8317 [libpng16] Removed WRITE_WEIGHTED_FILTERED code, to save a few kbytes of the
compiled library size. It never worked properly and as far as we can
tell, no one uses it. The png_set_filter_heuristics() and
png_set_filter_heuristics_fixed() APIs are retained but deprecated
and do nothing.
2015-05-31 22:40:36 -05:00
Glenn Randers-Pehrson
a008dd8344 [libpng16] Bump version to 1.6.18beta06 2015-05-31 10:20:22 -05:00
Glenn Randers-Pehrson
20a2f9b9be [libpng16] Imported from libpng-1.6.18beta05.tar 2015-05-31 10:20:13 -05:00
Glenn Randers-Pehrson
1088f4925f [libpng16] Fixed old cut&paste bug in the weighted filter selection code in
pngwutil.c, introduced in libpng-0.95, March 1997.
2015-05-30 22:58:54 -05:00
Glenn Randers-Pehrson
b66de48b3b [libpng16] Changed png_voidcast(), etc., to voidcast(), etc., in
contrib/tools/pngfix.c to avoid confusion with the libpng private macros.
2015-05-30 22:57:33 -05:00
Glenn Randers-Pehrson
e6877671f1 [libpng16] Backported filter selection code from libpng-1.7.0beta51, to combine
sub_row, up_row, avg_row, and paeth_row into try_row and tst_row.
2015-05-30 11:54:45 -05:00
Glenn Randers-Pehrson
9fbdce8fb5 [libpng16] Bump version to 1.6.18beta05 2015-05-29 11:35:15 -05:00
Glenn Randers-Pehrson
f6b9c993e1 [libpng16] Imported from libpng-1.6.18beta04.tar 2015-05-29 11:28:33 -05:00
Glenn Randers-Pehrson
d46b570919 [libpng16] Avoid a harmless potential integer overflow in png_XYZ_from_xy(). 2015-05-20 13:21:53 -05:00
Glenn Randers-Pehrson
918d23f658 [libpng16] Trivial editing of comments in png.c 2015-05-09 21:48:11 -05:00
Glenn Randers-Pehrson
d2fedd629d [libpng16] Avoid Coverity issue 80858 (REVERSE NULL) in pngtest.c
PNG_DEBUG builds.
2015-05-09 21:47:00 -05:00
Glenn Randers-Pehrson
2d069831fb [libpng16] Document PNG_RELEASE_BUILD in the man page. 2015-05-06 20:31:21 -05:00
John Bowler
8ee821e69a [libpng16] PNG_RELEASE_BUILD replaces tests where the code depended on the build base
type and can be defined on the command line, allowing testing in beta builds. Back
ported from libpng17.
2015-05-06 20:03:14 -05:00
Glenn Randers-Pehrson
279dc3f0bf [libpng16] Added some documentation about features of the Simplified Write API. 2015-05-06 17:02:47 -05:00
Glenn Randers-Pehrson
846357d592 [libpng16] Bump version to 1.6.18beta04 2015-05-06 16:39:42 -05:00
Glenn Randers-Pehrson
d8d18fbb02 [libpng16] Imported from libpng-1.6.18beta03.tar 2015-05-06 16:39:31 -05:00
John Bowler
74428df2fd [libpng16] Improved DIV65535 algorithm in simpleover.c. By experiment,
(x + (x>>16) + 32769) works as well as the previous form and avoids one shift.
2015-05-06 11:41:17 -05:00
Glenn Randers-Pehrson
d6b1375bf5 [libpng16] Trivial editing of comments in contrib/examples/simpleover.c 2015-05-04 20:25:31 -05:00
John Bowler
0f12df19a1 [libpng16] Added PNG generation tool, fixed unitialized pointer in
simpleover. Also added a comment to png.h pointing out that the pointer must
 be set to NULL!  (simpleover crashes with any slightly complex command lines
 without this fix.)
2015-05-04 19:58:41 -05:00
John Bowler
cde3078963 [libpng16] Added contrib/examples/simpleover.c, to demonstrate how to handle
alpha compositing of multiple images, using the "simplified API"
2015-05-02 19:53:40 -05:00
Glenn Randers-Pehrson
216ab04994 [libpng16] Updated comment in pngpriv.h about ARM support. 2015-04-29 11:30:35 -05:00
Glenn Randers-Pehrson
e0f0d05938 [libpng16] Replaced "unexpected" with an integer (0xabadca11) in pngset.c 2015-04-29 11:29:31 -05:00
Glenn Randers-Pehrson
23da29af91 [libpng16] Bump version to 1.6.18beta03 2015-04-26 16:38:18 -05:00
Glenn Randers-Pehrson
ecc391bbcf [libpng16] Imported from libpng-1.6.18beta02.tar 2015-04-26 16:38:10 -05:00
Glenn Randers-Pehrson
c861dc8923 [libpng16] Suppressed some warnings from the Borland C++ 5.5.1/5.82 compiler
(Bug report by Viktor Szaka'ts).
2015-04-01 12:06:01 -05:00
Glenn Randers-Pehrson
507a8cdc5e [libpng16] Bump version to 1.6.18beta02 2015-04-01 08:24:26 -05:00
Glenn Randers-Pehrson
bd85b5713c [libpng16] Imported from libpng-1.6.18beta01.tar 2015-04-01 08:24:14 -05:00
John Bowler
a21a5b22c1 [libpng16] Fixed rgb_to_gray checks and added tRNS checks to pngvalid.c 2015-03-30 21:38:31 -05:00
Glenn Randers-Pehrson
d344589703 [libpng16] Removed PNG_SET_CHUNK_[CACHE|MALLOC]_LIMIT_SUPPORTED macros. They
have been combined with PNG_SET_USER_LIMITS_SUPPORTED (resolves
bug report by Andrew Church).
2015-03-27 08:58:32 -05:00
Glenn Randers-Pehrson
218a6fe9e5 [libpng16] Bump version to 1.6.18beta01 2015-03-26 08:55:25 -05:00
Glenn Randers-Pehrson
2b667e4923 [master] Imported from libpng-1.6.17.tar 2015-03-26 08:11:22 -05:00
Glenn Randers-Pehrson
c98f7fb4e3 [libpng16] Imported from libpng-1.6.17.tar 2015-03-26 08:11:12 -05:00
Glenn Randers-Pehrson
f17e6c3046 [libpng16] Imported from libpng-1.6.17rc06.tar 2015-03-22 19:43:23 -05:00
John Bowler
6eecfe3886 [libpng16] Fixed simplified 8-bit-linear to sRGB alpha. The calculated alpha
value was wrong.  It's not clear if this affected the final stored
value; in the obvious code path the upper and lower 8-bits of the
alpha value were identical and the alpha was truncated to 8-bits
rather than dividing by 257 (John Bowler).
2015-03-22 19:42:14 -05:00
Glenn Randers-Pehrson
b383798ac9 [libpng16] Add pnglibconf.dfn and pnglibconf.pre to scripts/pnglibconf.mak
"clean" target.
2015-03-21 15:53:44 -05:00
Glenn Randers-Pehrson
ea037b01eb [libpng16] Remove pnglibconf.dfn and pnglibconf.pre with "make clean". 2015-03-21 15:47:39 -05:00
Glenn Randers-Pehrson
04445235f1 [libpng16] Bump version to 1.6.17rc06 2015-03-21 12:11:10 -05:00
Glenn Randers-Pehrson
778ccbbafa [libpng16] Imported from libpng-1.6.17rc05.tar 2015-03-21 12:11:00 -05:00
Glenn Randers-Pehrson
c5370ede95 [libpng16] Reverted "& 0xff" additions of version 1.6.17beta01. Libpng passes
the Coverity scan without them.
2015-03-21 11:54:32 -05:00
John Bowler
2b66107abb [libpng16] Define PNG_FILTER_* and PNG_FILTER_VALUE_* in png.h even when WRITE
is not supported (John Bowler).  This fixes an error introduced in
libpng-1.6.17beta06.
2015-03-17 21:32:27 -05:00
Glenn Randers-Pehrson
0aabfe2a4c [libpng16] Bump version to 1.6.17rc05 2015-03-17 08:14:23 -05:00
Glenn Randers-Pehrson
16f9246853 [libpng16] Imported from libpng-1.6.17rc04.tar 2015-03-17 08:00:12 -05:00
John Bowler
c9fd075c89 [libpng16] Fix bug in calculation of maxbits, in png_write_sBIT, introduced
in libpng-1.6.17beta01 (John Bowler).
2015-03-16 16:31:13 -05:00
Cosmin Truta
47e1315459 [libpng16] Remove pnglibconf.h, pnglibconf.c, and pnglibconf.out instead of
pnglibconf.* in "make clean" (Cosmin).
2015-03-15 17:04:17 -05:00
Glenn Randers-Pehrson
49fa8d4cdd [libpng16] Bump version to 1.6.17rc04 2015-03-12 09:24:49 -05:00
Glenn Randers-Pehrson
a60de343a9 [libpng16] Imported from libpng-1.6.17rc03.tar 2015-03-12 06:49:06 -05:00
Glenn Randers-Pehrson
f2c37d0abf [libpng16] Updated CMakeLists.txt to add OSX framework, change YES/NO to ON/OFF
for consistency, and remove some useless tests (Alexey Petruchik).
2015-03-12 06:48:01 -05:00
Glenn Randers-Pehrson
bc27b2f432 [libpng16] Imported from libpng-1.6.17rc02.tar 2015-03-09 09:20:46 -05:00
Glenn Randers-Pehrson
3645008e22 [libpng16] Free the unknown_chunks structure even when it contains no data. 2015-03-09 09:13:58 -05:00
Glenn Randers-Pehrson
06ee532286 [libpng16] Reverted new test on unknown chunk location; it was bogus. 2015-03-08 08:00:45 -05:00
Glenn Randers-Pehrson
bbe2be3f54 [libpng16] Spelling fixes: less then N -> less than N (Lauri Nurmi) 2015-03-07 13:13:11 -06:00
Glenn Randers-Pehrson
bb098218ca [libpng16] Fixed some spelling (occur* -> occurr*), Bug report by Lauri Nurmi 2015-03-07 12:59:48 -06:00
Glenn Randers-Pehrson
217d38cdea [libpng16] Stopped a potential memory leak in png_set_unknown_chunks(). Breaks
tests/pngunknown-sAPI so it's temporarily marked SKIP.
2015-03-07 10:35:03 -06:00
Glenn Randers-Pehrson
377fb53944 [libpng16] Removed some comments that the configure script did not handle
properly from scripts/pnglibconf.dfa and pnglibconf.h.prebuilt.
2015-03-05 20:59:31 -06:00
Glenn Randers-Pehrson
7f85da8df7 [libpng16] Imported from libpng-1.6.17rc02.tar 2015-03-05 20:54:07 -06:00
Glenn Randers-Pehrson
3e0bef6da4 [libpng16] Imported from libpng-1.6.17rc01.tar 2015-03-04 11:19:32 -06:00
Glenn Randers-Pehrson
82511341d7 [libpng16] Bump version to 1.6.17beta07 2015-02-27 19:20:37 -06:00
Glenn Randers-Pehrson
4029db9aac [libpng16] Imported from libpng-1.6.17beta06.tar 2015-02-27 19:01:02 -06:00
Glenn Randers-Pehrson
7011a8cec3 [libpng16] Added "& 0xff" to things being typecast to "png_byte". 2015-02-27 18:53:44 -06:00
Sergey Kosarevsky
9a3de48b48 [libpng16] Avoid runtime checks when converting integer to png_byte with
Visual Studio (Sergey Kosarevsky)
2015-02-27 18:47:43 -06:00
Glenn Randers-Pehrson
494e75ac83 [libpng16] Fixed some typos in the pngfix usage message. 2015-02-26 10:39:13 -06:00
Glenn Randers-Pehrson
3f49c1e42a [libpng16] Bump version to 1.6.17beta06 2015-02-25 15:42:16 -06:00
Glenn Randers-Pehrson
68f4ea7423 [libpng16] Imported from libpng-1.6.17beta05.tar 2015-02-25 15:17:40 -06:00
Glenn Randers-Pehrson
c6b29ff896 [libpng16] Put #ifdef/#endif around png_set_compression_level in pngwrite.c 2015-02-22 19:39:17 -06:00
Glenn Randers-Pehrson
76f93293a0 [libpng16] Bump version to 1.6.17beta05 2015-02-21 12:49:38 -06:00
Glenn Randers-Pehrson
d375ca5e0d [libpng16] Imported from libpng-1.6.17beta04.tar 2015-02-21 12:49:25 -06:00
Glenn Randers-Pehrson
60a7506744 [libpng16]Allow calling png_get_IHDR() with NULL arguments (Reuben Hawkins). 2015-02-18 12:24:46 -06:00
Glenn Randers-Pehrson
d3ff44f0d5 [libpng16] Added PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED macro, on by default. 2015-02-17 21:06:23 -06:00
Glenn Randers-Pehrson
43d90b1610 [libpng16] Bump version to 1.6.17beta04 2015-02-17 10:52:33 -06:00
Glenn Randers-Pehrson
de23a49231 [libpng16] Imported from libpng-1.6.17beta03.tar 2015-02-17 10:52:21 -06:00
Glenn Randers-Pehrson
4b65a89cf4 [libpng16] Eliminated PNG_SAFE_LIMITS macro and restored the 1-million-column
and 1-million-row default limits in pnglibconf.dfa, that can be reset
by the user at build time or run time.  This provides a more robust
defense against DOS and as-yet undiscovered overflows.

Display user limits in the output from pngtest.
2015-02-16 22:52:07 -06:00
Glenn Randers-Pehrson
471b38aa00 [libpng16] Bump version to 1.6.17beta03 2015-02-07 09:16:17 -06:00
Glenn Randers-Pehrson
b6c9ac6304 [libpng16] Imported from libpng-1.6.17beta02.tar 2015-02-07 09:07:09 -06:00
Glenn Randers-Pehrson
8cd78da8b3 [libpng16] Do not build png_product2() when it is unused.
Work around more Coverity-scan dead-code warnings.
2015-02-07 09:03:30 -06:00
Glenn Randers-Pehrson
8f0e2729dd [libpng16] Improved comments on some #ifdef lines. 2015-02-03 19:10:03 -06:00
Glenn Randers-Pehrson
c73d6219f2 [libpng16] Bump version to 1.6.17beta02 2015-01-28 19:20:51 -06:00
Glenn Randers-Pehrson
6ef579df50 [libpng16] Imported from libpng-1.6.17beta01.tar 2015-01-28 19:15:16 -06:00
Glenn Randers-Pehrson
bd76965879 [libpng16] Added #ifndef __COVERITY__ where needed in png.c, pngrutil.c and
pngset.c to avoid warnings about dead code.
2015-01-27 06:53:56 -06:00
Glenn Randers-Pehrson
070a616b82 [master] Imported from libpng-1.6.16.tar 2015-01-15 12:47:40 -05:00
Glenn Randers-Pehrson
7a015b92b2 [libpng16] Update "last changed" comment in pngset.c 2015-01-13 09:41:25 -06:00
Glenn Randers-Pehrson
2f56fe4071 [libpng16] Made the check for out-of-range values in png_set_tRNS() detect
values that are exactly 2^bit_depth, and work on 16-bit platforms.
2015-01-13 09:25:48 -06:00
Glenn Randers-Pehrson
9d6cab3b21 [libpng16] Updated recent CVE numbers in CHANGES file. 2015-01-10 19:18:17 -06:00
Glenn Randers-Pehrson
04affde6a1 [libpng16] Happy 2015, continued. 2014-12-31 19:03:08 -06:00
Glenn Randers-Pehrson
018b4fccb9 [libpng16] Happy New Year! Update copyright year. 2014-12-31 18:45:23 -06:00
Glenn Randers-Pehrson
bba3aa9533 [libpng16] Update "last changed" info in pngrtran.c 2014-12-29 16:36:50 -06:00
John Bowler
b6788ccaff [libpng16] Implement previously untested libpng transforms in pngvalid.c 2014-12-29 16:31:58 -06:00
John Bowler
cde8cd6b30 [libpng16] Fixed byte order in 2-byte filler, in png_do_read_filler(). 2014-12-29 16:24:33 -06:00
John Bowler
19ec55f40e [libpng16] Added testing of png_set_packing() to pngvalid.c 2014-12-27 19:10:04 -06:00
John Bowler
6a6eb354ff [libpng16] Removed user limits from pngfix. Also pass NULL pointers to
png_read_row to skip the unnecessary row de-interlace stuff.
2014-12-24 18:54:08 -06:00
Glenn Randers-Pehrson
6b5abbe58e [libpng16] Corrected the width limit calculation in png_check_IHDR(). 2014-12-23 14:33:02 -06:00
Glenn Randers-Pehrson
66c1ec5a26 [libpng16] Removed duplicate PNG_SAFE_LIMITS_SUPPORTED handling from pngconf.h 2014-12-23 14:18:36 -06:00
Glenn Randers-Pehrson
ecd074945c [libpng16] Bump version to 1.6.17beta01 2014-12-21 22:56:42 -06:00
Glenn Randers-Pehrson
88dd30b232 [libpng16] Imported from libpng-1.6.16.tar 2014-12-21 21:53:00 -06:00
Glenn Randers-Pehrson
10569a452f [libpng16] Imported from libpng-1.6.16rc03.tar 2014-12-21 17:12:39 -06:00
John Bowler
dc294204b6 [libpng16] Fixed an overflow in png_combine_row with very wide interlaced
images.
2014-12-21 17:11:33 -06:00
Glenn Randers-Pehrson
06ee38423b [libpng16] Imported from libpng-1.6.16rc02.tar 2014-12-21 13:54:45 -06:00
Glenn Randers-Pehrson
6d8c88177a [libpng16] Imported from libpng-1.6.16rc01.tar 2014-12-21 09:18:15 -06:00
Glenn Randers-Pehrson
f43b5e3709 [libpng16] Imported from libpng-1.6.16beta03.tar 2014-12-20 19:21:32 -06:00
John Bowler
a00ea0aeae [libpng16] Quiet a "comparison always true" warning in pngstest.c (John Bowler). 2014-12-16 19:18:06 -06:00
Glenn Randers-Pehrson
0659cddd21 [libpng16] Bump version to 1.6.16beta03 2014-12-14 19:42:05 -06:00
Glenn Randers-Pehrson
66d846b0cc [libpng16] Imported from libpng-1.6.16beta02.tar 2014-12-14 19:24:00 -06:00
John Bowler
d040886dc4 [libpng16] Revised handling of scripts/*.dfn; renamed them to scripts/*.c 2014-12-14 19:17:56 -06:00
Glenn Randers-Pehrson
91f9e0370d [libpng16] Bump version to 1.6.16beta02 2014-12-14 12:43:12 -06:00
Glenn Randers-Pehrson
86a7eef997 [libpng16] Imported from libpng-1.6.16beta01.tar 2014-12-14 12:38:35 -06:00
Bob Friesenhahn
530eec311d [libpng16] Revised Makefile.am and scripts/symbols.dfn to work with MinGW/MSYS 2014-12-14 12:37:12 -06:00
Glenn Randers-Pehrson
7c5d037032 [libpng16] Update arm/*.c to libpng coding style. 2014-11-29 17:04:35 -06:00
Glenn Randers-Pehrson
ee16fc4a6f [libpng16] Added ".align 2" to arm/filter_neon.S to support old GAS assemblers
that don't do alignment correctly.
2014-11-29 16:27:27 -06:00
Glenn Randers-Pehrson
2d24cbdd98 [libpng16] Bump version to 1.6.16beta01 2014-11-21 08:25:32 -06:00
Glenn Randers-Pehrson
da7a1e79af [master] Imported from libpng-1.6.15.tar 2014-11-20 10:23:30 -06:00
Glenn Randers-Pehrson
e8ef689cb9 [libpng16] Imported from libpng-1.6.15.tar 2014-11-20 10:22:57 -06:00
Glenn Randers-Pehrson
aebb7585c9 [libpng16] Imported from libpng-1.6.15rc03.tar 2014-11-16 20:04:53 -06:00
Cosmin Truta
5b9ac20297 [libpng16] Added "-D_CRT_SECURE_NO_WARNINGS" to CFLAGS in
scripts/makefile.vcwin32.
Removed the obsolete $ARCH variable from scripts/makefile.darwin.
2014-11-16 19:37:42 -06:00
Glenn Randers-Pehrson
9c05216461 [libpng16] Fix typos in ANNOUNCE and CHANGES 2014-11-14 17:59:40 -06:00
Glenn Randers-Pehrson
d4965b4014 [libpng16] Imported from libpng-1.6.15rc02.tar 2014-11-14 09:51:59 -06:00
Cosmin Truta
b8eb945946 [libpng16] The macros passed in the command line to Borland make were ignored if
similarly-named macros were already defined in makefiles. This behavior
is different from POSIX make and other make programs.  Surround the
macro definitions with ifndef guards (Cosmin).
2014-11-14 09:47:54 -06:00
Glenn Randers-Pehrson
6df21524cd [libpng16] Imported from libpng-1.6.15rc01.tar 2014-11-13 06:47:08 -06:00
Glenn Randers-Pehrson
fa49aae286 [libpng16] Imported from libpng-1.6.15beta08.tar 2014-11-08 09:08:03 -06:00
Glenn Randers-Pehrson
05e11008c0 [libpng16] More "#endif" housecleaning, in *.h 2014-11-07 07:41:16 -06:00
Glenn Randers-Pehrson
40656e9855 [libpng16] Bump version to 1.6.15beta08 2014-11-07 06:45:39 -06:00
Glenn Randers-Pehrson
7cee075a32 [libpng16] Imported from libpng-1.6.15beta07.tar 2014-11-07 06:40:30 -06:00
Glenn Randers-Pehrson
985dc00f1f [libpng16] Fix typo in example.c 2014-11-06 23:17:35 -06:00
Glenn Randers-Pehrson
cda68df8c1 [libpng16] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */" 2014-11-06 22:11:39 -06:00
Glenn Randers-Pehrson
70cb8f9a7e [libpng16] Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
needed by png_reciprocal2().
Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
    png_do_swap().
2014-11-06 20:58:33 -06:00
Glenn Randers-Pehrson
674c3e5816 [libpng16] Bump version to 1.6.15beta07 2014-11-06 07:37:32 -06:00
Glenn Randers-Pehrson
61ea3eacb0 [libpng16] Reverted use png_get_libpng_ver(NULL) instead of PNG_LIBPNG_VER_STRING
in the manual, example.c, pngtest.c, and applications in the contrib directory.
It was incorrect advice.
2014-11-06 06:39:56 -06:00
Glenn Randers-Pehrson
8e7c35fc81 [libpng16] Bump version to 1.6.15beta06 2014-11-05 19:08:08 -06:00
Glenn Randers-Pehrson
234fe626af [libpng16] Imported from libpng-1.6.15beta05.tar 2014-11-05 19:07:58 -06:00
John Bowler
03df189954 [libpng16] Fixed array size calculations to avoid warnings. At various points
in the code the number of elements in an array is calculated using
sizeof.  This generates a compile time constant of type (size_t) which
is then typically assigned to an (unsigned int) or (int). Some versions
of GCC on 64-bit systems warn about the apparent narrowing, even though
the same compiler does apparently generate the correct, in-range,
numeric constant.  This adds appropriate, safe, casts to make the
warnings go away.
2014-11-05 17:19:36 -06:00
John Bowler
6f2c50e7fc [libpng16] Free all allocated memory in pngimage. The file buffer cache was left
allocated at the end of the program, harmless but it causes memory
leak reports from clang.
2014-11-05 17:11:59 -06:00
John Bowler
c9720568d0 [libpng16] Fixed GCC unsigned int->float warnings. Various versions of GCC
seem to generate warnings when an unsigned value is implicitly
converted to double. This is probably a GCC bug but this change
avoids the issue by explicitly converting to (int) where safe.
2014-11-05 17:06:27 -06:00
Glenn Randers-Pehrson
5be76ae252 [libpng16] use PNG_LIBPNG_VER_STRING[i] in png_user_version_check() 2014-11-05 15:02:45 -06:00
Glenn Randers-Pehrson
a2fe24d186 [libpng16] Simplified and future-proofed png_user_version_check(). 2014-11-05 12:00:32 -06:00
Glenn Randers-Pehrson
97dd654ba4 [libpng16] Avoid out-of-bounds memory access in png_user_version_check(). 2014-11-05 09:22:19 -06:00
Glenn Randers-Pehrson
f1b547a509 [libpng16] Use png_get_libpng_ver(NULL), not PNG_LIBPNG_VER_STRING 2014-11-04 23:33:46 -06:00
Glenn Randers-Pehrson
5efb1327df [libpng16] Bump version to 1.6.15beta05 2014-11-04 07:08:37 -06:00
Glenn Randers-Pehrson
b5113f4e70 [libpng16] Imported from libpng-1.6.15beta04.tar 2014-11-04 07:08:23 -06:00
John Bowler
445475a166 [libpng16] Removed new PNG_USE_ARM_NEON configuration flag and made a one-line
revision to configure.ac to support ARM on aarch64 instead (John Bowler).
2014-11-03 19:44:39 -06:00
Glenn Randers-Pehrson
2eb712e519 [libpng16] Bump version to 1.6.15beta04 2014-11-03 09:33:51 -06:00
Glenn Randers-Pehrson
736c8e8773 [libpng16] Imported from libpng-1.6.15beta03.tar 2014-11-03 09:33:44 -06:00
Glenn Randers-Pehrson
3278452323 [libpng16] Added PNG_USE_ARM_NEON configuration flag (Marcin Juszkiewicz). 2014-11-03 08:24:34 -06:00
Glenn Randers-Pehrson
bd3818eb1b [libpng16] Bump version to 1.6.15beta03 2014-11-01 18:59:15 -05:00
Glenn Randers-Pehrson
b75c3cc415 [libpng16] Imported from libpng-1.6.15beta02.tar 2014-11-01 18:59:08 -05:00
Glenn Randers-Pehrson
b963feeec6 [libpng16] More cosmetic changes 2014-11-01 13:18:36 -05:00
Glenn Randers-Pehrson
f2d4167fee [libpng16] Added a pair of parentheses suggested by clang 2014-10-31 21:17:11 -05:00
Glenn Randers-Pehrson
5d713fe123 [libpng16] Changed remaining "if (!x)" to "if (x == 0)" and "if (x)" to
"if (x !== 0)"
2014-10-31 20:58:40 -05:00
Glenn Randers-Pehrson
6b9a20e7f9 [libpng16] Bump version to 1.6.15beta02 2014-10-29 09:13:06 -05:00
Glenn Randers-Pehrson
11d4a2a451 [libpng16] Imported from libpng-1.6.15beta01.tar 2014-10-29 09:08:46 -05:00
Glenn Randers-Pehrson
c6a8cb7d10 [libpng16] Added missing "ptr = NULL" after some instances of png_free(). 2014-10-29 08:27:34 -05:00
Glenn Randers-Pehrson
7f6826368a [libpng16] Use %p instead of %x to print pointers in pngtest debug output 2014-10-28 10:22:37 -05:00
Glenn Randers-Pehrson
bf95fad5f5 [libpng16] Simplified png_free_data() in png.c 2014-10-26 21:09:03 -05:00
Glenn Randers-Pehrson
ebba0746bc [libpng16] Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)" 2014-10-25 12:22:39 -05:00
Glenn Randers-Pehrson
67152e75e6 [libpng16] Revised INSTALL document. 2014-10-24 22:29:51 -05:00
Glenn Randers-Pehrson
4aa3f403f1 [libpng16] Updated INSTALL file. 2014-10-24 21:45:38 -05:00
Glenn Randers-Pehrson
56e9307d8f [libpng16] Bump version to 1.6.15beta01 2014-10-22 21:02:27 -05:00
Glenn Randers-Pehrson
eed640dbe8 [master] Imported from libpng-1.6.14.tar 2014-10-22 19:33:27 -05:00
Glenn Randers-Pehrson
edb772fd6d [libpng16] Imported from libpng-1.6.14.tar 2014-10-22 19:32:52 -05:00
Glenn Randers-Pehrson
e557fd7c44 [libpng16] Minor editing of README 2014-10-17 09:31:48 -05:00
Glenn Randers-Pehrson
8ba743d8d2 [libpng16] Bump version to 1.6.14rc03 2014-10-17 09:15:50 -05:00
Glenn Randers-Pehrson
279205664f [libpng16] Imported from libpng-1.6.14rc02.tar 2014-10-17 09:09:54 -05:00
Glenn Randers-Pehrson
f7a7bb0384 [libpng16] Changed png_convert_to_rfc_1123() to png_convert_to_rfc_1123_buffer()
in the manual, to reflect the change made in libpng-1.6.0.
Updated README file to reflect that direct access to the info struct and
png struct are not permitted since libpng-1.5.0.
2014-10-17 09:06:25 -05:00
Glenn Randers-Pehrson
3922544139 [libpng16] Bump version to 1.6.14rc01 2014-10-15 08:55:59 -05:00
Glenn Randers-Pehrson
bea9784db0 [libpng16] Imported from libpng-1.6.14rc01.tar 2014-10-15 08:36:22 -05:00
Glenn Randers-Pehrson
6cae24c265 [libpng16] Fixed some typos in comments. 2014-10-13 11:11:21 -05:00
Glenn Randers-Pehrson
06ec570881 [libpng16] Bump version to 1.6.14beta08 2014-10-07 18:57:36 -05:00
Glenn Randers-Pehrson
25d240dc6e [libpng16] Imported from libpng-1.6.14beta07.tar 2014-10-07 18:57:21 -05:00
Glenn Randers-Pehrson
470d64c2dd [libpng16] Also don't mark text as written in the end_ptr until written. 2014-10-05 18:08:39 -05:00
Glenn Randers-Pehrson
d7eff5d864 [libpng16] Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT"
from pnglibconf.dfa
2014-10-05 13:46:58 -05:00
Glenn Randers-Pehrson
a11cd84160 [libpng16] Only mark text chunks as written after successfully writing them. 2014-10-05 13:45:38 -05:00
Glenn Randers-Pehrson
f56c00f050 [libpng16] Bump version to 1.6.14beta07 2014-10-05 07:48:53 -05:00
Glenn Randers-Pehrson
f1a22bf9b3 [libpng16] Imported from libpng-1.6.14beta06.tar 2014-10-05 07:48:44 -05:00
Glenn Randers-Pehrson
a4fa1c57f4 [libpng16] Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
to pnglibconf.dfa.
2014-10-04 12:38:47 -05:00
Glenn Randers-Pehrson
27f0332cae [libpng16] Replaced repeated code with PNG_PUSH_SAVE_BUFFER_IF_FULL
in pngpread.c
2014-10-04 10:28:58 -05:00
Glenn Randers-Pehrson
9127138a30 [libpng16] Fix typos in comments in pngset.c and pngtrans.c 2014-10-03 20:23:31 -05:00
Glenn Randers-Pehrson
ca9c3a601b [libpng16] Edited comments in png.c 2014-10-03 18:08:34 -05:00
Glenn Randers-Pehrson
91e3a7d735 [libpng16] Edited some comments in pngwutil.c 2014-10-03 17:33:14 -05:00
Glenn Randers-Pehrson
cb4823d91f [libpng16] Conditionally compile some code in png_deflate_claim(), when
PNG_WARNINGS_SUPPORTED and PNG_ERROR_TEXT_SUPPORTED are disabled.
2014-10-03 17:14:39 -05:00
Glenn Randers-Pehrson
d752225d05 [libpng16] Removed "text_len" parameter from private function png_write_zTXt()
since it is unused.
2014-10-03 17:11:50 -05:00
Glenn Randers-Pehrson
f1eacc08e6 [libpng16] Bump version to 1.6.14beta06 2014-10-01 10:46:37 -05:00
Glenn Randers-Pehrson
6147fae405 [libpng16] Imported from libpng-1.6.14beta05.tar 2014-10-01 10:46:29 -05:00
Glenn Randers-Pehrson
c5dc456afd [libpng16] Redid recent changes to pnglibconf.h that were reverted. 2014-10-01 10:29:26 -05:00
Glenn Randers-Pehrson
f633a4eb9c [libpng16] Added "option READ_iCCP enables READ_COMPRESSED_TEXT" to
pnglibconf.dfa
2014-10-01 10:03:57 -05:00
Glenn Randers-Pehrson
6c48f77bba [libpng16] Merge pnglibconf.dfa with libpng-1.7.0beta37. 2014-09-28 13:43:28 -05:00
Glenn Randers-Pehrson
4c0ded3c4e [libpng16] Bump version to 1.6.14beta05 2014-09-27 10:39:12 -05:00
Glenn Randers-Pehrson
36b246a571 [libpng16] Imported from libpng-1.6.14beta04.tar 2014-09-27 10:28:57 -05:00
Glenn Randers-Pehrson
48e6fad71c [libpng16] Fixed incorrect handling of the iTXt compression flag
in pngrutil.c (bug report by Shunsaku Hirata).  Bug was introduced
in libpng-1.6.0.
2014-09-27 09:37:50 -05:00
Glenn Randers-Pehrson
1b3a9fd6bf [libpng16] Avoid defining simplified API macros in png.h when neither the
READ nor the WRITE simplified API is supported.
2014-09-20 11:01:20 -05:00
Glenn Randers-Pehrson
b4ef94559d [libpng16] Bump version to 1.6.14beta04 2014-09-19 07:58:07 -05:00
Glenn Randers-Pehrson
af557d98e1 [libpng16] Imported from libpng-1.6.14beta03.tar 2014-09-19 07:58:00 -05:00
Glenn Randers-Pehrson
551019baf6 [libpng16] Revert recent pngvalid.c changes and define FE_DIVBYZERO, etc.,
if not already defined.
2014-09-18 16:41:40 -05:00
Glenn Randers-Pehrson
77145bf678 [libpng16] Bump version to 1.6.14beta03 2014-09-18 09:56:47 -05:00
Glenn Randers-Pehrson
91685564d1 [libpng16] Imported from libpng-1.6.14beta02.tar 2014-09-18 09:56:39 -05:00
Glenn Randers-Pehrson
44bda93154 [libpng16] Updated INSTALL info about pnglibconf.h 2014-09-18 09:27:29 -05:00
Glenn Randers-Pehrson
baa95a2d49 [libpng16] Do not include <fenv.h> when FLOATING_ARITHMETIC is not supported. 2014-09-18 09:23:45 -05:00
Glenn Randers-Pehrson
996046aed5 [libpng16] Use nanosleep() instead of usleep() in contrib/gregbook/rpng2-x.c
because usleep() is deprecated.
2014-09-14 16:34:09 -05:00
Glenn Randers-Pehrson
e4489f1db2 [libpng16] Only define usleep() in gregbook/rpng2-x.c if not already defined. 2014-09-14 15:06:00 -05:00
Glenn Randers-Pehrson
3fe1616c45 [libpng16] Bump version to 1.6.14beta02 2014-09-14 14:23:40 -05:00
Glenn Randers-Pehrson
0df3198719 [libpng16] Imported from libpng-1.6.14beta01.tar 2014-09-14 14:23:32 -05:00
Glenn Randers-Pehrson
3a05d2df0f [libpng16] Add "#include <setjmp.h>" to contrib/tools/pngfix.c (John Bowler) 2014-09-11 07:39:24 -05:00
Glenn Randers-Pehrson
de5e34f3ce [libpng16] Add #include <setjmp.h> to contrib/tools/pngfix.c to allow "make" to
complete without setjmp support (bug report by Claudio Fontana)
2014-09-10 21:34:34 -05:00
Glenn Randers-Pehrson
0a3c788b51 [libpng16] Don't build contrib/tools/pngfix.c without setjmp support. 2014-09-10 17:27:53 -05:00
Glenn Randers-Pehrson
664bd637b5 [libpng16] Fixed some indentation in pngrutil.c 2014-08-26 19:55:58 -05:00
Glenn Randers-Pehrson
3669467347 [libpng16] Guard usage of png_ptr->options with #ifdef PNG_SET_OPTION_SUPPORTED. 2014-08-22 08:55:50 -05:00
Glenn Randers-Pehrson
bcd3209a42 [libpng16] Update last-changed date 2014-08-21 09:57:23 -05:00
Glenn Randers-Pehrson
17fba0f7d1 [libpng16] Bump version to 1.6.14beta01 2014-08-21 09:16:02 -05:00
Glenn Randers-Pehrson
d55c4f32fc [master] Imported from libpng-1.6.13.tar 2014-08-21 05:59:56 -05:00
Glenn Randers-Pehrson
259fb7761d [libpng16] Imported from libpng-1.6.13.tar 2014-08-21 05:57:43 -05:00
Glenn Randers-Pehrson
3ac41798c3 [libpng16] Bump version to 1.6.13rc02 2014-08-13 22:08:10 -05:00
Glenn Randers-Pehrson
26a94ab06f [libpng16] Imported from libpng-1.6.13rc01.tar 2014-08-13 22:08:01 -05:00
Glenn Randers-Pehrson
83fb26e38d [libpng16] Bump version to 1.6.13beta05 2014-08-07 20:00:00 -05:00
Glenn Randers-Pehrson
9782cced3a [libpng16] Imported from libpng-1.6.13beta04.tar 2014-08-07 19:54:10 -05:00
Glenn Randers-Pehrson
ff649a0710 [libpng16] Eliminated use of "$<" when copying $PNGLIBCONF_H_PREBUILT in
makefiles. This does not work on some versions of make; bug introduced in
libpng version 1.6.11.
2014-08-07 19:51:35 -05:00
Glenn Randers-Pehrson
389e5cbabf [libpng16] Removed mention of makefile.elf from scripts/README.txt 2014-08-03 19:53:45 -05:00
Glenn Randers-Pehrson
72e25f9583 [libpng16] Bump version to 1.6.13beta04 2014-08-02 21:32:49 -05:00
Glenn Randers-Pehrson
a243ec06b0 [libpng16] Imported from libpng-1.6.13beta03.tar 2014-08-02 21:28:14 -05:00
Glenn Randers-Pehrson
37c3b082a7 [libpng16] Ensure that CMakeLists.txt makes the target "lib" directory before
making symbolic link into it (SourceForge bug report #226 by Rolf Timmermans).
2014-07-30 08:15:26 -05:00
Glenn Randers-Pehrson
5e6931e10a [libpng16] Removed makefile.elf; it has not worked since libpng-1.5.0beta14. 2014-07-29 07:43:13 -05:00
Glenn Randers-Pehrson
0ece631b37 [libpng16] Bump version to 1.6.13beta03 2014-07-21 17:21:30 -05:00
Glenn Randers-Pehrson
3efbecab92 [libpng16] Imported from libpng-1.6.13beta02.tar 2014-07-21 17:21:21 -05:00
Glenn Randers-Pehrson
ae991771ad [libpng16] Updated a comment in revised makefiles. 2014-07-21 11:52:27 -05:00
Glenn Randers-Pehrson
071a17f194 [libpng16] Fixed an incorrect separator ("/" should be "\") in
scripts/makefile.vcwin32 (bug report from Wolfgang S. Kechel).  Bug was
introduced in libpng-1.6.11.  Also fixed makefile.bc32, makefile.bor,
makefile.msc, makefile.intel, and makefile.tc3 similarly.
2014-07-21 11:31:50 -05:00
Glenn Randers-Pehrson
398b00734c [libpng16] Bump version to 1.6.13beta02 2014-07-04 12:32:40 -05:00
Glenn Randers-Pehrson
8661906769 [libpng16] Fix typo in INSTALL. 2014-07-04 12:31:43 -05:00
Glenn Randers-Pehrson
91319c67d5 [libpng16] Imported from libpng-1.6.13beta01.tar 2014-07-04 12:13:59 -05:00
John Bowler
c45f1223cb [libpng16] Fixed misplaced brackets in earlier patch to pngpriv.h 2014-06-24 19:42:03 -05:00
John Bowler
910aaadddb [libpng16] Fixed clang no-warning builds: png_digit was defined but never used. 2014-06-24 19:38:41 -05:00
Glenn Randers-Pehrson
fc932f7b03 [libpng16] Changed "if defined(__ARM_NEON__)" to
"if defined(__ARM_NEON__) || defined(__ARM_NEON)" (James Wu).
2014-06-24 13:07:39 -05:00
John Bowler
83ae6fc266 [libpng16] Added "PNG_SET_OPTION" requirement for sRGB chunk support to
pnglibconf.dfa, needed for write-only support (John Bowler).
2014-06-22 11:23:07 -05:00
Glenn Randers-Pehrson
33ebeec0b5 [libpng16] Split a long output string in contrib/gregbook/rpng2-x.c. 2014-06-13 15:34:36 -05:00
Glenn Randers-Pehrson
225af8f363 [libpng16] Removed "PNG_UNUSED()" inadvertently left in contrib/gregbook
/readpng2.c from the previous update.
2014-06-13 12:55:43 -05:00
Glenn Randers-Pehrson
151eb95305 [libpng16] Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
compiler complaints about unused pointers.
2014-06-13 12:04:54 -05:00
Glenn Randers-Pehrson
f36a94207c [libpng16] Quieted -Wsign-compare and -Wclobber compiler warnings in
contrib/pngminus/*.c
2014-06-13 11:06:33 -05:00
Glenn Randers-Pehrson
212fd5745d [libpng16] Bump version to 1.6.13beta01 2014-06-11 21:13:33 -05:00
Glenn Randers-Pehrson
238e7646a8 [master] Imported from libpng-1.6.12.tar 2014-06-11 20:42:07 -05:00
Glenn Randers-Pehrson
e429c66cea [libpng16] Imported from libpng-1.6.12.tar 2014-06-11 20:41:51 -05:00
Glenn Randers-Pehrson
1a4c0144da [libpng16] Bump version to 1.6.12rc04 2014-06-08 12:10:04 -05:00
Glenn Randers-Pehrson
db1a0e763f [libpng16] Imported from libpng-1.6.12rc03.tar 2014-06-07 22:46:46 -05:00
Glenn Randers-Pehrson
41694dcaea [libpng16] Ensure "__has_attribute()" macro exists before trying to use it with
old clang compilers (MacPorts Ticket #43939).
2014-06-07 22:27:44 -05:00
Glenn Randers-Pehrson
ff3fb08157 [libpng16] Imported from libpng-1.6.12rc02.tar 2014-06-07 14:49:03 -05:00
Glenn Randers-Pehrson
79b7e4e621 [libpng16] Changed file permissions of contrib/tools/intgamma.sh from
0644 to 0755 (Cosmin).
2014-06-07 14:47:02 -05:00
Glenn Randers-Pehrson
b41a37d403 [libpng16] Imported from libpng-1.6.12rc01.tar 2014-06-06 18:31:35 -05:00
Glenn Randers-Pehrson
b7afba6a0b [libpng16] Relocated new code from 1.6.11beta06 in png.c to a point after the
declarations (Max Stepin).
2014-06-06 12:07:07 -05:00
Glenn Randers-Pehrson
da7b692ce0 [libpng16] Bump version to 1.6.12beta01 2014-06-06 11:57:30 -05:00
Glenn Randers-Pehrson
d21eae44e7 [master] Imported from libpng-1.6.11.tar 2014-06-05 10:01:04 -05:00
Glenn Randers-Pehrson
c4e0f3de64 [libpng16] Imported from libpng-1.6.11.tar 2014-06-05 10:00:45 -05:00
Glenn Randers-Pehrson
ee6050ecb4 [libpng16] Imported from libpng-1.6.11rc02.tar 2014-06-03 22:02:34 -05:00
Glenn Randers-Pehrson
165f072144 [libpng16] Imported from libpng-1.6.11rc01.tar 2014-05-27 11:15:53 -05:00
Glenn Randers-Pehrson
7acfe50855 [libpng16] Bump version to 1.6.11beta07 2014-05-19 21:20:05 -05:00
Glenn Randers-Pehrson
5808e7b8c8 [libpng16] Imported from libpng-1.6.11beta06.tar 2014-05-19 21:11:36 -05:00
Glenn Randers-Pehrson
f85092bc7b [libpng16] Fix cut-and-paste error in scripts/symbols.dfn, from 1.6.11beta02. 2014-05-19 21:08:49 -05:00
Glenn Randers-Pehrson
d1c5f48c05 [libpng16] Minor update to documentation and CHANGES/ANNOUNCE files. 2014-05-09 21:06:27 -05:00
Glenn Randers-Pehrson
e95ce2c517 [libpng16] Added PNG_SKIP_sRGB_CHECK_PROFILE choice for png_set_option(). 2014-05-07 12:07:12 -05:00
Glenn Randers-Pehrson
0d5ac5d809 [libpng16] Bump version to 1.6.11beta06 2014-04-26 06:41:54 -05:00
Glenn Randers-Pehrson
f30aa7ed92 [libpng16] Imported from libpng-1.6.11beta05.tar 2014-04-26 06:36:40 -05:00
Glenn Randers-Pehrson
ab9736a647 [libpng16] Allow writing ICC V2 profiles that lack padding (Kai-Uwe Behrmann). 2014-04-25 06:14:50 -05:00
Glenn Randers-Pehrson
5a1d1b5369 [libpng16] Do not reject ICC V2 profiles that lack padding (Kai-Uwe Behrmann). 2014-04-24 15:54:28 -05:00
Glenn Randers-Pehrson
d5201df56b [libpng16] Bump version to 1.6.11beta05 2014-04-20 20:23:13 -05:00
Glenn Randers-Pehrson
be19c07dd9 [libpng16] Imported from libpng-1.6.11beta04.tar 2014-04-20 20:15:26 -05:00
Glenn Randers-Pehrson
0ace9f589f [libpng16] PNG_sRGB_PROFILE_CHECKING = (-1) now means no sRGB profile checking. 2014-04-20 20:06:14 -05:00
Glenn Randers-Pehrson
72855fb11e [libpng16] Made progressive reading of interlaced images consistent with the
behavior of the sequential reader and consistent with the manual. The
row_callback now receives the proper pass number and unexpanded rows,
when png_combine_row is not used or not built, by moving some code
out of the PNG_READ_INTERLACING_SUPPORTED blocks.
2014-04-13 21:27:25 -05:00
Glenn Randers-Pehrson
9f1aa186e6 [libpng16] Added two CVE numbers to the January 2013 entry in the CHANGES file. 2014-04-10 16:46:35 -05:00
Glenn Randers-Pehrson
7a0ca967b4 [libpng16] Bump version to 1.6.11beta04 2014-04-06 14:18:13 -05:00
Glenn Randers-Pehrson
478062d9b5 [libpng16] Imported from libpng-1.6.11beta03.tar 2014-04-06 14:17:58 -05:00
Glenn Randers-Pehrson
86b8016ee9 [libpng16] Fix some permissions 2014-04-06 12:01:51 -05:00
Glenn Randers-Pehrson
f169806b7b [libpng16] Bump version to 1.6.11beta03 2014-04-06 10:20:44 -05:00
Glenn Randers-Pehrson
c4b3718856 [libpng16] Imported from libpng-1.6.11beta02.tar 2014-04-06 09:07:56 -05:00
Glenn Randers-Pehrson
fa26eb1678 [libpng16] Fixed a typo in pngrutil.c, introduced in libpng-1.5.6, that
interferes with "blocky" expansion of sub-8-bit interlaced PNG files.
2014-04-06 09:06:37 -05:00
Glenn Randers-Pehrson
d17313e075 [libpng16] Bump version to 1.6.11beta03 2014-03-25 17:10:53 -05:00
Glenn Randers-Pehrson
6b570f11e1 [libpng16] Imported from libpng-1.6.11beta02.tar 2014-03-25 17:10:44 -05:00
Glenn Randers-Pehrson
804c76b47b [libpng16] Fixed syntax of Copy command in makefile.amiga 2014-03-22 18:44:24 -05:00
Glenn Randers-Pehrson
247d262d3a [libpng16] Complete the update of scripts/makefile.ne12bsd 2014-03-22 13:40:25 -05:00
Cosmin Truta
9ab7b4ca58 [libpng16] Allow an easy replacement of the default pre-built configuration
header with a custom header, via the make PNGLIBCONF_H_PREBUILT
macro.
2014-03-22 13:13:11 -05:00
Cosmin Truta
ae6eaa89e5 [libpng16] Don't warn about invalid dimensions exceeding user limits. 2014-03-22 09:39:33 -05:00
Cosmin Truta
82200daec2 [libpng16] $(CP) is now used alongside $(RM_F). Also, use 'copy' instead
of 'cp' where applicable, and applied other minor makefile changes.
2014-03-22 09:29:59 -05:00
Cosmin Truta
6572c7dab5 [libpng16] Silence 'unused parameter' build warnings (Cosmin). 2014-03-22 09:20:53 -05:00
Glenn Randers-Pehrson
372cad05a9 [libpng16] Committed wrong version of INSTALL. 2014-03-21 13:26:43 -05:00
Glenn Randers-Pehrson
010222c55d [libpng16] Mention scripts/pnglibconf.h.prebuilt in INSTALL. 2014-03-21 12:53:06 -05:00
Glenn Randers-Pehrson
d74d82137b [libpng16] Cosmetic revision of previous change 2014-03-17 15:35:28 -05:00
Glenn Randers-Pehrson
a518abd582 [libpng16] Removed #if/#else/#endif from inside two pow() calls in pngvalid.c
because they were handled improperly by Portland Group's PGI-14.1 - PGI-14.3
when using its "__builtin_pow()" function.
2014-03-17 15:29:25 -05:00
Glenn Randers-Pehrson
23646318e4 [libpng16] Bump version to 1.6.11beta02 2014-03-17 13:21:33 -05:00
Glenn Randers-Pehrson
149eea29b6 [libpng16] Imported from libpng-1.6.11beta01.tar 2014-03-17 13:19:41 -05:00
Glenn Randers-Pehrson
2ca2a0b222 [libpng16] Move more parts of INSTALL to libpng-manual.txt and vice versa. 2014-03-16 21:47:52 -05:00
Glenn Randers-Pehrson
7017c4078d [libpng16] Revised INSTALL and libpng-manual.txt 2014-03-16 20:29:11 -05:00
Glenn Randers-Pehrson
c2a15d01af [libpng16] Moved part of INSTALL back to manual; added table of contents. 2014-03-16 19:53:29 -05:00
Glenn Randers-Pehrson
0464b436b6 [libpng16] Added information about configuring for multiprocessing to INSTALL. 2014-03-16 19:31:09 -05:00
Glenn Randers-Pehrson
2f5fb84cc4 [libpng16] Updated the manual and moved part of it to the INSTALL file. 2014-03-16 15:30:35 -05:00
Glenn Randers-Pehrson
33e2bd910f [libpng16] Changed ZlibSrcDir from 1.2.5 to 1.2.8 in projects/vstudio. 2014-03-09 18:37:06 -05:00
Glenn Randers-Pehrson
05670156f3 [libpng16] Use "if (value != 0)" instead of "if (value)" consistently. 2014-03-08 12:39:52 -06:00
Glenn Randers-Pehrson
b65b3412b1 [libpng16] Remove CALLOC from pnglibconf.dfa and pnglibconf.h.prebuilt 2014-03-07 12:19:41 -06:00
Glenn Randers-Pehrson
71d23c4d6e [libpng16] Bump version to 1.6.11beta01 2014-03-06 21:09:24 -06:00
Glenn Randers-Pehrson
1cc02f0395 [master] Imported from libpng-1.6.10.tar 2014-03-06 13:15:45 -06:00
Glenn Randers-Pehrson
4df37bfa4f [libpng16] Imported from libpng-1.6.10.tar 2014-03-06 12:49:17 -06:00
Glenn Randers-Pehrson
c978642c48 [libng16] Mention prototype format in the documentation (libpng style guide) 2014-03-05 17:14:16 -06:00
Glenn Randers-Pehrson
24afd07ab9 [libpng16] Changed blank to newline in three function declarations. 2014-03-05 16:55:19 -06:00
Glenn Randers-Pehrson
c540d8bed7 [libpng16] Bump version to 1.6.10rc04 2014-03-03 20:26:56 -06:00
Glenn Randers-Pehrson
3e5d04df37 [libpng16] Imported from libpng-1.6.10rc03.tar 2014-03-03 20:26:46 -06:00
Glenn Randers-Pehrson
6e8ba0fab6 [libpng16] Un-deprecated png_data_freer(). 2014-03-03 20:17:01 -06:00
Glenn Randers-Pehrson
b3a765066f [libpng16] Updated CHANGES and ANNOUNCE to libpng-1.6.10rc02. 2014-02-27 22:48:08 -06:00
Glenn Randers-Pehrson
4c7bb07857 [libpng16] Imported from libpng-1.6.10rc02.tar 2014-02-27 22:24:47 -06:00
Glenn Randers-Pehrson
b8f433417f [libpng16] Removed unreachable return statement after png_chunk_error()
in pngrutil.c
2014-02-27 12:12:54 -06:00
Glenn Randers-Pehrson
53c60fa94b [libpng16] Bump version to 1.6.10rc01 2014-02-27 08:37:51 -06:00
Glenn Randers-Pehrson
ab56b743c1 [libpng16] Imported from libpng-1.6.10rc01.tar 2014-02-27 08:06:45 -06:00
Glenn Randers-Pehrson
3455238a4e [libpng16] Fixed typos in the manual and in scripts/pnglibconf.dfa (CFLAGS
-> CPPFLAGS and PNG_USR_CONFIG -> PNG_USER_CONFIG).
2014-02-26 22:08:58 -06:00
Glenn Randers-Pehrson
9f0ac8548b [libpng16] Mention CERT VU#684412 and CVE-2014-0333 in CHANGES and ANNOUNCE. 2014-02-25 12:00:58 -06:00
Glenn Randers-Pehrson
2fff8078dc [libpng16] Bump version to 1.6.10beta04 2014-02-24 21:02:54 -06:00
Glenn Randers-Pehrson
da7027b6b0 [libpng16] Imported from libpng-1.6.10beta03.tar 2014-02-24 19:11:18 -06:00
Glenn Randers-Pehrson
9e06534572 [libpng16] Removed some commentary from png.h that is now in the manual. 2014-02-24 19:07:04 -06:00
Glenn Randers-Pehrson
be040c98f8 [libpng16] Moved some documentation from png.h to libpng.3 and libpng-manual.txt
and minor editing of contrib/arm-neon/README and contrib/examples/*.c
2014-02-24 18:48:03 -06:00
Glenn Randers-Pehrson
bd792c020f [libpng16] Document how to use a different crc_action while reading chunks
after IDAT with the sequential reader.
2014-02-23 13:43:20 -06:00
Glenn Randers-Pehrson
079a724833 [libpng16] Fixed some nits in contrib/arm-neon/README and comments in
contrib/examples/*.c
2014-02-23 10:59:27 -06:00
Glenn Randers-Pehrson
1301356273 [libpng16] Bump version to 1.6.10beta03 2014-02-22 23:20:23 -06:00
Glenn Randers-Pehrson
78c28fea51 [libpng16] Imported from libpng-1.6.10beta02.tar 2014-02-22 23:12:02 -06:00
Glenn Randers-Pehrson
45625eceb4 [libpng16] Don't recognize known sRGB profiles as sRGB if they have been hacked,
but don't reject them and don't issue a copyright violation warning.
Simplified code in pngrutil.c that decides whether to warn about an
incorrect ancillary PLTE chunk.
2014-02-22 23:09:27 -06:00
Glenn Randers-Pehrson
e3ae583514 [libpng16] Don't recognize known sRGB profiles as sRGB if they have been hacked. 2014-02-22 22:22:15 -06:00
Glenn Randers-Pehrson
eb657ae68f [libpng16] Added png_ptr->process_mode = PNG_READ_IDAT_MODE in
png_push_read_chunk after recognizing the IDAT chunk, which avoids an
infinite loop while reading a datastream whose first IDAT chunk is of
zero-length.
2014-02-22 21:59:40 -06:00
Glenn Randers-Pehrson
f5df058bee [libpng16] Use a user warning handler in contrib/gregbook/readpng2.c
instead of the default.
2014-02-22 07:15:48 -06:00
Glenn Randers-Pehrson
dd6679dce8 [libpng16] Check for __has_extension before using it in pngconf.h, to
support older Clang versions (Jeremy Sequoia).
2014-02-20 07:06:59 -06:00
Glenn Randers-Pehrson
9c5a1baea5 [libpng16] Check for info_ptr == NULL early in png_read_end() so we don't need
to run all the png_handle_*() and depend on them to return if info_ptr == NULL.
This improves the performance of png_read_end(png_ptr, NULL) and makes
it more robust against future programming errors.
2014-02-17 09:12:52 -06:00
John Bowler
37b7299b60 [libpng16] Deleted a now-redundant #define png_error from pngvalid.c 2014-02-16 22:55:41 -06:00
John Bowler
0b61d10ad4 [libpng16] Fixed /proc/cpuinfo ARM NEON __linux__ parsing 2014-02-16 14:07:49 -06:00
John Bowler
dba54b8888 [libpng16] Moved OS dependent code from arm/arm_init.c, to allow the included
implementation of the ARM NEON discovery function to be set at
build-time and provide sample implementations from the current code in the
contrib/arm-neon subdirectory. The __linux__ code has also been changed to
compile and link on Android by using /proc/cpuinfo, and the old linux code
is in contrib/arm-neon/linux-auxv.c.  The new code avoids POSIX and Linux
dependencies apart from opening /proc/cpuinfo and is C90 compliant.
2014-02-16 14:00:06 -06:00
Glenn Randers-Pehrson
38ef9c9779 [libpng16] Removed unneeded "#define PNG_NO_WARNINGS" from contrib/pngminim/* 2014-02-16 13:56:10 -06:00
Glenn Randers-Pehrson
103b04170d [libpng16] Moved redefines of png_error(), png_warning(), png_chunk_error(),
and png_chunk_warning() from pngpriv.h to png.h to make them visible
to libpng-calling applications.
2014-02-16 08:34:41 -06:00
Glenn Randers-Pehrson
e40e37018d [libpng16] Bump version to 1.6.10beta02 2014-02-09 13:14:20 -06:00
Glenn Randers-Pehrson
9eec159ab0 [libpng16] Imported from libpng-1.6.10beta01.tar 2014-02-09 13:00:23 -06:00
John Bowler
414d7b5f7d [libpng16] Backport recent changes from libpng-1.7.0beta30 and beta31. 2014-02-06 11:39:25 -06:00
Glenn Randers-Pehrson
685dff485e [libpng16] Update ANNOUNCE file about new location of gpg signatures. 2014-02-06 11:01:55 -06:00
Glenn Randers-Pehrson
8a227ff25a [libpng16] Bump version to 1.6.10beta01 2014-02-05 23:51:39 -06:00
Glenn Randers-Pehrson
a710317d2f [master] Imported from libpng-1.6.9.tar 2014-02-05 22:34:07 -06:00
Glenn Randers-Pehrson
3e753eb8b2 [libpng16] Imported from libpng-1.6.9.tar 2014-02-05 22:33:56 -06:00
Glenn Randers-Pehrson
759c903686 [libpng16] Update documentation about sCAL support. 2014-02-01 20:11:48 -06:00
Glenn Randers-Pehrson
8c12078e95 [libpng16] Imported from libpng-1.6.9rc02.tar 2014-01-30 15:04:10 -06:00
Glenn Randers-Pehrson
b91528db20 [libpng16] Quiet an uninitialized memory warning from VC2013 in png_get_png(). 2014-01-30 15:02:18 -06:00
Glenn Randers-Pehrson
2f1dede991 [libpng16] Imported from libpng-1.6.9rc01.tar 2014-01-28 11:35:50 -06:00
Glenn Randers-Pehrson
5af0307f11 [libpng16] Imported from libpng-1.6.9beta04.tar 2014-01-20 13:14:40 -06:00
Glenn Randers-Pehrson
efaaad7447 [libpng16] Correct a new comment in pngconf.h 2014-01-13 21:43:51 -06:00
Glenn Randers-Pehrson
bda94b1005 [libpng16] Added clang attribute support (Cosmin). 2014-01-13 21:16:17 -06:00
Glenn Randers-Pehrson
4250328102 [libpng16] Updated scripts/makefile.* to use CPPFLAGS (Cosmin) 2014-01-12 10:49:40 -06:00
Glenn Randers-Pehrson
bb6e0a2db3 [libpng16] Bump version to 1.6.9beta04 2014-01-10 10:36:59 -06:00
Glenn Randers-Pehrson
41633d33c4 [libpng16] Imported from libpng-1.6.9beta03.tar 2014-01-10 10:36:46 -06:00
Glenn Randers-Pehrson
88cf760b07 [libpng16] Removed potentially misleading warning from png_check_IHDR(). 2014-01-10 06:18:31 -06:00
Glenn Randers-Pehrson
4ea97d8bc7 [libpng16]Revised png_check_IHDR() to use PNG_SIZE_MAX instead of
PNG_UINT_32_MAX in the test for potential overflow in PNG_ROWBYTES.
2014-01-09 20:13:31 -06:00
Glenn Randers-Pehrson
bef206b0a8 [libpng16] Only warn about image too wide if warning not already issued. 2014-01-08 11:58:49 -06:00
Glenn Randers-Pehrson
b94db2eb34 [libpng16] Updated warning message in png_check_IHDR() 2014-01-07 11:43:43 -06:00
Glenn Randers-Pehrson
3f7a169c2d [libpng16] Changed warning message "is too large" to "may be too large"
in png_check_IHDR().
2014-01-07 11:22:29 -06:00
Glenn Randers-Pehrson
bc79c250e9 [libpng16] Bump version to 1.6.9beta03 2014-01-01 10:54:18 -06:00
Glenn Randers-Pehrson
3cc9e8ff96 [libpng16] Imported from libpng-1.6.9beta02.tar 2014-01-01 10:18:42 -06:00
Glenn Randers-Pehrson
95a197397f [libpng16] Updated copyright year in recently-changed files. 2013-12-31 21:10:13 -06:00
John Bowler
d0479d24a0 [libpng16] Allow unversioned links created on install to be disabled in
configure.  In configure builds 'make install' changes/adds links like png.h
and libpng.a to point to the newly installed, versioned, files (e.g.
libpng17/png.h and libpng17.a). Three new configure options and some
rearrangement of Makefile.am allow creation of these links to be disabled.
2013-12-29 19:31:56 -06:00
John Bowler
1fc0171278 [libpng16] Revised pngvalid.c to support libpng 1.5, which does not support the
PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in
pngvalid.c
2013-12-29 15:09:28 -06:00
John Bowler
a8472470a4 [libpng16] Merged libpng-1.7.0 changes to make no-interlace configurations work
with test programs.
2013-12-29 10:50:51 -06:00
Glenn Randers-Pehrson
88ecac68be [libpng16] Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c
with libpng-1.7.0
2013-12-28 12:52:59 -06:00
Glenn Randers-Pehrson
e51ba2eff4 [libpng16] Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner). 2013-12-27 20:22:24 -06:00
John Bowler
a80e864faa [libpng16] Merged with pngvalid.c from libpng-1.7 changes to create a single
pngvalid.c
2013-12-27 08:43:55 -06:00
John Bowler
1d3c990425 [libpng16] Added checks for libpng 1.5 to pngvalid.c. This supports the use of
this version of pngvalid in libpng 1.5
2013-12-27 08:14:06 -06:00
Glenn Randers-Pehrson
79f0ba499f [libpng16] Fixed typo in CHANGES and ANNOUNCE (autoconf version 2.69, not 2.59) 2013-12-26 15:00:49 -06:00
Glenn Randers-Pehrson
74e84d0f7d [libpng16] Removed config-generated "compile" file 2013-12-26 14:44:10 -06:00
Glenn Randers-Pehrson
4568762d28 [libpng16] Bump version to 1.6.9beta02 2013-12-26 11:40:31 -06:00
Glenn Randers-Pehrson
0740c62700 [libpng16] Imported from libpng-1.6.9beta01.tar 2013-12-26 11:27:02 -06:00
Glenn Randers-Pehrson
38f49403bd [libpng16] Update "last changed" dates in recently-patched files. 2013-12-22 15:04:00 -06:00
John Bowler
8f1150eb75 [libpng16] Made transform implementation functions static. This makes the
internal functions called by png_do_{read|write}_transformations static. On an
x86-64 DLL build (Gentoo Linux) this reduces the size of the text
segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
maintenance by removing the declarations from pngpriv.h and allowing
easier changes to the internal interfaces.
2013-12-19 15:33:49 -06:00
John Bowler
c10930a4fc [libpng16] Bookkeeping: Moved functions around (no changes). Moved transform
function definitions before the place where they are called so that
they can be masde static. Move the intrapixel functions and the
grayscale palette builder out of the png?tran.c files. The latter
isn't a transform function and is no longer used internally, and the
former MNG specific functions are better placed in pngread/pngwrite.c
2013-12-19 15:24:06 -06:00
Glenn Randers-Pehrson
bff81bdddc [libpng16] Bump version to 1.6.9beta01 2013-12-19 15:18:07 -06:00
Glenn Randers-Pehrson
339ef1ec97 [master] Imported from libpng-1.6.8.tar 2013-12-19 09:13:08 -06:00
Glenn Randers-Pehrson
be3977de2c [libpng16] Imported from libpng-1.6.8.tar 2013-12-19 09:11:01 -06:00
Glenn Randers-Pehrson
67f101e6c9 [libpng16] Imported from libpng-1.6.8rc02.tar 2013-12-14 12:42:36 -06:00
Glenn Randers-Pehrson
b6f0a641cb [libpng16] Imported from libpng-1.6.8rc01.tar 2013-12-11 23:28:18 -06:00
John Bowler
81dfd007b2 [libpng16] Tidied up pngfix inits and fixed non-write pngtest. 2013-12-01 15:20:15 -06:00
Glenn Randers-Pehrson
1f23775d10 [libpng16] Fixed unused "wrote_question" in non-write pngtest. 2013-12-01 15:05:31 -06:00
Glenn Randers-Pehrson
84092bbf29 [libpng16] Bump version to 1.6.8beta03 2013-11-30 09:12:33 -06:00
Glenn Randers-Pehrson
1658e602c6 [libpng16] Imported from libpng-1.6.8beta02.tar 2013-11-30 09:12:23 -06:00
Glenn Randers-Pehrson
83b132f14d [libpng16] Changed deprecated png_free_default() to free() in pngtest.c
Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
to '"%s" m' to improve portability among compilers.
2013-11-28 16:33:27 -06:00
Glenn Randers-Pehrson
1f63da349b [libpng16] Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
to '"%s" m' to improve portability among compilers.
Changed png_free_default() to free() in pngtest.c
2013-11-28 13:41:10 -06:00
Glenn Randers-Pehrson
44db02364e [libpng16] Avoid a clang scan-build warning in pngtest.c 2013-11-25 13:19:57 -06:00
Glenn Randers-Pehrson
3f8a2ed600 [libpng16] Removed or marked PNG_UNUSED some harmless "dead assignments"
reported by clang scan-build.
2013-11-25 10:38:21 -06:00
Glenn Randers-Pehrson
30145f29c5 [libpng16] Revised manual about handling of zlib CMF 2013-11-24 13:33:07 -06:00
Glenn Randers-Pehrson
d56af331e1 [libpng16] Bump version to 1.6.8beta02 2013-11-23 18:59:14 -06:00
Glenn Randers-Pehrson
1c6e5f8caa [libpng16] Imported from libpng-1.6.8beta01.tar 2013-11-23 18:41:43 -06:00
Glenn Randers-Pehrson
27ae9362d8 [libpng16] Added another "assert()" in pngfix.c 2013-11-23 12:42:43 -06:00
Glenn Randers-Pehrson
88507b4ef9 [libpng16] Avoid a clang scanner warning in pngfix.c 2013-11-23 12:26:00 -06:00
John Bowler
0f6303301f [libpng16] Fixed pngvalid 'fail' function declaration on the Intel C Compiler.
This reverts to the previous 'static' implementation and works round
the 'unused static function' warning by using PNG_UNUSED().
2013-11-22 18:49:58 -06:00
John Bowler
aaf1bb1ae1 [libpng16] Updated "last changed" dates 2013-11-22 15:40:52 -06:00
Glenn Randers-Pehrson
b5596712fc [libpng16] Update contrib/tools/pngfix.c 2013-11-22 15:26:22 -06:00
Glenn Randers-Pehrson
503a49458b [libpng16] Enabled WRITE_INVERT and WRITE_PACK in contrib/pngminim/encoder. 2013-11-22 15:16:04 -06:00
Glenn Randers-Pehrson
c912050a7b [libpng16] Fixed 'minimal' builds. Various obviously useful minimal
configurations don't build because of missing contrib/libtests test programs
and overly complex dependencies in scripts/pnglibconf.dfa. This change adds
contrib/conftest/*.dfa files that can be used in automatic build
scripts to ensure that these configurations continue to build.
2013-11-22 14:58:04 -06:00
Glenn Randers-Pehrson
113213416c [libpng16] Conditionally compile some unused functions reported by -Wall
in pngminim.
2013-11-18 20:12:24 -06:00
Glenn Randers-Pehrson
bd757acf26 [libpng16] Reverted change of ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
to PNG_SET_UNKNOWN_SUPPORTED in pngpread.c; it led to the possibility of
calling png_handle_unknown() twice.
2013-11-18 18:40:39 -06:00
Glenn Randers-Pehrson
a7f0bcb3a6 [libpng16] Added "-Wall" to CFLAGS in contrib/pngminim/*/makefile 2013-11-18 17:07:26 -06:00
Glenn Randers-Pehrson
7976b3c3e3 [libpng16] Moved prototype for png_handle_unknown() in pngpriv.h outside of
the #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED/#endif block.
Removed recently-added #ifdef from pngpread.c; moving the prototype
in pngpriv.h fixed the compiler warning that the #ifdef was trying
to solve.
2013-11-18 11:38:42 -06:00
Glenn Randers-Pehrson
012d36f643 [libpng16] Changed ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED to
ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTE in pngpread.c to agree with
what is in pngpriv.h
2013-11-17 19:42:48 -06:00
Glenn Randers-Pehrson
68dfa9e526 [libpng16] Reduced scope of recently-added #ifdef block
(#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED/#endif in pngpread.c)
2013-11-17 19:26:40 -06:00
Glenn Randers-Pehrson
416bb9320f [libpng16] Added #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED/#endif in pngpread.c 2013-11-17 11:06:50 -06:00
Glenn Randers-Pehrson
f2b8961f58 [libpng16] Bump version to 1.6.8beta01 2013-11-14 13:17:57 -06:00
Glenn Randers-Pehrson
6a3805c25b [libpng16] Update version number in manual and png.h 2013-11-14 13:16:21 -06:00
Glenn Randers-Pehrson
0e60f06b7c [master] Update version number in CHANGES file. 2013-11-14 12:52:10 -06:00
Glenn Randers-Pehrson
cf247ebffe [libpng16] Update version number in CHANGES file. 2013-11-14 12:51:15 -06:00
Glenn Randers-Pehrson
a066d49b01 [master] Imported from libpng-1.6.7.tar 2013-11-14 12:28:22 -06:00
Glenn Randers-Pehrson
0ea69cdfa9 [libpng16] Imported from libpng-1.6.7.tar 2013-11-14 12:28:05 -06:00
Glenn Randers-Pehrson
8bf54399a3 [libpng16] Bump version to 1.6.7rc03 2013-11-07 08:15:38 -06:00
Glenn Randers-Pehrson
4da9d314bc [libpng16] Imported from libpng-1.6.7rc02.tar 2013-11-07 08:15:30 -06:00
John Bowler
08b0620202 [libpng16] Fixed #include in filter_neon_intrinsics.c and ctype macros. The
ctype char checking macros take an unsigned char argument, not a signed char.
2013-11-04 13:44:37 -06:00
Glenn Randers-Pehrson
dee5a914fc [libpng16] Bump version to 1.6.7rc02 2013-11-02 16:49:53 -05:00
Glenn Randers-Pehrson
d2d09e5bf9 [libpng16] Imported from libpng-1.6.7rc01.tar 2013-11-02 15:48:28 -05:00
Glenn Randers-Pehrson
03eafe24ed [libpng16] Bump version to 1.6.7beta05 2013-10-26 11:52:05 -05:00
Glenn Randers-Pehrson
e9a8fb8d07 [libpng16] Imported from libpng-1.6.7beta04.tar 2013-10-26 11:51:56 -05:00
John Bowler
fd8bba4b80 [libpng16] Changed NEON implementation selection mechanism to allow assembler
or intrinsics to be turned on during the build by defining
PNG_ARM_NEON_IMPLEMENTATION to the correct value (2 or 1).  The
default is "undefined" and the build type is selected in pngpriv.h.
2013-10-25 16:11:57 -05:00
John Bowler
bb9adfdad9 [libpng16] Allow clang derived from older GCC versions to use ARM intrinsics. 2013-10-24 07:45:27 -05:00
Glenn Randers-Pehrson
393d3c8285 [libpng16] Updated CHANGES comment about enabling ARMv8 code
We use -mfpu=neon instead of a configuration flag.
2013-10-19 09:34:54 -05:00
Glenn Randers-Pehrson
9450ffb26d [libpng16] Bump version to 1.6.7beta04 2013-10-19 09:06:07 -05:00
Glenn Randers-Pehrson
ed049010b1 [libpng16] Imported from libpng-1.6.7beta03.tar 2013-10-19 09:05:59 -05:00
John Bowler
db9d96840d [libpng16] Cleaned up ARM NEON compilation handling. The tests are now in
pngpriv.h and detect the broken GCC compilers.
2013-10-18 15:28:00 -05:00
John Bowler
9e9977e153 [libpng16] Revised pngvalid to generate size images with as many filters as
it can manage, limited by the number of rows.
2013-10-17 08:23:13 -05:00
John Bowler
681b731151 [libpng16] Fixed loop end condition in filter_neon_intrinsics.c 2013-10-17 08:12:55 -05:00
John Bowler
83a841ab7c [libpng16] Fix compilation errors in filter_neon_intrinsics.c
Use filter_neon_intrinsics.c in preference to filter_neon.S when possible.
2013-10-15 21:19:56 -05:00
Glenn Randers-Pehrson
85c2ec9a69 [libpng16] Restored arm/arm_init.c to CSRCS in Makefile.am 2013-10-14 19:55:45 -05:00
Glenn Randers-Pehrson
cf644fa901 [libpng16] Update "last changed" dates in arm/filter_neon_intrinsics.c and
pngrtran.c
2013-10-14 13:16:38 -05:00
Glenn Randers-Pehrson
17ad121e93 [libpng16] Work around problem with multiple-line "test" command missing
continuation backslashes
2013-10-14 13:15:09 -05:00
Glenn Randers-Pehrson
19e4edaf3f [libpng16] Conditionally compile arm/filter_neon_intrinsics.c
if PNG_READ_SUPPORTED and PNG_ARM_NEON_OPT > 0
2013-10-14 12:47:49 -05:00
Glenn Randers-Pehrson
e1540e3b4c [libpng16] Updated configure.ac to handle new on-intrinsics, etc., options. 2013-10-14 11:38:53 -05:00
Glenn Randers-Pehrson
063eb1b497 [libpng16] Added ARMv8 support (James Yu <james.yu at linaro.org>). Added file
arm/filter_neon_intrinsics.c; enable with configuration flag
PNG_ARM_NEON_INTRINSICS.
2013-10-14 11:14:36 -05:00
Glenn Randers-Pehrson
fecdd46639 [libpng16] Fix some typos in autogen.sh that don't affect its behavior 2013-10-13 17:14:48 -05:00
Glenn Randers-Pehrson
0e036921aa [libpng16] Bump version to 1.6.7beta03 2013-10-13 13:48:11 -05:00
Glenn Randers-Pehrson
e827fa24a0 [libpng16] Imported from libpng-1.6.7beta02.tar 2013-10-13 11:47:41 -05:00
John Bowler
34ac3691cb [libpng16] Make autogen.sh work with automake 1.13 as well as 1.14. Do this
by always removing the 1.14 'compile' script but never checking for it.
2013-10-06 11:29:55 -05:00
John Bowler
236e105170 [libpng16] Simplified error message code in pngunknown. The simplification has
the useful side effect of avoiding a bogus warning generated by the latest
version of the Intel C compiler (it objects to
condition ? string-literal : string-literal).
2013-10-04 20:28:33 -05:00
John Bowler
5b1df53a82 [libpng16] Cleaned up (char*) casts of zlib messages. The latest version of
the Intel C compiler complains about casting a string literal as (char*), so
copied the treatment of z_const from the library code into pngfix.c
2013-10-04 20:13:17 -05:00
John Bowler
940b37b197 [libpng16] Made changes for compatibility with automake 1.14:
1) Added the 'compile' program to the list of programs that must be cleaned
       in autogen.sh
    2) Added 'subdir-objects' which causes .c files in sub-directories to be
       compiled such that the corresponding .o files are also in the
       sub-directory.  This is because automake 1.14 warns that the
       current behavior of compiling to the top level directory may be removed
       in the future.
    3) Updated dependencies on pnglibconf.h to match the new .o locations and
       added all the files in contrib/libtests and contrib/tools that depend
       on pnglibconf.h
    4) Added 'BUILD_SOURCES = pnglibconf.h'; this is the automake recommended
       way of handling the dependencies of sources that are machine generated;
       unfortunately it only works if the user does 'make all' or 'make check',
       so the dependencies (3) are still required.
2013-10-04 19:56:19 -05:00
John Bowler
0441ff62e7 [libpng16] Remove spurious "#ifdef PNG_sRGB_SUPPORTED" from pngrutil.c 2013-10-04 19:28:48 -05:00
Glenn Randers-Pehrson
de723276e5 [libpng16] Bump version to 1.6.7beta02 2013-10-02 13:47:02 -05:00
Glenn Randers-Pehrson
2464dbfe4c [libpng16] Imported from libpng-1.6.7beta01.tar 2013-09-30 17:05:35 -05:00
Glenn Randers-Pehrson
b3721757a0 [libpng16] Catch up with some recent changes that did not get merged. 2013-09-30 13:56:44 -05:00
John Bowler
cc93d89e43 [libpng16] Updated pngunknown.c 2013-09-30 13:07:58 -05:00
John Bowler
8f381901e3 [libpng16] Avoid up-cast warnings in pngvalid.c. On ARM the alignment
requirements of png_modifier are greater than that of png_store and as a
consequence compilation of pngvalid.c results in a warning about increased
alignment requirements because of the bare cast to (png_modifier*). The code
is safe, because the pointer is known to point to a stack allocated
png_modifier, but this change avoids the warning.

  Fixed default behavior of ARM_NEON_API. If the ARM NEON API option was
    compiled without the CHECK option it defaulted to on, not off.

  Check user callback behavior in pngunknown.c. Previous versions compiled
    if SAVE_UNKNOWN was not available but did nothing since the callback
    was never implemented.

  Merged pngunknown.c with 1.7 version and back ported 1.7 improvements/fixes
2013-09-30 11:24:17 -05:00
John Bowler
15a80443de [libpng16] Allow HANDLE_AS_UNKNOWN to work when other options are configured
off. Also fixed the pngminim makefiles to work when $(MAKEFLAGS) contains stuff
which terminates the make options (as by default in recent versions of Gentoo).
2013-09-21 10:06:32 -05:00
Glenn Randers-Pehrson
6f8f004fe1 [libpng16] Added #ifdef PNG_READ_SUPPORTED/endif around the
png_chunk_unknown_handling() function, and restored the unknown-chunk
handling code from libpng-1.6.6.

Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net

Glenn R-P
2013-09-20 15:40:15 -05:00
Glenn Randers-Pehrson
873f16fe2f [libpng16] Reverted the change to unknown handling #defines; the change
breaks 'NOREAD' builds.
2013-09-20 14:28:50 -05:00
Glenn Randers-Pehrson
7ae451f527 [libpng16] Bump version to 1.6.7beta01 2013-09-16 11:47:17 -05:00
Glenn Randers-Pehrson
391459424e [libpng16] Imported from libpng-1.6.6.tar 2013-09-16 10:39:16 -05:00
Glenn Randers-Pehrson
05f3788b7a [master] Imported from libpng-1.6.5.tar 2013-09-14 09:44:17 -05:00
Glenn Randers-Pehrson
53ae7dc514 [libpng16] Imported from libpng-1.6.5.tar 2013-09-14 09:44:09 -05:00
Glenn Randers-Pehrson
cd6a3ef31f [libpng16] Bump version to 1.6.5beta01 2013-09-12 08:02:22 -05:00
Glenn Randers-Pehrson
90e288241d [master] Imported from libpng-1.6.4.tar 2013-09-12 07:44:55 -05:00
Glenn Randers-Pehrson
209d3eb5c6 [libpng16] Imported from libpng-1.6.4.tar 2013-09-12 07:27:14 -05:00
Glenn Randers-Pehrson
d42dc54df5 [libpng16] Imported from libpng-1.6.4rc01.tar 2013-09-05 15:18:13 -05:00
Glenn Randers-Pehrson
877afaf17e [libpng16] Bump version to 1.6.4beta03 2013-08-29 19:45:48 -05:00
Glenn Randers-Pehrson
8c49ddcf56 [libpng16] Imported from libpng-1.6.4beta02.tar 2013-08-29 19:39:34 -05:00
Glenn Randers-Pehrson
5680f5d6f2 [libpng16] Bump version to 1.6.4beta02 2013-08-21 18:59:09 -05:00
Glenn Randers-Pehrson
324402044f [libpng16] Imported from libpng-1.6.4beta01.tar 2013-08-21 18:45:24 -05:00
Glenn Randers-Pehrson
685d79e27a [libpng16] Delay calling png_init_filter_functions() until a row with nonzero
filter is found.
2013-08-20 21:15:31 -05:00
Glenn Randers-Pehrson
52083f9152 [libpng16] Mention png_set_option() in the documentation. 2013-08-17 15:53:32 -05:00
Glenn Randers-Pehrson
7191f6e9e6 [libpng16] Use minus signs, not hyphens, in "--i". 2013-08-13 18:54:34 -05:00
Glenn Randers-Pehrson
4dcbf24d82 [libpng16] Change some hyphens to minus signs and fix other typos in libpng.3 2013-08-06 17:25:02 -05:00
Glenn Randers-Pehrson
492e67163e [libpng16] Exit loop over tRNS array when a transparent entry is
found (performance report by PoChun Chang)
2013-08-04 14:03:44 -05:00
Glenn Randers-Pehrson
5881b11629 [libpng16] Bump version to 1.6.4beta01 2013-07-20 19:41:22 -05:00
Glenn Randers-Pehrson
fca68966b2 [master] Imported from libpng-1.6.3.tar 2013-07-17 19:43:57 -05:00
Glenn Randers-Pehrson
847e9efb66 [libpng16] Imported from libpng-1.6.3.tar 2013-07-17 19:13:23 -05:00
Glenn Randers-Pehrson
db56fa18c2 [libpng16] Revised "/*SAFE*/" comment in pngrutil.c 2013-07-15 10:09:54 -05:00
Glenn Randers-Pehrson
bc8e40d611 [libpng16] Added "/* SAFE */" comments in pngrutil.c and pngrtran.c
where warnings may be erroneously issued by code-checking applications.
Revised manual about changes in iTXt chunk handling made in libpng-1.6.0.
2013-07-15 08:44:53 -05:00
Glenn Randers-Pehrson
2b87a54d07 [libpng16] Updated manual to mention that warnings about iTXt language tag
and translated keyword are no longer issued when these are empty, which
is allowed by the PNG specification.
2013-07-14 18:34:13 -05:00
Glenn Randers-Pehrson
b23afad4a1 [libpng16] Imported from libpng-1.6.3rc01.tar 2013-07-10 19:36:08 -05:00
Glenn Randers-Pehrson
f5d7f438e5 [libpng16] Imported from libpng-1.6.3beta10.tar 2013-07-04 20:19:47 -05:00
John Bowler
b4ec1f8451 [libpng16] Unified pngfix.c source with libpng17. 2013-07-02 23:47:57 -05:00
John Bowler
f5f1206778 [libpng16] Fixed undefined behavior in contrib/tools/pngfix.c and added new
strip option. pngfix relied on undefined behavior and even a simple change from
gcc to g++ caused it to fail.  The new strip option 'unsafe' has been
implemented and is the default if --max is given.  Option names have
been clarified, with --strip=transform now stripping the bKGD chunk,
which was stripped previously with --strip=unused.
Added all documented chunk types to pngpriv.h
2013-07-02 23:18:49 -05:00
John Bowler
497e7319f4 [libpng16] Only compile ARM code when PNG_READ_SUPPORTED is defined. 2013-07-02 22:57:40 -05:00
Glenn Randers-Pehrson
d5dd93f5d1 [libpng16] Updated documentation to show default behavior of benign errors
correctly.
2013-07-02 09:20:36 -05:00
Glenn Randers-Pehrson
7f9a49aa65 [libpng16] Bump version to 1.6.3beta10 2013-06-27 21:22:26 -05:00
Glenn Randers-Pehrson
573c9d434f [libpng16] Change "png-fix-too-far-back" to "pngfix" inside pngfix.c
for error messages, etc.
2013-06-27 21:21:26 -05:00
Glenn Randers-Pehrson
56a1a66656 [libpng16] Imported from libpng-1.6.3beta09.tar 2013-06-27 18:01:30 -05:00
Glenn Randers-Pehrson
d992e05da8 [libpng16] Renamed contrib/tools/png-fix-too-far-back.c to pngfix.c 2013-06-27 13:39:20 -05:00
John Bowler
870beb5279 [libng16] Revised contrib/tools/png-fix-too-far-back.c to check all compressed
chunks known to libpng.
2013-06-27 11:49:26 -05:00
Glenn Randers-Pehrson
b0d97356ce [libpng16] Revised example.c to illustrate use of PNG_DEFAULT_sRGB and
PNG_GAMMA_MAC_18 as parameters for png_set_gamma().
2013-06-25 19:36:15 -05:00
Glenn Randers-Pehrson
04d4e38ac2 [libpng16] Fix spelling of "doclifter" in CHANGES and ANNOUNCE 2013-06-18 15:09:47 -05:00
Glenn Randers-Pehrson
67a46d17d8 [libpng16] Bump version to 1.6.3beta09 2013-06-18 13:28:39 -05:00
Glenn Randers-Pehrson
bbc29a858d [libpng16] Imported from libpng-1.6.3beta08.tar 2013-06-18 13:00:25 -05:00
Glenn Randers-Pehrson
3948b94700 [libpng16] Bump version to 1.6.3beta08 2013-06-08 17:03:37 -05:00
Glenn Randers-Pehrson
746bc7d883 [libpng16] Imported from libpng-1.6.3beta07.tar 2013-06-08 17:03:26 -05:00
John Bowler
f260f6d156 [libpng16] Protect symbol prefixing against CC/CPPFLAGS/CFLAGS useage.
Previous iOS/Xcode fixes for the ARM NEON optimizations moved the test
on __ARM_NEON__ from configure time to compile time.  This breaks symbol
prefixing because the definition of the special png_init_filter_functions
call was hidden at configure time if the relevant compiler arguments are
passed in CFLAGS as opposed to CC.  This change attempts to avoid all
the confusion that would result by declaring the init function even when
it is not used, so that it will always get prefixed.
2013-06-08 13:13:53 -05:00
John Bowler
18dd07e3e6 [libpng16] Removed PNG_FILTER_OPTIMIZATIONS and PNG_ARM_NEON_SUPPORTED from
pnglibconf.h, allowing more of the decisions to be made internally
(pngpriv.h) during the compile.  Without this, symbol prefixing is broken
under certain circumstances on ARM platforms.  Now only the API parts of
the optimizations ('check' vs 'api') are exposed in the public header files
except that the new setting PNG_ARM_NEON_OPT documents how libpng makes the
decision about whether or not to use the optimizations.
2013-06-08 13:07:13 -05:00
Glenn Randers-Pehrson
0486b17fbd [libng16] Neglected to check in pngconf.h with previous commit. 2013-06-06 14:38:54 -05:00
John Bowler
aa22442a9c [libpng16] Make ARM NEON support work at compile time (not just configure time).
This moves the test on __ARM_NEON__ into pngconf.h to avoid issues when
using a compiler that compiles for multiple architectures at one time.
2013-06-06 12:49:53 -05:00
Glenn Randers-Pehrson
4a43182924 [libpng16] Enclose the prototypes for the simplified write API in 2013-06-05 23:41:49 -05:00
Glenn Randers-Pehrson
810b6e51e4 [libpng16] Updated README (removed CompuServ reference, added simplesystems.org) 2013-06-05 16:52:41 -05:00
John Bowler
88610994da [libpng16] Fix compiler warning in png-fix-itxt.c 2013-06-05 12:15:25 -05:00
John Bowler
1b9b970598 [libpng16] Deleted set(CMAKE_BUILD_TYPE) block from CMakeLists.txt 2013-06-05 11:41:44 -05:00
Glenn Randers-Pehrson
43f0311b57 [libpng16] Added set(CMAKE_CONFIGURATION_TYPES ...) to CMakeLists.txt
(Andrew Hundt)
2013-06-05 11:07:01 -05:00
Glenn Randers-Pehrson
421f95deb5 [libpng16] Removed a redundant test in png_set_IHDR(). 2013-06-04 15:05:12 -05:00
Glenn Randers-Pehrson
f96251291d [libpng16] Updated README with current arm, contrib, and projects directory
descriptions
2013-06-03 20:57:45 -05:00
Glenn Randers-Pehrson
cafa0eebb9 [libpng16] Bump version to 1.6.3beta07 2013-05-12 19:10:16 -05:00
Glenn Randers-Pehrson
afd6cecb76 [libpng16] Imported from libpng-1.6.3beta06.tar 2013-05-12 18:36:09 -05:00
Glenn Randers-Pehrson
61dbc4c608 [libpng16] Revised contrib/pngminim/*/makefile to generate pnglibconf.h
with the right zlib headers.
2013-05-09 22:01:06 -05:00
Glenn Randers-Pehrson
bea86bba24 [libpng16] Removed obsolete reference to "pnginflate" from ANNOUNCE 2013-05-09 08:58:08 -05:00
Glenn Randers-Pehrson
7fc85a3f46 [libng16] Fixed typo in png-fix-too-far-back "usage" output 2013-05-09 08:49:42 -05:00
Glenn Randers-Pehrson
bb8d4f76f4 [libpng16] Cleaned up CHANGES and ANNOUNCE files. 2013-05-09 08:48:43 -05:00
Glenn Randers-Pehrson
b79c98e57c [libpng16] Bump version to 1.6.3beta06 2013-05-09 08:03:40 -05:00
Glenn Randers-Pehrson
4cf2465c71 [libpng16] Imported from libpng-1.6.3beta05.tar 2013-05-09 08:03:24 -05:00
Glenn Randers-Pehrson
4ea93e69bc [libpng16] Renamed pnginflate to png-fix-too-far-back in contrib/tools. 2013-05-08 21:57:00 -05:00
Glenn Randers-Pehrson
ff141eb21e [libpng16] Renamed contrib/tools/fixitxt to contrib/tools/png-fix-itxt.
Added information in the documentation about problems with and fixes for
the bad CRC and bad iTXt chunk situations.
2013-05-08 19:46:10 -05:00
John Bowler
122bec17f2 [libpng16]Check ZLIB_VERNUM for mismatches, enclose #error in quotes 2013-05-08 14:35:21 -05:00
John Bowler
9afb90f885 [libpng16] Attempt to detect configuration issues with pngdeflate,
which requires both the correct libpng and the correct zlib to function
correctly.
2013-05-08 14:21:46 -05:00
John Bowler
34b7d62488 [libpng16] Updated Makefile.am 2013-05-08 10:35:14 -05:00
Glenn Randers-Pehrson
3f2b5a6670 libpng16] Updated contrib/pngminus/pnm2png.c (Paul Stewart):
Fixed whitespace handling
Added a call to png_set_packing()
Initialize dimension values so if sscanf fails at least we have known
   invalid values.
2013-05-08 10:09:19 -05:00
John Bowler
294d0b8408 [libpng16] Detect wrong libpng versions linked to pngdeflate, which currently
only works with libpng versions that can be made to reliably fail when
    the deflate data contains an out-of-window reference.  This means only
    1.6 and later.
  Fixed gnu issues: g++ needs a static_cast, gcc 4.4.7 has a broken warning
    message which it is easier to work round than ignore.
2013-05-08 08:56:45 -05:00
Glenn Randers-Pehrson
62c6fbbd29 [libpng16] Check that PNG_MAXIMUM_INFLATE_WINDOW is defined before using it. 2013-05-07 23:16:06 -05:00
John Bowler
0c7ac064d3 [libpng16] Added an option to force maximum window size for inflating.
For inflate, reverted previous fixes.
Added fixitxt and pngdeflate to the built programs and removed warnings
from the source code and timepng that are revealed as a result.  Fixed
fixitxt when the chunk length is more than 65535 (untested, no test case).
2013-05-07 21:59:05 -05:00
Glenn Randers-Pehrson
db67cba8d4 [libpng16] Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
2013-05-07 14:31:35 -05:00
Glenn Randers-Pehrson
2aa6c96e5d [libpng16] Bump version to 1.6.3beta05 2013-05-06 09:55:29 -05:00
Glenn Randers-Pehrson
2fd3434fa4 [libpng16] Imported from libpng-1.6.3beta04.tar 2013-05-06 09:55:18 -05:00
Glenn Randers-Pehrson
2c0833e265 [libpng16] Committed new pnglibconf.dfa and prebuilt. 2013-05-05 22:18:53 -05:00
Glenn Randers-Pehrson
127b08a265 [libpng16] Calculate our own zlib windowBits when decoding rather than
trusting the CMF bytes in the PNG datastream.
2013-05-05 22:13:47 -05:00
Glenn Randers-Pehrson
0f42908c0a [libpng16] Bump version to 1.6.3beta04 2013-04-29 21:31:50 -05:00
Glenn Randers-Pehrson
f18a28cc13 [libpng16] Imported from libpng-1.6.3beta03.tar 2013-04-29 21:31:38 -05:00
Glenn Randers-Pehrson
56d6bc2e88 [libpng16] Avoid dereferencing NULL pointer possibly returned from
png_create_write_struct() (Andrew Church).
2013-04-29 08:57:14 -05:00
Glenn Randers-Pehrson
61946e0f56 [libpng16] Revise man page to demonstrate dealing with unknown chunk
handling in libpng.1.5.x and with bugs in libpng-1.4.x and earlier.
2013-04-28 20:48:37 -05:00
Glenn Randers-Pehrson
49f9c24910 [libpng16] Expanded manual paragraph about writing private chunks, particularly
about the need to call png_set_keep_unknown_chunks() when writing them.
2013-04-27 18:03:03 -05:00
Glenn Randers-Pehrson
c62fda06a3 [libpng16] Bump version to 1.6.3beta03 2013-04-26 08:25:33 -05:00
Glenn Randers-Pehrson
cd62215d61 [libpng16] Imported from libpng-1.6.3beta02.tar 2013-04-26 08:24:19 -05:00
John Bowler
ac09cd0fec [libpng16] Test for 'arm*' not just 'arm' in the host_cpu configure variable.
Rebuilt the configure scripts.
2013-04-25 23:13:08 -05:00
Glenn Randers-Pehrson
529045cf26 [libpng16] Bump version to 1.6.3beta02 2013-04-25 21:37:43 -05:00
Glenn Randers-Pehrson
a4f7ea0d11 [master] Imported from libpng-1.6.2.tar 2013-04-25 11:06:20 -05:00
John Bowler
7b1da52549 [libpng16] Ensure that NEON filter stuff is completely disabled when switched
'off'.  Previously the ARM NEON specific files were still built if the option
was switched 'off' as opposed to being explicitly disabled.
2013-04-25 10:03:42 -05:00
Glenn Randers-Pehrson
34d20f482f [libpng16] Revised stack marking in arm/filter_neon.S and configure.ac. 2013-04-25 09:53:57 -05:00
Glenn Randers-Pehrson
399430dac2 [libpng16] Update "last changed" comments. 2013-04-25 09:52:00 -05:00
Glenn Randers-Pehrson
3f677d1c65 [libpng16] Bump version to 1.6.3beta01 2013-04-25 09:19:04 -05:00
Glenn Randers-Pehrson
809355b4aa [libpng16] Imported from libpng-1.6.2.tar 2013-04-25 07:29:41 -05:00
Glenn Randers-Pehrson
7fd71746d0 [libpng16] Fix confusing CHANGES entry. 2013-04-23 23:16:32 -05:00
Glenn Randers-Pehrson
0ee3465fba [libpng16] Imported from libpng-1.6.2rc06.tar 2013-04-23 22:21:55 -05:00
Glenn Randers-Pehrson
a793120405 [libpng16] Bump version to 1.6.2rc03 2013-04-23 22:03:44 -05:00
Glenn Randers-Pehrson
9bdba4e630 [libpng16] Imported from libpng-1.6.2rc05.tar 2013-04-23 19:45:07 -05:00
John Bowler
a74b70871c [libpng16] Ensure that NEON filter stuff is completely disabled when
switched 'off'.  Previously the ARM NEON specific files were still built
if the option was switched 'off' as opposed to being explicitly disabled.
2013-04-23 18:18:45 -05:00
Glenn Randers-Pehrson
0d50d6562c [libpng16] Imported from libpng-1.6.2rc04.tar 2013-04-22 20:29:18 -05:00
Glenn Randers-Pehrson
453fbf942c [libpng16] Revised stack marking in arm/filter_neon.S 2013-04-22 19:48:05 -05:00
Glenn Randers-Pehrson
6e1c74b39b [libpng16] Imported from libpng-1.6.2rc03.tar 2013-04-22 11:36:05 -05:00
Glenn Randers-Pehrson
fdc2d5f38f [libpng16] Bump version to 1.6.2rc03 2013-04-19 19:05:34 -05:00
Glenn Randers-Pehrson
67a289ffa9 [libpng16] Fixed some spelling/typos 2013-04-19 19:03:34 -05:00
Glenn Randers-Pehrson
bf15ac7e86 [libpng16] Imported from libpng-1.6.2rc02.tar 2013-04-18 07:40:56 -05:00
Glenn Randers-Pehrson
7ef0c46488 [libpng16] Updated "last changed" comments. 2013-04-18 07:25:45 -05:00
Glenn Randers-Pehrson
8d9e494dfb [libpng16] Merged pngtest.c with version 1.7.0beta08 2013-04-18 07:23:59 -05:00
Glenn Randers-Pehrson
0794df4062 [libpng16] Imported from libpng-1.6.2rc01.tar 2013-04-18 06:32:44 -05:00
Glenn Randers-Pehrson
7a69beda7b [libpng16] in fixitxt.c define MAX_LENGTH, largest iTXT chunk that it
can handle.
2013-04-18 05:53:49 -05:00
John Bowler
e4413a735b [libpng16] Disallow storing sRGB information when the sRGB is not supported.
Reverted previous attempt to allow gAMA and sRGB non-support with the
simplified API.
2013-04-17 21:27:47 -05:00
Glenn Randers-Pehrson
7fdb594e73 [libpng16] Added #ifdef PNG_WRITE_sRGB_SUPPORTED, etc., tests where needed in
png_image_write_main() in pngwrite.c (bug report from Yuriy Levchenko).
2013-04-17 11:05:21 -05:00
Glenn Randers-Pehrson
f1736a636b [libpng16] Added contrib/tools/fixitxt.c, to repair the erroneous iTXt
chunk length written by libpng-1.6.0 and 1.6.1.
2013-04-16 23:12:09 -05:00
Glenn Randers-Pehrson
3b4c60f26b [libpng16] Imported from libpng-1.6.2beta02.tar 2013-04-13 21:27:07 -05:00
Glenn Randers-Pehrson
5c55ccdf4f [libpng16] Imported from libpng-1.6.2beta01.tar 2013-04-13 20:55:04 -05:00
Glenn Randers-Pehrson
5ec05b3d7c [libpng16] Removed extra recently-inserted line from pngwutil.c 2013-04-13 20:01:09 -05:00
John Bowler
70eb0720a0 [libpng16] Fixed previous bugfix to work on 64-bit platforms. 2013-04-13 16:52:09 -05:00
Glenn Randers-Pehrson
9bb775fc8c [libpng16] Corrected length written to uncompressed iTXt chunks (Samuli Suominen). 2013-04-13 14:19:25 -05:00
John Bowler
a8715cabd1 [libpng16] Added "{ }" omitted from previous patch to pngtrans.c 2013-04-13 12:25:16 -05:00
Glenn Randers-Pehrson
364acf40aa [libpng16] Corrected a misplaced closing bracket in contrib/libtests/pngvalid.c
(Flavio Medeiros).
2013-04-13 11:55:08 -05:00
John Bowler
b44cd59ad9 [libpng16] Corrected the test on user transform changes on read. It was in the
png_set of the transform function, but that doesn't matter unless the
transform function changes the rowbuf size, and that is only valid if
transform_info is called.
2013-04-12 22:15:54 -05:00
Glenn Randers-Pehrson
e2d8e11407 [libpng16] Updated the GIT URL in the manual. 2013-04-11 18:53:51 -05:00
John Bowler
43c07e1b48 [libpng16] Fixed incorrect warning of excess deflate data. End condition - the
warning would be produced if the end of the deflate stream wasn't read
in the last row.  The warning is harmless.
2013-04-07 21:33:30 -05:00
Glenn Randers-Pehrson
2e0c5f0dff [libpng16] Updated documentation of 1.5.x to 1.6.x changes in iCCP chunk
handling.
2013-03-31 22:55:55 -05:00
Glenn Randers-Pehrson
3a83aa328d [libpng16] Bump version to 1.6.2beta01 2013-03-29 07:11:42 -05:00
Glenn Randers-Pehrson
41db297e63 [master] Imported from libpng-1.6.1.tar 2013-03-27 20:39:36 -05:00
Glenn Randers-Pehrson
5087805e7c [libpng16] Imported from libpng-1.6.1.tar 2013-03-27 20:36:57 -05:00
Glenn Randers-Pehrson
4e6e2166a5 [libpng16] Imported from libpng-1.6.1rc01.tar 2013-03-21 07:38:30 -05:00
Glenn Randers-Pehrson
1affc5622b [libpng16] Bump version to 1.6.1beta10 2013-03-13 07:40:54 -05:00
Glenn Randers-Pehrson
cd1cd2dafc [libpng16] Imported from libpng-1.6.1beta09.tar 2013-03-13 07:40:46 -05:00
John Bowler
caa3f296df [libpng16] Eliminated another warning from the Intel C compiler. 2013-03-10 21:40:27 -05:00
John Bowler
2286a7cef4 [libpng16] Eliminated a warning from the Intel C compiler. The warning is
technically valid, although a reasonable treatment of division would
show it to be incorrect.
2013-03-10 21:35:35 -05:00
Glenn Randers-Pehrson
3c8b422b0a [libpng16] Bump version to 1.6.1beta09 2013-03-07 11:36:55 -06:00
Glenn Randers-Pehrson
0645b62528 [libpng16] Imported from libpng-1.6.1beta08.tar 2013-03-07 11:36:47 -06:00
Claudio Bley
0281dee877 [libpng16] Fixed CMakelists.txt to allow building a single variant of the
library (Claudio Bley):
  Introduced a PNG_LIB_TARGETS variable that lists all activated library
    targets.  It is an error if this variable ends up empty, ie. you have
    to build at least one library variant.
  Made the *_COPY targets only depend on library targets actually being build.
  Use PNG_LIB_TARGETS to unify a code path.
  Changed the CREATE_SYMLINK macro to expact the full path to a file as the
    first argument. When symlinking the filename component of that path is
    determined and used as the link target.
  Use copy_if_different in the CREATE_SYMLINK macro.
2013-03-07 11:17:17 -06:00
Glenn Randers-Pehrson
e55b25a962 [libpng16] Bump version to 1.6.1beta08 2013-03-06 22:42:23 -06:00
Glenn Randers-Pehrson
14638c1f20 [libpng16] Imported from libpng-1.6.1beta07.tar 2013-03-06 22:42:13 -06:00
John Bowler
59ae38984f [libpng16] Corrected simplified API default gamma for color-mapped output, added
a flag to change default. In 1.6.0 when the simplified API was used
to produce color-mapped output from an input image with no gamma
information the gamma assumed for the input could be different from
that assumed for non-color-mapped output.  In particular 16-bit depth
input files were assumed to be sRGB encoded, whereas in the 'direct'
case they were assumed to have linear data.  This was an error.  The
fix makes the simplified API treat all input files the same way and
adds a new flag to the png_image::flags member to allow the
application/user to specify that 16-bit files contain sRGB data
rather than the default linear.
Fixed bugs in the pngpixel and makepng test programs.
2013-03-06 22:15:25 -06:00
Glenn Randers-Pehrson
1f24cb74f2 [libpng16] Update "last changed" dates and fix one comment typo. 2013-03-04 21:58:02 -06:00
Glenn Randers-Pehrson
1cbfa24a93 [libpng16] Bump version to 1.6.1beta07 2013-03-04 17:56:59 -06:00
Glenn Randers-Pehrson
8c87dc88d6 [libpng16] Imported from libpng-1.6.1beta06.tar 2013-03-04 17:56:46 -06:00
John Bowler
f3728100d9 [libpng16] Corrected Android builds and corrected libpng.vers with symbol
prefixing This adds an API to set optimization options externally,
    providing an alternative and general solution for the non-portable
    run-time tests used by the ARM Neon code.  It also makes those tests
    compile and link on Android.
  The order of settings vs options in pnglibconf.h is reversed to allow
    settings to depend on options and options can now set (or override) the
    defaults for settings.
2013-03-04 16:26:31 -06:00
John Bowler
e15b537825 [libpng16] Better documentation of unknown handling API interactions. 2013-03-02 17:59:43 -06:00
Glenn Randers-Pehrson
e57f094fd6 [libpng16] Bump version to 1.6.1beta06 2013-03-02 17:37:23 -06:00
Glenn Randers-Pehrson
4ea113b7f0 [libng16] Reverted recent change that eliminated a warning about storing
an unhandled chunk.
2013-03-02 16:03:45 -06:00
Glenn Randers-Pehrson
871b1d0fab [libpng16] Bump version to 1.6.1beta05 2013-03-02 15:03:15 -06:00
Glenn Randers-Pehrson
f3af706c2a [libpng16] Imported from libpng-1.6.0beta05.tar 2013-03-01 21:38:03 -06:00
Glenn Randers-Pehrson
96cf4bde0e [libpng16] Fixed bug introduced in libpng-1.6.0beta28 that causes libpng to
handle chunks even when they have been tagged PNG_HANDLE_CHUNK_NEVER.
2013-03-01 20:04:06 -06:00
Glenn Randers-Pehrson
1118d6d985 [libpng16] Avoid a possible memory leak in contrib/gregbook/readpng.c 2013-03-01 13:27:05 -06:00
Glenn Randers-Pehrson
e444514a94 [libpng16] Bump version to 1.6.1beta05 2013-02-27 15:11:39 -06:00
Glenn Randers-Pehrson
efda7376c8 [libpng16] Imported from libpng-1.6.1beta04.tar 2013-02-27 15:02:53 -06:00
John Bowler
ccec786ca7 [libpng16] Revised scripts/dfn.awk to work with the buggy MSYS awk that has
trouble with CRLF line endings.
2013-02-27 13:36:08 -06:00
Glenn Randers-Pehrson
2621be1bdb [libpng16] Added info about ordering of png_set_*() calls to the manual. 2013-02-26 08:43:28 -06:00
Glenn Randers-Pehrson
45bb4530fd [libpng16] Revised INSTALL to recommend using CPPFLAGS instead of INCLUDES.
Revised scripts/makefile.freebsd to respect ZLIBDIR and ZLIBINC.
2013-02-22 20:19:49 -06:00
Glenn Randers-Pehrson
a97fc46e43 [libpng16] Bump version to 1.6.1beta04 2013-02-22 17:12:09 -06:00
Glenn Randers-Pehrson
3fa1893804 [libpng16] Imported from libpng-1.6.1beta03.tar 2013-02-22 17:06:01 -06:00
Glenn Randers-Pehrson
f8a8ead5cb [libpng16] Update the INSTALL document. 2013-02-22 16:52:21 -06:00
Glenn Randers-Pehrson
6df55cece7 [libpng16] Updated scripts/pnglibconf.h.prebuilt 2013-02-19 10:11:43 -06:00
John Bowler
09a5ca72ac [libpng16] Allow run-time ARM NEON checking to be disabled. A new configure
option:
    --enable-arm-neon=always will stop the run-time checks. New checks
    within arm/arm_init.c will cause the code not to be compiled unless
    __ARM_NEON__ is set. This should make it fail safe (if someone asks
    for it on then the build will fail if it can't be done.)
Fixed ALIGNED_MEMORY support.
2013-02-18 22:30:35 -06:00
Glenn Randers-Pehrson
0cc3e9e38c [libpng16] Bump version to 1.6.1beta03 2013-02-18 21:25:56 -06:00
Glenn Randers-Pehrson
adb9613699 [libpng16] Imported from libpng-1.6.1beta02.tar 2013-02-18 21:25:47 -06:00
John Bowler
c0a0d4a6d2 [libpng16] Reenabled code to allow zero length PLTE chunks for MNG. 2013-02-18 21:23:17 -06:00
Glenn Randers-Pehrson
2bad851ab3 [libpng16] Updated "png_sizeof" to "sizeof" in the manual. 2013-02-18 15:21:01 -06:00
Glenn Randers-Pehrson
f2350f3987 [libpng16] Revised "#if defined " in arm/arm_init.c 2013-02-18 12:30:30 -06:00
Glenn Randers-Pehrson
b4ef7c4af2 [libpng16] Use parentheses consistently in "#if defined()" tests.
Folded some long lines.
2013-02-17 15:41:36 -06:00
Glenn Randers-Pehrson
9e8fd50d76 [libpng16] Use parentheses consistently in "#if defined()" tests. 2013-02-17 14:31:00 -06:00
Glenn Randers-Pehrson
ea3288f1c5 [libpng16] Fixed double-underscore typo in an #ifdef in png.c 2013-02-16 16:35:22 -06:00
Glenn Randers-Pehrson
cc074dcaa6 [libpng16] Bump version to 1.6.1beta02 2013-02-16 10:48:39 -06:00
Glenn Randers-Pehrson
3b8e7e869d [libpng16] Imported from libpng-1.6.1beta01.tar 2013-02-16 10:48:29 -06:00
John Bowler
765d145ec4 [libpng16] Use approved/supported Android method to check for NEON, use
Linux/POSIX 1003.1 API to check /proc/self/auxv avoiding buffer allocation
and other library calls (ported from libpng15).
2013-02-16 07:43:48 -06:00
John Bowler
c9b11ff0d4 [libpng16] Fixed a race condition in the creation of the build 'scripts'
directory while building with a parallel make.
2013-02-16 07:38:46 -06:00
John Bowler
23a101e06d [libpng16] scripts/pnglibconf.dfa formatting improvements back ported from libpng 1.7. 2013-02-16 00:18:20 -06:00
John Bowler
b724c812ec [libpng16] Enabled parallel tests - back ported from libpng-1.7. 2013-02-16 00:05:59 -06:00
John Bowler
0695fcd834 [libpng16] Removed cc -E workround, corrected png_get_palette_max API Tested on SUN OS cc 5.9,
which demonstrates the tokenization problem previously avoided by using /lib/cpp.
Since all .dfn output is now protected in double quotes unless it is to be macro
substituted the fix should work everywhere.
2013-02-15 23:46:37 -06:00
John Bowler
42835d3d19 [libpng16] Ported libpng 1.5 options.awk/dfn file handling to 1.6, fixed one bug. 2013-02-15 23:40:34 -06:00
John Bowler
2d99978f67 [libpng16] Made sRGB check numbers consistent. 2013-02-15 23:25:18 -06:00
John Bowler
9d2e875826 [libpng16] Made symbol prefixing work with the ARM neon optimizations. Also allow pngpriv.h
to be included for preprocessor definitions only, so it can be used in non-C/C++
files. Back ported from libpng 1.7.
2013-02-15 23:21:42 -06:00
Glenn Randers-Pehrson
0da9cf38cd [master] Imported from libpng-1.6.0.tar 2013-02-13 23:32:06 -06:00
Glenn Randers-Pehrson
681de8c8dc [libpng16] Bump version to 1.6.1beta01 2013-02-13 23:17:52 -06:00
Glenn Randers-Pehrson
c53778ff53 [libpng16] Imported from libpng-1.6.0.tar 2013-02-13 22:53:57 -06:00
Glenn Randers-Pehrson
44db2cfb15 [libpng16] Bump version to 1.6.0rc09 2013-02-10 20:34:23 -06:00
John Bowler
6db8e4dd11 [libpng16] Fixed inconsistencies in png.h and pnglibconf.dfa 2013-02-10 17:49:25 -06:00
Glenn Randers-Pehrson
88c5a2a068 [libpng16] Fixed typo in png.h #ifdef 2013-02-10 16:39:55 -06:00
Glenn Randers-Pehrson
bf9f74b657 [libpng16] Bump version to 1.6.0rc08 2013-02-10 16:20:48 -06:00
Glenn Randers-Pehrson
0d270082d2 [libpng16] Imported from libpng-1.6.0rc07.tar 2013-02-10 16:20:40 -06:00
Glenn Randers-Pehrson
d000fb89c0 [libpng16] Enclosed the new png_get_palette_max
in #ifdef PNG_GET_PALETTE_MAX_SUPPORTED block, and revised pnglibconf.h
and pnglibconf.h.prebuilt accordingly.
2013-02-10 15:46:06 -06:00
Glenn Randers-Pehrson
9fabbedcf3 [libpng16] Bump version to 1.6.0rc07 2013-02-09 07:44:06 -06:00
Glenn Randers-Pehrson
d7dc03e371 [libpng16] Imported from libpng-1.6.0rc06.tar 2013-02-09 07:43:55 -06:00
John Bowler
b8d0534e9d [libpng16] Fixed missing dependency in --prefix builds The intermediate
internal 'prefix.h' file can only be generated correctly after
pnglibconf.h, however the dependency was not in Makefile.am.  The
symptoms are unpredictable depending on the order make chooses to
build pngprefix.h and pnglibconf.h, often the error goes unnoticed
because there is a system pnglibconf.h to use instead.
2013-02-09 07:24:08 -06:00
Glenn Randers-Pehrson
f88ac51a2e [libpng16] Bump version to 1.6.0rc06 2013-02-08 09:13:44 -06:00
Glenn Randers-Pehrson
bbac5e692f [libpng16] Imported from libpng-1.6.0rc05.tar 2013-02-08 09:13:35 -06:00
Glenn Randers-Pehrson
a4081f2990 [libpng16] Updated man page about png_get_palette_max(). 2013-02-08 09:06:08 -06:00
Glenn Randers-Pehrson
1f8e81738a [libpng16] Bump version to 1.6.0rc05 2013-02-06 22:32:13 -06:00
Glenn Randers-Pehrson
9002f5b1f0 [libpng16] Imported from libpng-1.6.0rc04.tar 2013-02-06 22:32:05 -06:00
John Bowler
f5a83fb2b3 [libpng16] Turn serial tests back on (recently turned off by autotools upgrade). 2013-02-06 19:38:42 -06:00
Glenn Randers-Pehrson
154de9398a [libpng16] Bump version to 1.6.0rc04 2013-02-05 12:14:43 -06:00
Glenn Randers-Pehrson
777044a856 [libpng16] Imported from libpng-1.6.0rc03.tar 2013-02-05 10:34:11 -06:00
John Bowler
fe5c8b9755 [libpng16] Fixed palette_max API. 2013-02-05 08:01:09 -06:00
Glenn Randers-Pehrson
8d391c6cea [libpng16] Bump version to 1.6.0rc03 2013-02-04 20:43:27 -06:00
Glenn Randers-Pehrson
32d6a74293 [libpng16] Imported from libpng-1.6.0rc02.tar 2013-02-04 20:12:49 -06:00
Glenn Randers-Pehrson
806477742a [libpng16] Added documentation of the new png_get_palette_max() function. 2013-02-04 19:57:32 -06:00
Glenn Randers-Pehrson
d14caad2e9 [master] Imported from libpng-1.5.14.tar 2013-02-02 17:14:54 -06:00
Glenn Randers-Pehrson
29890b0439 [libpng16] Imported from libpng-1.6.0rc01.tar 2013-01-26 12:13:17 -06:00
Glenn Randers-Pehrson
9f860f59d9 [libpng16] Bump version to 1.6.0beta41 2013-01-20 17:32:13 -06:00
Glenn Randers-Pehrson
f8aa57e791 [libpng16] Imported from libpng-1.6.0beta40.tar 2013-01-20 17:25:00 -06:00
Glenn Randers-Pehrson
4567935fe4 [libpng16] Push two files that weren't updated in previous push. 2013-01-20 00:44:29 -06:00
John Bowler
2414bd99d8 [libpng16] Use consistent handling of overflows in text, sPLT and unknown
png_set_* APIs
2013-01-19 23:18:59 -06:00
Glenn Randers-Pehrson
1f76e62d6c [libpng16] Bump version to 1.6.0beta40 2013-01-19 08:57:40 -06:00
Glenn Randers-Pehrson
e208108dfc [libpng16] Imported from libpng-1.6.0beta39.tar 2013-01-19 08:50:15 -06:00
Glenn Randers-Pehrson
590c8b0987 [libpng16] Added overflow detection in png_set_sPLT() and png_set_text_2(). 2013-01-19 08:49:12 -06:00
Glenn Randers-Pehrson
c5c8b542fb [libpng16] Bump version to 1.6.0beta39 2013-01-17 13:57:58 -06:00
Glenn Randers-Pehrson
91a7ad9d2b [libpng16] Imported from libpng-1.6.0beta38.tar 2013-01-17 13:57:42 -06:00
John Bowler
9dd2bfafe5 [libpng16] Corrected previous attempt at overflow detection in
png_set_unknown_chunks().
2013-01-17 13:24:05 -06:00
Glenn Randers-Pehrson
ba35f1e4c1 [libpng16] Bump version to 1.6.0beta38 2013-01-10 12:21:07 -06:00
Glenn Randers-Pehrson
5851280929 [libpng16] Imported from libpng-1.6.0beta37.tar 2013-01-10 12:20:59 -06:00
John Bowler
1c6e22a360 [libpng16] Fixed conceivable but difficult to repro overflow. Also added
two test programs to generate and test a PNG which should have the problem.
2013-01-10 10:55:34 -06:00
Glenn Randers-Pehrson
37109a9f5b [libpng16] Bump version to 1.6.0beta37 2013-01-01 08:40:25 -06:00
Glenn Randers-Pehrson
a70216aa60 [libpng16] Imported from libpng-1.6.0beta36.tar 2013-01-01 08:40:16 -06:00
Glenn Randers-Pehrson
9477ecdfa6 [libpng16] Updated copyright year to 2013 in newly-changed files 2013-01-01 07:45:42 -06:00
John Bowler
408652acaf [libpng16] Fixed 'make distcheck' on SUN OS - libpng.so was not being removed 2012-12-27 09:56:41 -06:00
Glenn Randers-Pehrson
744f041adf [libpng16] Discontinued distributing libpng-1.x.x.tar.bz2.
Discontinued distributing libpng-1.7.0-1.6.0-diff.txt and similar.
2012-12-23 22:19:43 -06:00
Glenn Randers-Pehrson
86c739e8bc [libpng16] Bump version to 1.6.0beta36 2012-12-22 18:34:22 -06:00
Glenn Randers-Pehrson
00634fdac8 [libpng16] Imported from libpng-1.6.0beta35.tar 2012-12-22 18:34:13 -06:00
Glenn Randers-Pehrson
79ee877fb4 [libpng16] Reformatted latest CHANGES/ANNOUNCE entry to 80 character lines. 2012-12-22 17:13:35 -06:00
John Bowler
e9d616321a [libpng16] Fixed Windows build issues, enabled ARM compilation. Various warnings issued
by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old GCCs.)
ARM support is enabled by default in zlib.props (unsupported by Microsoft) and
ARM compilation is made possible by deleting the check for x86. The test programs
cannot be run because they are not signed.
2012-12-20 22:48:58 -06:00
John Bowler
24639a63ce [libpng16] Made default Zlib compression settings be configurable. This adds #defines to
pnglibconf.h to control the defaults.
2012-12-20 22:26:18 -06:00
Glenn Randers-Pehrson
5362c9d5e5 [libpng16] Bump version to 1.6.0beta35 2012-12-19 16:21:35 -06:00
Glenn Randers-Pehrson
b6bfd40da2 [libpng16] Imported from libpng-1.6.0beta34.tar 2012-12-19 16:12:30 -06:00
Glenn Randers-Pehrson
a1d32d08e1 [libpng16] ANNOUNCE that location of GIT repository at SourceForge has changed. 2012-12-18 21:53:17 -06:00
Glenn Randers-Pehrson
350cbf14df [libpng16] Fixed typo in contrib/pngminim/encoder/README 2012-12-18 14:54:44 -06:00
Glenn Randers-Pehrson
7bde6e23bb [libpng16] Disassembled the version number in scripts/options.awk (necessary
for building on SunOs)
2012-12-18 08:44:26 -06:00
Glenn Randers-Pehrson
5d9dc4563f [libpng16] Fixed whitespace in libpng.3 manpage. 2012-12-17 20:03:08 -06:00
Glenn Randers-Pehrson
aa41547a4d [libpng16] Updated manual about functions deprecated in libpng-1.6.x 2012-12-16 16:53:54 -06:00
Glenn Randers-Pehrson
8c3d4f387a [libpng16] Bump version to 1.6.0beta34 2012-12-15 08:43:12 -06:00
Glenn Randers-Pehrson
6e265d137c [libpng16] Note in CHANGES that configure files were rebuilt with autoconf-2.69 2012-12-15 08:29:41 -06:00
Glenn Randers-Pehrson
7b26920d9b [libpng16] Imported from libpng-1.6.0beta33.tar 2012-12-15 07:58:38 -06:00
John Bowler
785a8b1505 [libpng16] Fixed cases of unquoted DESTDIR in Makefile.am 2012-12-15 07:57:31 -06:00
John Bowler
6cf32b460f [libpng16] Rearranged the ARM-NEON optimizations: Isolated the machine specific
code to the hardware subdirectory and added comments to pngrutil.c so that
implementors of other optimizations know what to do.
2012-12-15 07:55:54 -06:00
John Bowler
f758d6c813 [libpng16] Rearranged the ARM-NEON optimizations: Isolated the machine specific
code to the hardware subdirectory and added comments to pngrutil.c so that
implementors of other optimizations know what to do.
2012-12-13 11:26:50 -06:00
Glenn Randers-Pehrson
c2ac10b502 [master] Imported from libpng-1.5.13.tar 2012-09-27 18:59:32 -05:00
Glenn Randers-Pehrson
c86cf4b7e4 [master] Imported from libpng-1.5.12.tar 2012-07-12 13:13:01 -05:00
Glenn Randers-Pehrson
981560ae60 [master] Imported from libpng-1.5.11.tar 2012-06-14 12:53:06 -05:00
Glenn Randers-Pehrson
d5a80e0944 [master] Imported from libpng-1.5.10.tar 2012-03-29 06:35:58 -05:00
Glenn Randers-Pehrson
5a13159bfc [master] Imported from libpng-1.5.10rc01.tar 2012-03-19 18:16:05 -05:00
Glenn Randers-Pehrson
ae1b45a046 [master] Imported from libpng-1.5.10beta04.tar 2012-03-10 07:08:54 -06:00
Glenn Randers-Pehrson
187694b9ec [master] Imported from libpng-1.5.10beta03.tar 2012-03-06 12:26:33 -06:00
Glenn Randers-Pehrson
3484a760f4 [master] Bump version to 1.5.10beta01 2012-02-22 09:06:29 -06:00
Glenn Randers-Pehrson
715423c8d6 Merge branch 'libpng15'
Conflicts:
	ANNOUNCE
	CHANGES
	CMakeLists.txt
	INSTALL
	LICENSE
	Makefile.am
	Makefile.in
	README
	TODO
	aclocal.m4
	config.guess
	config.h.in
	config.sub
	configure
	configure.ac
	contrib/gregbook/COPYING
	contrib/gregbook/Makefile.sgi
	contrib/gregbook/Makefile.unx
	contrib/gregbook/README
	contrib/gregbook/readpng2.c
	contrib/gregbook/rpng-x.c
	contrib/gregbook/rpng2-win.c
	contrib/gregbook/rpng2-x.c
	contrib/pngminim/decoder/README
	contrib/pngminim/decoder/makefile
	contrib/pngminim/decoder/pngusr.h
	contrib/pngminim/encoder/README
	contrib/pngminim/encoder/makefile
	contrib/pngminim/encoder/pngusr.h
	contrib/pngminim/preader/README
	contrib/pngminim/preader/makefile
	contrib/pngminim/preader/pngusr.h
	contrib/pngminus/makefile.std
	contrib/pngsuite/README
	contrib/visupng/PngFile.c
	contrib/visupng/PngFile.h
	contrib/visupng/VisualPng.c
	depcomp
	example.c
	install-sh
	libpng-1.4.9beta01.txt
	libpng-manual.txt
	libpng.3
	libpng.txt
	libpngpf.3
	ltmain.sh
	png.5
	png.c
	png.h
	pngconf.h
	pngerror.c
	pngget.c
	pngmem.c
	pngpread.c
	pngpriv.h
	pngread.c
	pngrio.c
	pngrtran.c
	pngrutil.c
	pngset.c
	pngtest.c
	pngtest.png
	pngtrans.c
	pngwio.c
	pngwrite.c
	pngwtran.c
	pngwutil.c
	projects/visualc6/README.txt
	projects/visualc6/libpng.dsp
	projects/visualc6/pngtest.dsp
	projects/visualc71/README.txt
	projects/visualc71/libpng.sln
	projects/visualc71/libpng.vcproj
	projects/visualc71/pngtest.vcproj
	projects/visualc71/zlib.vcproj
	projects/vstudio/libpng/libpng.vcxproj
	projects/vstudio/pngtest/pngtest.vcxproj
	projects/vstudio/readme.txt
	projects/vstudio/vstudio.sln
	projects/vstudio/zlib.props
	projects/vstudio/zlib/zlib.vcxproj
	scripts/README.txt
	scripts/descrip.mms
	scripts/libpng-config-head.in
	scripts/libpng.pc.in
	scripts/makefile.32sunu
	scripts/makefile.64sunu
	scripts/makefile.aix
	scripts/makefile.amiga
	scripts/makefile.bc32
	scripts/makefile.beos
	scripts/makefile.bor
	scripts/makefile.cegcc
	scripts/makefile.cygwin
	scripts/makefile.darwin
	scripts/makefile.dec
	scripts/makefile.dj2
	scripts/makefile.elf
	scripts/makefile.freebsd
	scripts/makefile.gcc
	scripts/makefile.hp64
	scripts/makefile.hpgcc
	scripts/makefile.hpux
	scripts/makefile.ibmc
	scripts/makefile.intel
	scripts/makefile.knr
	scripts/makefile.linux
	scripts/makefile.mingw
	scripts/makefile.mips
	scripts/makefile.msc
	scripts/makefile.ne12bsd
	scripts/makefile.netbsd
	scripts/makefile.openbsd
	scripts/makefile.os2
	scripts/makefile.sco
	scripts/makefile.sggcc
	scripts/makefile.sgi
	scripts/makefile.so9
	scripts/makefile.solaris
	scripts/makefile.solaris-x86
	scripts/makefile.std
	scripts/makefile.sunos
	scripts/makefile.tc3
	scripts/makefile.vcwin32
	scripts/makefile.watcom
	scripts/makevms.com
	scripts/png32ce.def
	scripts/pngos2.def
2012-02-22 09:01:10 -06:00
Glenn Randers-Pehrson
d57dc304c4 [libpng15] Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code 2012-02-22 08:29:19 -06:00
Glenn Randers-Pehrson
8a2033d77f [libpng15] Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
now that png_ptr->buffer is inaccessible to applications, the special
handling is no longer useful.

Fixed bug with png_handle_hIST with odd chunk length (Frank Busse).
2012-02-21 14:22:01 -06:00
Glenn Randers-Pehrson
932d7ac5e9 [libpng15]
Always put the CMAKE_LIBRARY in "lib" (removed special WIN32 case).

  Removed empty vstudio/pngstest directory (Clifford Yapp).
2012-02-21 14:19:52 -06:00
Glenn Randers-Pehrson
f9accb9df2 [libpng15] Bump version to 1.5.10beta01 2012-02-18 23:33:18 -06:00
Glenn Randers-Pehrson
7a4e497b62 [libpng15] Imported from libpng-1.5.9.tar 2012-02-18 23:32:59 -06:00
Glenn Randers-Pehrson
0207529f27 [libpng15] Imported from libpng-1.5.9rc01.tar 2012-02-18 23:32:49 -06:00
Glenn Randers-Pehrson
a08f60352c [libpng15] Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED
from pngstruct.h
2012-02-11 07:27:34 -06:00
Glenn Randers-Pehrson
0bddb27e75 [libpng15] Removed unused macro definition from pngread.c 2012-02-11 07:26:03 -06:00
Glenn Randers-Pehrson
a67ddd4b9f [libpng15] Removed two unused definitions from scripts/pnglibconf.h.prebuilt 2012-02-06 09:10:06 -06:00
Glenn Randers-Pehrson
a7e9d7bfc2 Merge branch 'libpng15' of ssh://libpng.git.sourceforge.net/gitroot/libpng/libpng into libpng15 2012-02-03 16:01:32 -06:00
Glenn Randers-Pehrson
28c3a2f9f9 [libpng15] Imported from libpng-1.5.9beta01.tar 2012-02-03 15:59:42 -06:00
Glenn Randers-Pehrson
df0773c1b9 [libpng15] Rebuilt configure scripts with automake-1.11.2 2012-02-03 15:56:22 -06:00
Glenn Randers-Pehrson
902dbe619e Merge branch 'libpng15' of ssh://libpng.git.sourceforge.net/gitroot/libpng/libpng into libpng15
Conflicts:
	ANNOUNCE
2012-01-31 23:22:09 -06:00
Glenn Randers-Pehrson
0f59bbb5b6 [libpng15] Imported from libpng-1.5.8.tar 2012-01-31 23:12:47 -06:00
Glenn Randers-Pehrson
9ca5f1bdc8 [libpng15] Added missing date to final CHANGES entry. 2012-01-25 16:31:13 -06:00
Glenn Randers-Pehrson
9f01d0d665 [libpng15] Imported from libpng-1.5.8rc02.tar 2012-01-25 16:11:54 -06:00
Glenn Randers-Pehrson
da544d7d3e [libpng15] Conditionalize install rules for MINGW and CYGWIN in CMakeLists.txt 2012-01-25 16:08:04 -06:00
Glenn Randers-Pehrson
ea8d0b9408 [libpng15] Imported from libpng-1.5.8beta01.tar 2012-01-14 20:59:14 -06:00
Glenn Randers-Pehrson
9287447cef [libpng15] Updated some "last changed" dates 2011-12-21 09:03:30 -06:00
Glenn Randers-Pehrson
d35a3a826e [libpng15] Removed '#include config.h"' from contrib/libtests/pngvalid.c.
It's not needed and causes trouble for VPATH building.
2011-12-16 14:19:39 -06:00
Glenn Randers-Pehrson
e23fedc9de Merge branch 'libpng15' of ssh://libpng.git.sourceforge.net/gitroot/libpng/libpng into libpng15 2011-12-15 09:54:00 -06:00
Glenn Randers-Pehrson
cd3f5bb507 [libpng15] Imported from libpng-1.5.7.tar 2011-12-15 09:50:23 -06:00
Glenn Randers-Pehrson
b0270a9e47 Merge branch 'libpng15' of ssh://libpng.git.sourceforge.net/gitroot/libpng/libpng into libpng15 2011-12-08 08:50:29 -06:00
Glenn Randers-Pehrson
52cbf46f30 [libpng15] Imported from libpng-1.5.7rc03.tar 2011-12-08 08:44:15 -06:00
John Bowler
d61b42c81d [libpng15] Updated CMakeLists.txt to account for the relocation of pngvalid.c 2011-12-07 20:35:48 -06:00
Glenn Randers-Pehrson
8fd9c16642 Merge branch 'libpng15' of ssh://www.simplesystems.org/git/libpng into libpng15
Conflicts:
	ANNOUNCE
	CHANGES
2011-12-04 19:31:52 -06:00
Glenn Randers-Pehrson
e22ea758e4 [libpng15] Imported from libpng-1.5.7rc02.tar 2011-12-04 19:29:29 -06:00
Glenn Randers-Pehrson
f22c0ac2a5 [libpng15] Put CRLF line endings in the owatcom project files. 2011-12-03 20:16:12 -06:00
Glenn Randers-Pehrson
4f547b7177 [libpng15] Fixed incorrect character count in projects/owatcom/pngvalid.tgt 2011-12-02 20:14:21 -06:00
Glenn Randers-Pehrson
c4fe32016c [libpng15] Revised pngconf.h to use " __declspec(restrict)" if MSC_VER >= 1400,
as in libpng-1.5.4.
2011-12-01 21:32:15 -06:00
Glenn Randers-Pehrson
1be5c22e5c [libpng15] Bump version to libpng-1.5.7rc02 2011-12-01 19:27:35 -06:00
Glenn Randers-Pehrson
956c0599e6 [libpng15] Revised project files and contrib/pngvalid/pngvalid.c to account for
the relocation of pngvalid into contrib/libtests.
2011-12-01 19:25:46 -06:00
Glenn Randers-Pehrson
97c8fbb949 Merge branch 'libpng15' of ssh://www.simplesystems.org/git/libpng into libpng15 2011-12-01 09:08:30 -06:00
Glenn Randers-Pehrson
a50ce74850 [libpng15] Imported from libpng-1.5.7rc01.tar 2011-12-01 09:06:22 -06:00
Glenn Randers-Pehrson
8973ee17bb [libpng15] Fixed two other instances of "#if PNG_DO_BC" in png.c 2011-11-28 11:05:54 -06:00
Glenn Randers-Pehrson
2e31b96a5a [libpng15] Revised #if PNG_DO_BC block in png.c (use #ifdef and add #else) 2011-11-28 10:51:29 -06:00
Glenn Randers-Pehrson
0222124801 [libpng15] Replaced an "#if" with "ifdef" in pngrtran.c 2011-11-28 10:31:42 -06:00
Glenn Randers-Pehrson
61b23d59b1 [libpng15] Bump version to libpng-1.5.7beta06 2011-11-25 07:02:48 -06:00
Glenn Randers-Pehrson
cc1fa5df3a [libpng15] Imported from libpng-1.5.7beta05.tar 2011-11-25 06:56:01 -06:00
Glenn Randers-Pehrson
cc5664ddad [libpng15] Updated release number in png.h 2011-11-24 14:36:49 -06:00
Glenn Randers-Pehrson
e209df47c4 Relocate pngvalid.c to contrib/libtests 2011-11-24 12:24:45 -06:00
John Bowler
585f8b49b5 [libpng15] Removed some leftover "simple interface" files 2011-11-23 15:45:11 -06:00
John Bowler
4491fa237f [libpng15] Remove simplified interface 2011-11-23 15:41:29 -06:00
Glenn Randers-Pehrson
59d3ef11ed [libpng14] Fixed typo in Makefile.am ("-M Wl" should be "-M -Wl")." 2011-10-05 17:06:15 -05:00
Glenn Randers-Pehrson
6bc7fc80da [master] Added SunOS support to configure.ac and Makefile.am
but configure and Makefile.in were not updated.
2011-09-01 20:01:51 -05:00
Glenn Randers-Pehrson
5b03469a93 [master] Minor editing of libpng.3 and libpng-*.txt 2011-07-13 09:37:01 -05:00
Glenn Randers-Pehrson
f5b9abde98 [master] Reverted non-portable GNU syntax in makefile (?=, +=) 2011-07-12 06:22:29 -05:00
Glenn Randers-Pehrson
340c9b237b [master] Updated contrib/pngminus/makefile.std 2011-07-11 17:36:18 -05:00
Glenn Randers-Pehrson
fb2bd00859 [master] Bump version to libpng-1.4.9beta01 2011-07-08 13:13:00 -05:00
Glenn Randers-Pehrson
5109688803 [master] Added vstudio/* and CMakeLists to EXTRA_DIST in Makefile.in
and Makefile.am
2011-07-08 13:09:41 -05:00
Glenn Randers-Pehrson
8fdd2fcef6 [master] Changed some incorrect "last changed" dates. 2011-07-07 12:46:23 -05:00
Glenn Randers-Pehrson
e7625063dc [master] Imported from libpng-1.4.8.tar 2011-07-07 06:41:17 -05:00
Glenn Randers-Pehrson
24f40e321c [master] Imported from libpng-1.4.8rc01.tar 2011-06-30 19:58:41 -05:00
Glenn Randers-Pehrson
0bb898a885 [master] Imported from libpng-1.4.8beta05.tar 2011-06-19 07:22:01 -05:00
Glenn Randers-Pehrson
61a2d8a2a7 [master] Check for sCAL chunk too short. 2011-06-18 14:51:09 -05:00
John Bowler
af96543688 [devel] Removed double increment of pointers in the accurate scaling. 2011-06-18 13:25:46 -05:00
Glenn Randers-Pehrson
34f5449736 [master] Imported from libpng-1.4.8beta05.tar 2011-06-18 00:39:53 -05:00
John Bowler
484a48e221 [master] Fixed error in "ACCURATE" 16-to-8 scaling. 2011-06-17 21:36:09 -05:00
Glenn Randers-Pehrson
cc5226bf2a [master] Imported from libpng-1.4.8beta05.tar 2011-06-07 19:53:23 -05:00
Glenn Randers-Pehrson
8fbb563f4e [master] Imported from libpng-1.4.8beta04.tar 2011-06-07 14:59:33 -05:00
Glenn Randers-Pehrson
65e6d5a34f [master] Fixed 1-byte uninitialized memory reference in png_format_buffer()
(Bug report by Frank Busse, related to CVE-2004-0421).
2011-06-07 14:58:07 -05:00
Glenn Randers-Pehrson
47be2e7c3a [master] Imported from libpng-1.4.8beta04.tar 2011-06-06 00:02:11 -05:00
Glenn Randers-Pehrson
4d694dadd8 [master] Issue warning instead of error for out of range coefficients
for rgb_to_gray transform
2011-06-05 23:44:05 -05:00
Glenn Randers-Pehrson
59397f985e [master] Imported from libpng-1.4.8beta03.tar 2011-06-05 23:27:22 -05:00
Glenn Randers-Pehrson
cc1d4d0dbc [master] Check for integer overflow in png_set_rgb_to_gray(). 2011-06-05 23:26:14 -05:00
Glenn Randers-Pehrson
070434c045 [master] Imported from libpng-1.4.8beta02.tar 2011-06-05 17:21:29 -05:00
Glenn Randers-Pehrson
0dc882d7c3 [master] Ported bugfix in pngrtran.c from 1.5.3: Ensure coefficients are OK for
png_rgb_to_gray_fixed().
2011-06-05 17:19:17 -05:00
Glenn Randers-Pehrson
c3ac9a507a [master] Bump to version bumpify-1.4.8rc01 2011-06-03 21:36:28 -05:00
Glenn Randers-Pehrson
a6afebc718 [master] Imported from libpng-1.4.8beta01.tar 2011-06-03 21:21:15 -05:00
Glenn Randers-Pehrson
d41915dc2a [master] Port change to pngrtran.c from 1.5.3: when expanding a paletted image,
always expand to RGBA if transparency is present.
2011-06-03 21:17:49 -05:00
Glenn Randers-Pehrson
5a5ad7a5fa [master] Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
before IDAT.
2011-06-03 21:16:45 -05:00
Glenn Randers-Pehrson
9dad5e37ae [master] Pass "" instead of '\0' to png_default_error() in png_err().
This mistake was introduced in libpng-1.2.20beta01.
2011-06-03 21:14:55 -05:00
Glenn Randers-Pehrson
adde7b5c1e [master] Fix typo in pngwutil.c comment 2011-05-23 06:29:49 -05:00
Glenn Randers-Pehrson
3bdde42e40 [master] Copied png_debug macros from pngpriv.h into pngtest.c and removed
"#include pngpriv.h" from pngtest.c, to avoid setting a bad example.
2011-05-02 14:11:10 -05:00
Glenn Randers-Pehrson
6b4dee12f5 [master] Hard-coded the name of libpng-version.txt in Makefile.am, .in 2011-05-02 12:38:48 -05:00
Glenn Randers-Pehrson
355b90387b [master] Undef "_ALL_SOURCE" for AIX, to prevent "jmpbuf" from being redefined. 2011-05-02 12:29:20 -05:00
Glenn Randers-Pehrson
f512ca7625 [master] Bump to version 1.4.8beta01 2011-05-02 12:23:29 -05:00
Glenn Randers-Pehrson
16ee3e9870 [master] Imported from libpng-1.4.7.tar 2011-04-10 06:44:29 -05:00
Glenn Randers-Pehrson
c8444775b1 [devel] Disabled PNG_PEDANTIC_WARNINGS for all MSC versions as in libpng-1.4.5. 2011-04-10 06:43:27 -05:00
Glenn Randers-Pehrson
784d80b509 [master] Imported from libpng-1.4.7rc01.tar 2011-04-08 20:54:20 -05:00
Glenn Randers-Pehrson
98aacb16c3 [master] Relocated new misplaced declarations in pngwutil.c 2011-04-08 20:41:48 -05:00
Glenn Randers-Pehrson
8a35e25852 [master] Imported from libpng-1.4.6.tar 2011-04-08 12:03:08 -05:00
Glenn Randers-Pehrson
97eb073189 [master] Imported from libpng-1.4.6rc02.tar 2011-04-06 07:09:52 -05:00
Glenn Randers-Pehrson
28534bd47a [master] Improved the optimization of the zlib CMF byte
(see libpng-1.2.6beta03).
2011-04-06 07:07:42 -05:00
Glenn Randers-Pehrson
2053a26873 [master] Updated vstudio/zlib.props to zlib-1.2.5 2011-04-04 15:41:32 -05:00
Glenn Randers-Pehrson
736a230890 [master] Bump to version 1.4.6rc02 2011-04-03 11:36:05 -05:00
Glenn Randers-Pehrson
3926448598 [devel] Fixed a typo in the manual about dithering 2011-04-03 11:34:40 -05:00
Glenn Randers-Pehrson
11130874d4 [master] Imported from libpng-1.4.6rc01.tar 2011-03-31 13:46:06 -05:00
Glenn Randers-Pehrson
ef5a57119a [master] Imported from libpng-1.4.6beta07.tar 2011-03-22 06:31:58 -05:00
Glenn Randers-Pehrson
31f4e52842 [master] Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT()
fail to compile when PNG_NO_POINTER_INDEXING is defined.
2011-03-21 18:20:24 -05:00
Glenn Randers-Pehrson
0e1aad158a [master] Removed "strip" from contrib/pngminim/*/makefile. 2011-03-19 22:37:30 -05:00
Glenn Randers-Pehrson
5f5d6d637b [master] Fixed incorrect examples of callback prototypes in the manual,
that were introduced in libpng-1.0.0.
2011-03-19 09:30:41 -05:00
Glenn Randers-Pehrson
a2336bcf05 [master] Bump to version 1.4.6beta07 2011-03-19 09:11:21 -05:00
Glenn Randers-Pehrson
20e6003290 [master] Added a request in the manual that applications do not use "png_" or
"PNG_" to begin any of their own symbols.
Fixed mistake in the descriptions of user read_transform and write_transform
function prototypes in the manual.  The row_info struct is png_row_infop.
2011-03-19 09:08:45 -05:00
Glenn Randers-Pehrson
54c633b810 [master] Added -D_CRT_SECURE_NO_DEPRECATE to CFLAGS in makefile.vcwin32 2011-03-19 08:58:33 -05:00
Glenn Randers-Pehrson
f0c2cc32b1 [master] Added attribute definition (warnings) for MSC_VER >= 1300 in pngconf.h 2011-03-19 08:48:07 -05:00
Glenn Randers-Pehrson
8709982e22 [master] Bump to version 1.4.6beta06 2011-03-18 22:25:49 -05:00
Glenn Randers-Pehrson
686d45dcfd [master] Imported from libpng-1.4.6beta06.tar 2011-03-18 22:22:18 -05:00
Glenn Randers-Pehrson
8502e1ff25 [master] Moved the definition of the new PNG_USED macro into pngconf.h
It really belongs in pngpriv.h and will be moved there in libpng-1.5.x
2011-03-14 12:49:20 -05:00
Glenn Randers-Pehrson
603c9fd959 [master] Added the private PNG_UNUSED() macro definition in pngpriv.h. 2011-03-08 11:33:28 -06:00
Glenn Randers-Pehrson
86946fdc03 [master] Updated contrib/pngsuite/README to add the word "modify". 2011-03-08 11:28:35 -06:00
Glenn Randers-Pehrson
af4c99b21a [master] Bump to version 1.4.6beta06 2011-01-22 21:49:52 -06:00
Glenn Randers-Pehrson
97d2d68428 [master] Imported from libpng-1.4.6beta05.tar 2011-01-22 21:22:48 -06:00
Glenn Randers-Pehrson
ce5d7cb7aa [master] Updated the synopses in the manual to reflect recent changes.
Fixed a typo in the *.def files and deleted entries that are now
declared in pngpriv.h
2011-01-22 21:10:03 -06:00
Glenn Randers-Pehrson
c4ff4e7167 [master] Imported from libpng-1.4.6beta04.tar 2011-01-21 22:20:15 -06:00
Glenn Randers-Pehrson
b94d24eb25 [master] Changed argument of png_get_io_ptr() back to png_struct
because we promised not to change its signature, so it can be used
safely in configure scripts to detect libpng.
2011-01-21 22:17:18 -06:00
Glenn Randers-Pehrson
379d0160ea [master] Added const_png_structp and const_png_infop types, and used them in
prototypes for most png_get_*() functions.
In the manual, describe the png_get_IHDR() arguments in the correct order.
2011-01-21 11:09:07 -06:00
Glenn Randers-Pehrson
23c2ea38a6 [master] Bump to version 1.4.6beta04 2011-01-15 12:05:31 -06:00
Glenn Randers-Pehrson
d486eb18c5 [master] Updated documentation of png_set|get_tRNS() and png_set|get_iCCP(). 2011-01-15 11:15:38 -06:00
Glenn Randers-Pehrson
a10d488a32 [master] Imported from libpng-1.4.6beta03.tar 2011-01-14 21:04:40 -06:00
Glenn Randers-Pehrson
25d754e86d [master] Bump to version 1.4.6beta02 2011-01-14 20:26:03 -06:00
Glenn Randers-Pehrson
bba85637d7 [master] Imported from libpng-1.4.6beta02.tar 2011-01-14 17:26:54 -06:00
Glenn Randers-Pehrson
94c3a45f4c [master] Updated CMakeLists.txt (Clifford Yapp) 2011-01-14 17:25:06 -06:00
Glenn Randers-Pehrson
221be3def1 [master] Fixed misspelled macros in contrib/pngminim (Cosmin) 2010-12-31 09:05:59 -06:00
Glenn Randers-Pehrson
1daf8980dd [master] Bump to version 1.4.6beta02 2010-12-31 09:04:02 -06:00
Glenn Randers-Pehrson
5945408a93 [master] Imported from libpng-1.4.6beta01.tar 2010-12-31 08:06:37 -06:00
Glenn Randers-Pehrson
9a8c568e3c [master] Fixed bug in background transformation handling in pngrtran.c
(it was looking for the flag in png_ptr->transformations instead of in
png_ptr->flags).
2010-12-28 21:45:08 -06:00
Glenn Randers-Pehrson
fb05477e11 [master] Bump version to 1.4.6beta01 2010-12-27 09:04:59 -06:00
Glenn Randers-Pehrson
df68ef4d5e [master] Imported from libpng-1.4.5.tar 2010-12-09 07:49:40 -06:00
Glenn Randers-Pehrson
d857ed275e [master] Reverted removal of PNG_NO_WRITE_gAMA 2010-12-09 07:42:25 -06:00
Glenn Randers-Pehrson
14181b7f48 [master] Removed PNG_NO_WRITE_gAMA from pngminim/encoder/pngusr.h, again. 2010-12-09 07:27:49 -06:00
Glenn Randers-Pehrson
6916ec5fa9 [master] Bump to version 1.4.5rc04 2010-12-09 07:12:52 -06:00
Glenn Randers-Pehrson
acb4822f6b [master] Removed PNG_NO_WRITE_GAMMA from pngminim/encoder/pngusr.h
and some cosmetic changes to some source files.
2010-12-09 06:43:24 -06:00
Glenn Randers-Pehrson
79fb836d66 [master] Imported from libpng-1.4.5rc03.tar 2010-12-03 10:02:23 -06:00
Glenn Randers-Pehrson
010110a0be [master] Imported from libpng-1.4.5rc02.tar 2010-12-02 07:05:34 -06:00
Glenn Randers-Pehrson
756f873a25 [master] Added comment about the potential API incompatibility in
png.h, libpng.3, and libpng-*.txt.
2010-11-25 07:38:30 -06:00
Glenn Randers-Pehrson
e2d740ae04 [master] Reverted png_get_uint_16 macro to beta05 and added a
comment about the potential API incompatibility.
2010-11-24 15:08:39 -06:00
Glenn Randers-Pehrson
ff244b6181 [master] Bump to version 1.4.5beta07 2010-11-24 15:04:15 -06:00
Glenn Randers-Pehrson
d3494d172c [master] Imported from libpng-1.4.5beta06.tar 2010-11-21 15:05:12 -06:00
Glenn Randers-Pehrson
2922c07e67 [master] Changes to remove gcc warnings (John Bowler) 2010-11-21 14:02:16 -06:00
Glenn Randers-Pehrson
c03a949a0d [master] Make the "png_get_uint_16" macro return a png_uint_32 in libpng-1.4
for API compatibility.
2010-11-21 13:31:52 -06:00
Glenn Randers-Pehrson
377e3ca5e6 [master] Added a comment about the parentheses in pngrutil.c 2010-11-20 22:56:49 -06:00
Glenn Randers-Pehrson
f320728911 [master] Restored the parentheses in pngrutil.c; they are needed when the
png_get_*int_*() functions are compiled (i.e., when PNG_USE_READ_MACROS
is not defined).
2010-11-20 21:41:51 -06:00
Glenn Randers-Pehrson
b4a5d88e0a [master] Updated png_get_uint_32 like the others (i -> val). 2010-11-20 18:01:52 -06:00
Glenn Randers-Pehrson
7ea0b3b9e2 [master] Bump to version 1.4.5rc02 2010-11-20 18:01:01 -06:00
Glenn Randers-Pehrson
aa3725c860 [master] Fixed spelling in ANNOUNCE and CHANGES 2010-11-20 17:38:14 -06:00
Glenn Randers-Pehrson
8aa84c7fce [master] Imported from libpng-1.4.5beta05.tar 2010-11-20 17:15:36 -06:00
Glenn Randers-Pehrson
453ceae85f [master] Fixed atomicity of chunk header serialization (Cosmin)
and added test for io_state in pngtest.c (Cosmin)
2010-11-20 16:13:12 -06:00
Glenn Randers-Pehrson
1f5a0b9fa6 [master] Moved reading of file signature into png_read_sig (Cosmin) 2010-11-20 15:50:51 -06:00
Glenn Randers-Pehrson
820a8d1de9 [master] Changed prototypes for png_git_int_16() and png_get_int_32(). 2010-11-20 15:07:51 -06:00
Glenn Randers-Pehrson
6bb02b28a1 [master] Revised png_get_int_32 and png_get_int_16 functions. 2010-11-20 15:00:35 -06:00
Glenn Randers-Pehrson
60ba227d57 [master] Removed some extraneous parentheses that appeared in pngrutil.c of
libpng-1.4.3bet01
2010-11-20 14:47:36 -06:00
Glenn Randers-Pehrson
175e21f5e1 [master] Imported from libpng-1.4.5rc01.tar 2010-11-18 22:11:18 -06:00
Glenn Randers-Pehrson
97db6709e4 [master] Imported from libpng-1.4.5beta04.tar 2010-11-08 12:44:03 -06:00
Glenn Randers-Pehrson
c0fc0dfc45 [master] Check for out-of-range text compression mode in png_set_text(). 2010-10-13 07:34:30 -05:00
Glenn Randers-Pehrson
f3eadd1737 [master] Bump to version 1.4.5beta04 2010-10-13 07:13:45 -05:00
Glenn Randers-Pehrson
c4ec48281c [master] Imported from libpng-1.4.5beta03.tar 2010-10-07 20:52:27 -05:00
Glenn Randers-Pehrson
1a006390d9 [master] Wrapped long lines in CMakeLists.txt
and introduced ${libpng_public_hdrs}
2010-10-05 08:36:49 -05:00
Glenn Randers-Pehrson
953f265513 [master] Bump to version 1.4.5beta03 2010-10-04 23:16:06 -05:00
Glenn Randers-Pehrson
468877578a [master] Imported from libpng-1.4.5beta02.tar 2010-10-04 23:15:57 -05:00
Glenn Randers-Pehrson
ff14eeb4f2 [master] Revised CHANGES about the last bugfix. 2010-10-04 22:18:50 -05:00
Glenn Randers-Pehrson
5f3eabf4cd [master] Fixed problem with symbols creation in Makefile.ac (Martin Banky). 2010-10-04 21:51:57 -05:00
Glenn Randers-Pehrson
bbc70d2471 [master] Reverted configure scripts to autoconf-2.65 2010-10-04 17:00:31 -05:00
Glenn Randers-Pehrson
a0cafa3d0b [master] Bump to version 1.4.5beta02 2010-09-25 06:38:06 -05:00
Glenn Randers-Pehrson
58219ca22f [master] Imported from libpng-1.4.5beta01.tar 2010-09-25 06:35:14 -05:00
Glenn Randers-Pehrson
50b28f3bf2 [master] Rebuilt configure scripts with autoconf-2.68 instead of autoconf-2.65 2010-09-24 15:22:09 -05:00
Glenn Randers-Pehrson
0f8345abf7 [master] Bump to version 1.4.5beta01 2010-09-24 10:22:16 -05:00
Glenn Randers-Pehrson
4f213e08aa [master] Fixed configure.ac bug introduced in version 1.4.4rc05. 2010-09-24 09:51:01 -05:00
Glenn Randers-Pehrson
8493de3cee [master] Imported from libpng-1.4.4.tar 2010-09-23 07:22:01 -05:00
Glenn Randers-Pehrson
fee6e7428f [master] Imported from libpng-1.4.4rc05.tar 2010-09-20 10:21:28 -05:00
Glenn Randers-Pehrson
d10616d364 [master] Imported from libpng-1.4.4rc04.tar 2010-09-16 09:51:06 -05:00
Glenn Randers-Pehrson
85d143a273 [master] Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE,
$AUTOHEADER, $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
2010-09-15 06:44:47 -05:00
Glenn Randers-Pehrson
6e72bc46d3 [master] Fixed indentation and removed debugging message from CMakeLists.txt 2010-09-15 06:43:23 -05:00
Glenn Randers-Pehrson
b8eed1d830 [master] Imported from libpng-1.4.4rc03.tar 2010-09-13 20:58:20 -05:00
Glenn Randers-Pehrson
a64ecdfa5b [master] Eliminated another deprecated reference to png_ptr->io_ptr
in pngtest.c
2010-09-13 10:19:20 -05:00
Glenn Randers-Pehrson
bcfc0ce5f6 [master] Removed an extraneous close-double-quote from CMakeLists.txt 2010-09-13 09:57:13 -05:00
Glenn Randers-Pehrson
8bc0719dde [master] Imported from libpng-1.4.4rc02.tar 2010-09-13 08:14:27 -05:00
Glenn Randers-Pehrson
185cd6c058 [master] Revised CMakeLists.txt (Philip Lowman). 2010-09-13 08:13:09 -05:00
Glenn Randers-Pehrson
afb77541b4 [master] Bump to version 1.4.4rc02 2010-09-13 08:11:54 -05:00
Glenn Randers-Pehrson
c4a5c2de26 [master] Imported from libpng-1.4.4rc01.tar 2010-09-10 08:50:36 -05:00
Glenn Randers-Pehrson
87bc4b08ff [master] Imported from libpng-1.4.4beta08.tar 2010-09-02 06:54:37 -05:00
Glenn Randers-Pehrson
65cdb3dfa8 [master] Updated the xcode project to work with libpng-1.4.x and added iOS
targets for simulator and device (Philippe Hausler).
2010-09-02 06:41:40 -05:00
Glenn Randers-Pehrson
cc411ae004 [master] Bump to version 1.4.4beta08 2010-08-26 08:50:32 -05:00
Glenn Randers-Pehrson
f521b99b09 [master] Imported from libpng-1.4.4beta07.tar 2010-08-26 08:46:53 -05:00
Glenn Randers-Pehrson
b08f330d62 [master] Eliminated new unnecessary #if tests regarding the sCAL chunk
from pngrutil.c
2010-08-24 12:38:36 -05:00
Glenn Randers-Pehrson
41ffb1c950 [master] Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c 2010-08-23 16:54:35 -05:00
Glenn Randers-Pehrson
ebe3ea3204 [master] Restored the documentation of PNG_USER_PRIVATEBUILD in pngconf.h 2010-08-23 06:46:18 -05:00
Glenn Randers-Pehrson
d94c4516c6 [master] Corrected handling and documentation of PNG_USER_PRIVATEBUILD flag. 2010-08-22 12:36:25 -05:00
Glenn Randers-Pehrson
b0f8d9bb97 [master] Changed PNG_LIB_NAME from pngNN to libpngNN in CMakeLists.txt
(Philip Lowman)
2010-08-21 18:55:08 -05:00
Glenn Randers-Pehrson
04dfe7b3f6 [master] Revised CMakeLists.txt to make symlinks instead of copies
when installing.
2010-08-21 18:49:50 -05:00
Glenn Randers-Pehrson
547afcfc74 [master] Revised CMakeLists.txt to put the man pages in share/man/man*
not in man/man*
2010-08-21 18:36:29 -05:00
Glenn Randers-Pehrson
48afdb4eef [master] Update CMakelists.txt to use CMAKE_INSTALL_LIBDIR variable;
useful for installing libpng in /usr/lib64 (FundaWang).
2010-08-21 18:29:47 -05:00
Glenn Randers-Pehrson
9ee96e3ba9 [master] Updated prebuilt aclocal.m4 and ltmain.sh 2010-08-17 13:36:20 -05:00
Glenn Randers-Pehrson
0311f5412e [master] Add .dll.a to symlinks installed by Makefile.am (Yaakov) 2010-08-13 08:14:13 -05:00
Glenn Randers-Pehrson
e734eba51e [master] Bump to version 1.4.4beta07 2010-08-13 07:56:59 -05:00
Glenn Randers-Pehrson
7ed40716cb [master] Imported from libpng-1.4.4beta06.tar 2010-08-11 09:10:35 -05:00
Glenn Randers-Pehrson
155889b318 [master] Revised contrib/gregbook to work under cygwin/mingw. 2010-08-11 06:50:11 -05:00
Glenn Randers-Pehrson
4dd011f6d0 [master] Don't try to use version-script with cygwin/mingw. 2010-08-11 06:48:37 -05:00
Glenn Randers-Pehrson
e45a5d3a32 [master] Bump to version 1.4.4beta06 2010-08-06 06:43:59 -05:00
Glenn Randers-Pehrson
80a1050237 [master] Bump to version 1.4.4beta05 2010-08-06 06:40:31 -05:00
Glenn Randers-Pehrson
54592bba4d [master] Don't depend only _WINDOWS_ in pngconf.h to detect Windows 2010-08-06 06:36:56 -05:00
Glenn Randers-Pehrson
902d4d109a [master] Correct use of _WINDOWS_ in pngconf.h 2010-08-03 21:10:04 -05:00
Glenn Randers-Pehrson
d8daacf157 [master] Removed unused png_mem_* defines from pngconf.h. 2010-08-03 20:47:46 -05:00
Glenn Randers-Pehrson
0da5bcb414 [master] Imported from libpng-1.4.4beta05.tar 2010-08-03 20:46:46 -05:00
Glenn Randers-Pehrson
ac6555fa3c [master] Updated projects/visualc71 so it can find scripts/pnglibconf.h 2010-08-03 08:53:13 -05:00
Glenn Randers-Pehrson
2af7ef63c3 [master] Updated the read macros and functions from 1.5.0beta38. 2010-07-31 16:37:38 -05:00
Glenn Randers-Pehrson
6da5b35fca [master] Bump to version 1.4.4beta04 2010-07-24 18:20:21 -05:00
Glenn Randers-Pehrson
abd68eb92b [master] Imported from libpng-1.4.4beta03.tar 2010-07-24 18:16:54 -05:00
Glenn Randers-Pehrson
bf451ffc9a [master] Eliminated the new special case typedef of png_longjmp_ptr for WATCOM
and made a special case "#define PNGAPI" in pngconf.h instead.
2010-07-24 18:13:55 -05:00
Glenn Randers-Pehrson
be734f5592 [master] Removed reference to cbuilder5/* from Makefile.in and Makefile.am 2010-07-24 15:31:38 -05:00
Glenn Randers-Pehrson
9f0c080847 [master] Bump to version 1.4.4beta03 2010-07-24 08:34:34 -05:00
Glenn Randers-Pehrson
3a1ba773b0 [master] Imported from libpng-1.4.4beta02.tar 2010-07-24 08:30:30 -05:00
Glenn Randers-Pehrson
849a1ab845 [master] Added a special case typedef of png_longjmp_ptr for WATCOM. 2010-07-24 08:02:03 -05:00
Glenn Randers-Pehrson
940de5ab02 [master] Moved the definition of png_snprintf()
outside of the enclosing #ifdef blocks in pngconf.h
2010-07-24 07:56:36 -05:00
Glenn Randers-Pehrson
dd9578f379 [master] Update copyright year in documentation 2010-07-22 07:55:00 -05:00
Glenn Randers-Pehrson
0ce807691b [master] Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2 2010-07-16 21:17:50 -05:00
Glenn Randers-Pehrson
4f8ea5eede [master] Bump to version 1.4.4beta02 2010-07-12 06:41:34 -05:00
Glenn Randers-Pehrson
7869e676af [master] Imported from libpng-1.4.4beta01.tar 2010-07-12 06:37:08 -05:00
Glenn Randers-Pehrson
af0a726689 [master] Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
Put #ifndef PNG_EXTERN, #endif around the define PNG_EXTERN in pngpriv.h
2010-07-12 06:22:55 -05:00
Glenn Randers-Pehrson
8d9263fca6 [master] Added some "(" that were missing in README and scripts/README.txt 2010-06-30 23:11:34 -05:00
Glenn Randers-Pehrson
d6a0cbaade [master] Removed some newly-added TAB characters from pngpread.c
and pngrtran.c, and fixed some indentation in pngpread.c and pngrutil.c
2010-06-30 23:07:02 -05:00
Glenn Randers-Pehrson
2302a4d04f [master] Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5 2010-06-27 13:53:25 -05:00
Glenn Randers-Pehrson
8f9a2d08ea [master] Bump version to libpng-1.4.4beta01 2010-06-25 22:18:15 -05:00
Glenn Randers-Pehrson
30c73195b5 [master] Tag the recent releases 2010-06-25 20:44:31 -05:00
Glenn Randers-Pehrson
097485195c [master] Imported from libpng-1.4.3.tar 2010-06-25 20:22:08 -05:00
Glenn Randers-Pehrson
c5f6fa110a [master] Imported from libpng-1.4.3rc03.tar 2010-06-25 20:20:16 -05:00
Glenn Randers-Pehrson
90cfcecc09 [master] Imported from libpng-1.4.3rc02.tar 2010-06-25 20:20:14 -05:00
Glenn Randers-Pehrson
dee0e2ed0f [master] Imported from libpng-1.4.3rc01.tar 2010-06-25 20:20:12 -05:00
Glenn Randers-Pehrson
5ad9884ff1 [master] Imported from libpng-1.4.3beta05.tar 2010-06-25 20:20:09 -05:00
Glenn Randers-Pehrson
188eb6b426 [master] Imported from libpng-1.4.3beta04.tar 2010-06-25 20:20:07 -05:00
Glenn Randers-Pehrson
8361f64dbf [master] Imported from libpng-1.4.3beta02.tar 2010-06-25 20:20:04 -05:00
Glenn Randers-Pehrson
2a6227941e [master] Imported from libpng-1.4.3beta01.tar 2010-06-25 20:20:02 -05:00
Glenn Randers-Pehrson
a582b8f840 [master] Imported from libpng-1.4.3.tar 2010-06-25 20:19:59 -05:00
Glenn Randers-Pehrson
5316f66005 [master] The "vstudio" project was missing from the .zip and .7z distributions 2010-05-17 08:31:53 -05:00
Glenn Randers-Pehrson
f86905457a [master] Added missing quotation marks in the aix block of configure.ac 2010-05-14 15:40:31 -05:00
Glenn Randers-Pehrson
abb211c4e8 [master] Bump to version 1.4.3beta01 2010-05-14 15:38:51 -05:00
Glenn Randers-Pehrson
bb56c39d16 [master] Imported from libpng-1.4.2.tar 2010-05-06 06:48:47 -05:00
Glenn Randers-Pehrson
77237196c7 [master] Imported from libpng-1.4.2rc06.tar 2010-05-04 09:34:13 -05:00
Glenn Randers-Pehrson
a310a3b398 [master] Moved declarations of umsg[] inside the proper #ifdef blocks
in pngrutil.c
2010-05-04 09:32:02 -05:00
Glenn Randers-Pehrson
e0f6c7d90b [master] Revert to version 1.4.2rc05 2010-05-04 09:24:32 -05:00
Glenn Randers-Pehrson
a1587302aa [master] Use bitwise AND instead of integer arithmetic MOD in pngrutil.c
calculation  of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
2010-05-03 21:57:13 -05:00
Glenn Randers-Pehrson
cc0bff446b [master] Changed a typecast in pngrutil.c to stifle compiler warning
in the calculation of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
2010-05-03 21:28:50 -05:00
Glenn Randers-Pehrson
9b8ddff5b7 [master] Added a typecast in pngrutil.c to stifle compiler warning
in the calculation of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
2010-05-03 15:19:11 -05:00
Glenn Randers-Pehrson
ac4942e26b [master] Moved declarations of umsg[] inside proper #ifdef blocks in pngrutil.c 2010-05-03 15:18:09 -05:00
Glenn Randers-Pehrson
2c55e3e917 [master] Bump to version 1.4.2rc06 2010-04-29 11:47:15 -05:00
Glenn Randers-Pehrson
db082802c6 [master] Bump to version 1.4.2rc05 2010-04-29 11:44:55 -05:00
Glenn Randers-Pehrson
b367fb5ac6 [master] Bump to version 1.4.2rc06 2010-04-29 11:20:42 -05:00
Glenn Randers-Pehrson
e9ab2f8d94 [master] Imported from libpng-1.4.2rc05.tar 2010-04-29 11:08:01 -05:00
Glenn Randers-Pehrson
a845cca037 [master] Corrected protection of png_get_user_transform_ptr.
The API declaration in
png.h is removed if both READ and WRITE USER_TRANSFORM are turned off
but was left defined in pngtrans.c
2010-04-29 10:43:23 -05:00
Glenn Randers-Pehrson
3ab6ef0aa1 [master] Corrected PNG_UNKNOWN_CHUNKS_SUPPORTED in gregbook/readpng2.c
to PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2010-04-29 10:34:18 -05:00
Glenn Randers-Pehrson
198ed18b9e [master] Bump to version 1.4.2rc05 2010-04-29 09:41:01 -05:00
Glenn Randers-Pehrson
9110473f93 [master] Removed dummy_inflate.c and uncompr.c from contrib/pngminim/encoder 2010-04-29 09:38:05 -05:00
Glenn Randers-Pehrson
97313e0aab [master] Include png_reset_zstream() in png.c only when PNG_READ_SUPPORTED
is defined.
2010-04-29 09:22:01 -05:00
Glenn Randers-Pehrson
8876e74e43 [master] Remove mislocated files from projects/visualc6 2010-04-26 23:02:39 -05:00
Glenn Randers-Pehrson
510227e39e [master] Imported from libpng-1.4.2rc04.tar 2010-04-26 22:51:30 -05:00
Glenn Randers-Pehrson
7a1f214166 [master] Set PNG_NO_READ_BGR, PNG_NO_IO_STATE, and PNG_NO_TIME_RFC1123 in
contrib/pngminim/decoder/pngusr.h to make a smaller decoder application.
2010-04-26 22:41:53 -05:00
Glenn Randers-Pehrson
5913dd10f1 [master] Added the "vstudio" project to replace "visualc6" and "visualc71"
which will be removed from libpng-1.5.0.
2010-04-26 16:28:35 -05:00
Glenn Randers-Pehrson
087ebd80da [master] Imported from libpng-1.4.2rc03.tar 2010-04-24 13:58:16 -05:00
Glenn Randers-Pehrson
bc9267e3a6 [master] Move png_set_quantize and png_do_quantize to proper locations in docs. 2010-04-16 10:41:02 -05:00
Glenn Randers-Pehrson
a019c335c9 [master] Bump to version 1.4.2rc03 2010-04-16 10:25:20 -05:00
Glenn Randers-Pehrson
ed49c8c1b6 [master] Trivial revision of documentation. 2010-04-16 10:04:53 -05:00
Glenn Randers-Pehrson
2a243fc074 [master] Added some "(long)" typecasts to printf calls in png_handle_cHRM(). 2010-04-16 09:41:27 -05:00
Glenn Randers-Pehrson
47045ce402 [master] Bump to version 1.4.2rc02 2010-04-16 07:45:21 -05:00
Glenn Randers-Pehrson
d6e67586bf [master] Imported from libpng-1.4.2rc02.tar 2010-04-16 07:28:21 -05:00
Glenn Randers-Pehrson
6e9783bd25 [master] Updated the scripts/*.def lists to include png_set_quantize() 2010-04-16 07:26:01 -05:00
Glenn Randers-Pehrson
8dc3729522 [master] Reenabled png_set_dither() but renamed it to png_set_quantize() to
reflect more accurately what it actually does.  At the same time, renamed
the PNG_DITHER_[RED,GREEN_BLUE]_BITS macros to
PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS.
2010-04-16 07:24:52 -05:00
Glenn Randers-Pehrson
7aad4e7fb4 [master] Expanded CHANGES entry about disabling dithering support. 2010-04-13 22:31:25 -05:00
Glenn Randers-Pehrson
930af7d50b [master] Documented the fact that png_set_dither() is no longer supported. 2010-04-13 22:08:21 -05:00
Glenn Randers-Pehrson
0f544f62d6 [master] Imported from libpng-1.4.2rc01.tar 2010-04-10 06:43:07 -05:00
Glenn Randers-Pehrson
398c212955 [master] Bump to version 1.4.2beta02 2010-04-01 07:52:00 -05:00
Glenn Randers-Pehrson
2ec1fc60c3 [master] Imported from libpng-1.4.2beta01.tar 2010-04-01 07:41:11 -05:00
Glenn Randers-Pehrson
c01ee053b1 [master] Imported from libpng-1.4.1.tar 2010-02-25 05:45:01 -06:00
Glenn Randers-Pehrson
b0baee5e36 [master] Removed unused gzio.c from contrib/pngminim gather and makefile
scripts.  This is necessary when libz is updated to version 1.2.4.
2010-02-21 23:12:32 -06:00
Glenn Randers-Pehrson
b55295cb12 [master] Imported from libpng-1.4.1rc04.tar 2010-02-19 19:23:47 -06:00
Glenn Randers-Pehrson
5928ee97ca [master] Define _ALL_SOURCE in configure.ac, makefile.aix, and CMakeLists.txt
when using the AIX compiler.
2010-02-19 19:22:08 -06:00
Glenn Randers-Pehrson
2445ad4331 [master] Imported from libpng-1.4.1rc03.tar 2010-02-19 15:09:07 -06:00
Glenn Randers-Pehrson
93d6d9d835 [master] Define _ALLSOURCE in pngconf.h when building with nonANSI AIX compiler.
otherwise AIX reserves "jmpbuf" and renames it to "__jmpbuf".
2010-02-19 15:02:46 -06:00
Glenn Randers-Pehrson
d207e6a6ad [master] Removed obsolete unused MMX-querying support from contrib/gregbook 2010-02-19 07:52:06 -06:00
Glenn Randers-Pehrson
df6f3f404a [master] Noted in scripts/makefile.mingw that it expects to be run under MSYS. 2010-02-18 23:04:25 -06:00
Glenn Randers-Pehrson
357c1c8c53 [master] Imported from libpng-1.4.1rc02.tar 2010-02-18 07:07:19 -06:00
Glenn Randers-Pehrson
44827ccad8 [master] Fixed typo in ANNOUNCE and CHANGES. 2010-02-14 07:43:22 -06:00
Glenn Randers-Pehrson
0d1a2dd7a9 [master] Bump to version 1.4.1beta13 2010-02-14 07:42:15 -06:00
Glenn Randers-Pehrson
471c9b47fe [master] Imported from libpng-1.4.1beta12.tar 2010-02-14 07:05:57 -06:00
Glenn Randers-Pehrson
23b9a2fda0 [master] Fixed incorrect typecast of png_get_user_malloc_max() in pngget.c 2010-02-14 06:48:09 -06:00
Glenn Randers-Pehrson
7d6103ad6c [master] Imported from libpng-1.4.1beta11.tar 2010-02-12 21:33:07 -06:00
Glenn Randers-Pehrson
ec39f8f8d7 [master] Update announcements about png_decompress_chunk(). 2010-02-12 21:25:37 -06:00
Glenn Randers-Pehrson
a2cde53c87 [master] 2010-02-12 21:07:14 -06:00
Glenn Randers-Pehrson
13714e87f2 [master] Imported from libpng-1.4.1beta10.tar 2010-02-08 15:58:31 -06:00
Glenn Randers-Pehrson
9101d75316 [master] Return allocated "old_buffer" in png_push_save_buffer()
before calling png_error(), to avoid a potential memory leak.
2010-02-08 15:56:17 -06:00
Glenn Randers-Pehrson
233edbf415 [master] Imported from libpng-1.4.1beta09.tar 2010-02-07 23:05:33 -06:00
Glenn Randers-Pehrson
bd209f75fa [master] Reverted to original png_push_save_buffer() code. 2010-02-07 23:02:42 -06:00
Glenn Randers-Pehrson
27854a478e [master] Fixed incorrect test in new png_push_save_buffer() code. 2010-02-07 20:02:02 -06:00
Glenn Randers-Pehrson
f12a87a96c [master] Imported from libpng-1.4.1beta08.tar 2010-02-06 19:48:53 -06:00
Glenn Randers-Pehrson
cb4358ddbb [master] Revert to version 1.4.1beta07 2010-02-06 13:48:45 -06:00
Glenn Randers-Pehrson
c4819d78ba [master] Fix scripting typo in pngwrite.c 2010-02-06 13:44:20 -06:00
Glenn Randers-Pehrson
0b721cd4c4 [master] Bump to version libpng-1.4.1beta08 2010-02-06 13:03:51 -06:00
Glenn Randers-Pehrson
b025757328 [master] Bump to version libpng-1.4.1beta07 2010-02-06 12:17:51 -06:00
Glenn Randers-Pehrson
4bd73b6947 [master] Revised png_push_save_buffer() to do fewer but larger png_mallocs
Eliminated use of png_ptr->irowbytes and reused the slot in png_ptr as
png_ptr->png_user_chunk_malloc_max.
2010-02-06 12:15:07 -06:00
Glenn Randers-Pehrson
f3c42680db [master] Fixed an incorrect #ifdef in pngwrite.c 2010-02-06 10:44:22 -06:00
Glenn Randers-Pehrson
c10066205d [master] Fixed indentation in some png.h comments. 2010-02-05 17:31:42 -06:00
Glenn Randers-Pehrson
21b7aaa428 [master] Imported from libpng-1.4.1beta07.tar 2010-02-05 16:30:38 -06:00
Glenn Randers-Pehrson
d7225fdfce [master] Folded some long lines in png.h
Most of them were too long because of recent insertion of PNG_DEPSTRUCT.
2010-02-05 15:35:41 -06:00
Glenn Randers-Pehrson
deb870c77d [master] Added defineable PNG_USER_CHUNK_CACHE_MAX and PNG_USER_CHUNK_MALLOC_MAX 2010-02-05 15:32:42 -06:00
Glenn Randers-Pehrson
c05538959b [master] Revised documentation to mention the change in
the prototype for the user malloc_fn().
2010-02-02 06:47:13 -06:00
Glenn Randers-Pehrson
f6c761dda1 [master] Imported from libpng-1.4.1beta06.tar 2010-01-28 07:22:50 -06:00
Glenn Randers-Pehrson
877b08d6d2 [master] Implement two-pass png_decompress_chunk() function
suggested by John Bowler.  Does not waste memory, does only one malloc()
to the measured decompressed size.
2010-01-28 07:16:15 -06:00
Glenn Randers-Pehrson
a69064328b [master] Undo recent pngtest changes
The problem was with a buggy compiler (gcc-4.0.1) not a libpng problem
and not worth attempting to work around.
2010-01-27 07:05:02 -06:00
Glenn Randers-Pehrson
01b9566e50 [master] Use int copies instead of longs in pngtest.c
to try to appease the Mac compiler
2010-01-26 23:27:21 -06:00
Glenn Randers-Pehrson
ca3a100be6 [master] Revised pngtest.c for the sake of an optimizing compiler 2010-01-26 22:45:58 -06:00
Glenn Randers-Pehrson
1655e4ddb0 [master] Imported from libpng-1.4.1beta05.tar 2010-01-26 06:56:04 -06:00
Glenn Randers-Pehrson
526f839764 [master] Relocated "int k" declaration in pngtest.c
to work around a compiler optimization bug.
2010-01-26 06:51:00 -06:00
Glenn Randers-Pehrson
1a86bd2a09 [master] Revised png_decompress_chunk() to improve speed and memory
usage when decoding large chunks.
2010-01-22 22:50:46 -06:00
Glenn Randers-Pehrson
610e7b5bd6 [master] Added png_set|get_chunk_malloc_max() functions. 2010-01-22 19:48:40 -06:00
Glenn Randers-Pehrson
86f6c04d84 [master] Imported from libpng-1.4.1beta04.tar 2010-01-22 19:34:44 -06:00
Glenn Randers-Pehrson
fb3a1da4bb [master] Bump to version 1.4.1beta04 2010-01-22 19:29:47 -06:00
Glenn Randers-Pehrson
525efcbb7b [master] Imported from libpng-1.4.1rc01.tar 2010-01-16 08:05:12 -06:00
Glenn Randers-Pehrson
ea4340e1ec [master] Imported from libpng-1.4.1beta03.tar 2010-01-10 16:53:46 -06:00
Glenn Randers-Pehrson
91f3864fbd [master] Removed png_set_premultiply_alpha() from scripts/*.def
Implementation of this function was postponed.
2010-01-10 16:51:01 -06:00
Glenn Randers-Pehrson
14fa704caf [master] Imported from libpng-1.4.1beta02.tar 2010-01-09 13:13:30 -06:00
Glenn Randers-Pehrson
ad1f8180a5 [master] Updated makefiles to link to libpng14.so.14.1 2010-01-07 23:28:16 -06:00
Glenn Randers-Pehrson
e364f899af [master] Imported from libpng-1.4.1beta01.tar 2010-01-07 22:39:45 -06:00
Glenn Randers-Pehrson
40683870ea [master] Update PNG_LIBPNG_VER_NUM to 1.4.1 2010-01-07 22:27:30 -06:00
Glenn Randers-Pehrson
7569d7c069 [master] Updated documentation about png_set_compression_buffer_size(). 2010-01-07 11:37:53 -06:00
Glenn Randers-Pehrson
c87ddbb3ce [master] Make png_set|get_compression_buffer_size() available even
when PNG_WRITE_SUPPORTED is not enabled.  There was no good reason
for this restriction, and PNG readers can gain a speed benefit in
reading large iCCP chunks by increasing png_ptr->zbuf_size via
these functions.
2010-01-07 11:10:16 -06:00
Glenn Randers-Pehrson
793fedcf57 [master] Revise makefile.linux to build libpng.so.14.1 2010-01-07 11:00:07 -06:00
Glenn Randers-Pehrson
74fd86a69e [master] Updated copyright year in revised makefiles. 2010-01-07 08:19:31 -06:00
Glenn Randers-Pehrson
f234091207 [master] Restored "; \" that was lost from makefiles in the previous change 2010-01-07 08:14:16 -06:00
Glenn Randers-Pehrson
772b72139a [master] Revised the makefiles to install the same files and symbolic
links as configure, except for libpng.la and libpng14.la.
2010-01-06 23:11:53 -06:00
Glenn Randers-Pehrson
6e6a844baf [master] Revise scripts/makefile.linux to not make libpng.so.NN 2010-01-06 22:30:32 -06:00
Glenn Randers-Pehrson
2f2f80273b [master] Undid recent change to the Makefiles.
People don't need libpng.so.NN
2010-01-06 17:39:57 -06:00
Glenn Randers-Pehrson
353d8860ac [master] Revised scripts/makefile.linux to make the same files as configure,
except for libpng.la and libpng14.la.  Many other scripts to be fixed soon.
2010-01-06 14:45:03 -06:00
Glenn Randers-Pehrson
fab96cb72a [master] Revised Makefile.am and Makefile.in to make libpng.so.14,
libpng.sl.14, and libpng.14.dylib links in the installed library directory.
2010-01-06 14:16:49 -06:00
Glenn Randers-Pehrson
2203e41900 [master] Revised Makefile.am and Makefile.in to remove references to Y2KINFO,
KNOWNBUG, and libpng.la (Robert Schwebel).
2010-01-04 06:26:41 -06:00
Glenn Randers-Pehrson
e16f2bc5f7 [master] Updated CMakeLists.txt for consistent indentation and to avoid an
unclosed if-statement warning (Philip Lowman).
2010-01-04 06:25:28 -06:00
Glenn Randers-Pehrson
2381cf3269 [master] Bump to version 1.4.1beta01 2010-01-03 17:02:38 -06:00
Glenn Randers-Pehrson
7e3a82cd9c [master] Imported from libpng-1.4.0.tar 2010-01-02 23:15:33 -06:00
Glenn Randers-Pehrson
115817d118 [master] Imported from libpng-1.2.42.tar 2010-01-02 23:15:22 -06:00
Glenn Randers-Pehrson
5cfea4fc98 [master] Imported from libpng-1.2.42rc05.tar 2010-01-01 18:29:51 -06:00
Glenn Randers-Pehrson
a87c870f99 [master] Avoid deprecated references to png_ptr-io_ptr and png_ptr->error_ptr
in pngtest.c
2010-01-01 18:28:50 -06:00
Glenn Randers-Pehrson
b9d671326b [master] Imported from libpng-1.2.42rc04.tar 2010-01-01 10:50:04 -06:00
Glenn Randers-Pehrson
8e4e070151 [master] Updated copyright year to 2010 and made some trivial cosmetic changes 2010-01-01 10:48:33 -06:00
Glenn Randers-Pehrson
4607e1386f [master] Imported from libpng-1.2.42rc03.tar 2009-12-25 14:23:21 -06:00
Glenn Randers-Pehrson
9686172872 [master] Swapped PNG_UNKNOWN_CHUNKS_SUPPORTED and PNG_HANDLE_AS_UNKNOWN_SUPPORTED
in pngset.c to be consistent with other changes in version 1.2.38.
2009-12-25 14:22:08 -06:00
Glenn Randers-Pehrson
8563ac1664 [master] Bump to version 1.2.42rc03 2009-12-25 14:20:39 -06:00
Glenn Randers-Pehrson
9a80a35f4b [master] Imported from libpng-1.2.42rc02.tar 2009-12-23 07:43:15 -06:00
Glenn Randers-Pehrson
4cde19b0c9 [master] Renamed libpng-pc.in back to libpng.pc.in and revised CMakeLists.txt
(revising changes made in 1.2.41beta17 and 1.2.41rc01)
2009-12-22 08:09:39 -06:00
Glenn Randers-Pehrson
230e8b436f [master] Bump to version libpng-1.2.42rc02 2009-12-22 08:07:11 -06:00
Glenn Randers-Pehrson
dbb86efac3 [master] Imported from libpng-1.2.42rc01.tar 2009-12-17 05:53:39 -06:00
Glenn Randers-Pehrson
e8d28e1b1c [master] Bump to version 1.2.42rc01 2009-12-13 07:37:24 -06:00
Glenn Randers-Pehrson
a3a5d0d1f4 [master] Imported from libpng-1.2.42beta02.tar 2009-12-11 17:58:22 -06:00
Glenn Randers-Pehrson
4cf1ca4338 [master] Relocated png_do_chop() to its original position in pngrtran.c
The change in version 1.2.41beta08 caused transparency to be handled wrong
in some 16-bit datastreams (Yusaku Sugai).
2009-12-11 07:29:18 -06:00
Glenn Randers-Pehrson
f174f27096 [master] Removed leftover "-DPNG_CONFIGURE_LIBPNG"
from contrib/pngminim/*/makefile
2009-12-11 07:26:31 -06:00
Glenn Randers-Pehrson
1a15762c59 [master] Bump to version 1.2.42beta02 2009-12-11 07:21:54 -06:00
Glenn Randers-Pehrson
fec6a4ca4e [master] Removed leftover "-DPNG_CONFIGURE_LIBPNG" from scripts/makefile.darwin 2009-12-04 08:26:21 -06:00
Glenn Randers-Pehrson
bcc878bb81 [master] Imported from libpng-1.2.42beta01.tar 2009-12-04 07:16:38 -06:00
Glenn Randers-Pehrson
df61a00acc [master] Revised scripts/makefile.netbsd, makefile.openbsd, and makefile.sco
to put png.h and pngconf.h in $prefix/include, like the other scripts,
    instead of in $prefix/include/libpng.
2009-12-04 06:54:36 -06:00
Glenn Randers-Pehrson
878fea5403 [master] Removed "#define PNG_NO_ERROR_NUMBERS" that was inadvertently added
to pngconf.h in version 1.2.41.
2009-12-04 06:03:57 -06:00
Glenn Randers-Pehrson
804cc98cd1 [master] Bump to version 1.2.42beta01 2009-12-04 06:03:15 -06:00
Glenn Randers-Pehrson
6e00020a9f [master] Imported from libpng-1.2.41.tar 2009-12-02 19:48:27 -06:00
Glenn Randers-Pehrson
2aac9a1fa3 [master] Brought README up to date. 2009-11-27 15:48:31 -06:00
Glenn Randers-Pehrson
5aa8676122 [master] Bump to version 1.2.41rc04 2009-11-27 15:47:49 -06:00
Glenn Randers-Pehrson
ea88d94dcf [master] Imported from libpng-1.2.41rc03.tar 2009-11-25 16:00:51 -06:00
Glenn Randers-Pehrson
eaa1b0a5f2 [master] Removed test for PNG_CONFIGURE_LIBPNG from pngconf.h 2009-11-25 09:27:48 -06:00
Glenn Randers-Pehrson
de5c932283 [master] Disabled the new pedantic warnings
about deprecated function use and deprecated structure access unless the
user defines PNG_PEDANTIC_WARNINGS.  Added "#define PNG_NO_PEDANTIC_WARNINGS"
in the libpng source files.  Removed "-DPNG_CONFIGURE_LIBPNG" from the
makefiles and projects since the warnings no longer depend on this.
2009-11-25 08:51:04 -06:00
Glenn Randers-Pehrson
3b673e0fb0 [master] Bump to version libpng-1.2.41rc03 2009-11-25 08:42:36 -06:00
Glenn Randers-Pehrson
83b84d65c2 [master] Removed some trailing blanks
in Makefile.ac and Makefile.in
2009-11-22 11:37:19 -06:00
Glenn Randers-Pehrson
c31e04e2f8 [master] Rebuilt the configure scripts with autoconf-2.65 2009-11-22 08:55:10 -06:00
Glenn Randers-Pehrson
a460e00574 [master] Bump to version 1.2.41rc02 2009-11-22 08:31:00 -06:00
Glenn Randers-Pehrson
c593d488f9 [master] Imported from libpng-1.2.41rc01.tar 2009-11-18 09:58:36 -06:00
Glenn Randers-Pehrson
44a7c89e02 [master] Moved descriptions of makefiles and other scripts out of INSTALL
into scripts/README.txt
  and updated the copyright year in scripts/pngw32.rc from 2004 to 2009.
2009-11-15 08:31:00 -06:00
Glenn Randers-Pehrson
88bbbfa567 [master] Bump to version 1.2.41rc01 2009-11-14 07:41:19 -06:00
Glenn Randers-Pehrson
e3f9ce59eb [master] Bump to version 1.2.41beta20 2009-11-12 20:24:32 -06:00
Glenn Randers-Pehrson
12f0c2f580 [master] Imported from libpng-1.2.41beta19.tar 2009-11-12 20:11:04 -06:00
Glenn Randers-Pehrson
6099e57b07 [master] Restore pngtest.png, CHANGES, and ANNOUNCE to 1.2.41beta19 version. 2009-11-12 12:20:41 -06:00
Glenn Randers-Pehrson
e53ecd35c0 [master] Restored pngtest.png to the libpng-1.4.0beta7 version. 2009-11-12 12:16:23 -06:00
Glenn Randers-Pehrson
8397b45b20 [master] Removed reference to some non-exported functions from scripts/*.def
These functions won't be exported until libpng-1.4.0
2009-11-12 11:31:09 -06:00
Glenn Randers-Pehrson
bcb1b414ed [master] Fixed up some line-wrapping in the documentation. 2009-11-12 11:30:03 -06:00
Glenn Randers-Pehrson
bef02a89ea [master] Bump to version 1.2.41beta19 2009-11-11 15:09:22 -06:00
Glenn Randers-Pehrson
1aae1bf9fd [master] Updated CHANGES and ANNOUNCE about PNG_PRIVATE macro. 2009-11-11 15:03:20 -06:00
Glenn Randers-Pehrson
078f2aecfb [master] Imported from libpng-1.2.41beta18.tar 2009-11-11 14:26:32 -06:00
Glenn Randers-Pehrson
c87f913eb9 [master] Marked "internally exported" functions with PNG_PRIVATE. 2009-11-11 14:24:27 -06:00
Glenn Randers-Pehrson
a5fc3eb9d4 [master] Bump to version libpng-1.2.41beta18 2009-11-11 14:21:39 -06:00
Glenn Randers-Pehrson
780dc06584 [master] Renamed scripts/makefile.wce to scripts/makefile.cegcc 2009-11-10 09:30:18 -06:00
Glenn Randers-Pehrson
365cddf35f [master] Bump to version libpng-1.2.41rc01 2009-11-10 09:25:53 -06:00
Glenn Randers-Pehrson
c099ea497a [master] Imported from libpng-1.2.41beta17.tar 2009-11-10 06:11:31 -06:00
Glenn Randers-Pehrson
336b43d278 [master] Moved "rm pnggccrd.c pnggvrd.c" to a separate line
in contrib/pngminim/*/gather.sh
2009-11-09 13:42:16 -06:00
Glenn Randers-Pehrson
08e585d948 [master] Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles. 2009-11-09 11:20:01 -06:00
Glenn Randers-Pehrson
7aacd895ee [master] Fixed deprecated usages in contrib directory. 2009-11-09 10:47:12 -06:00
Glenn Randers-Pehrson
3130af0e2b [master] Fixed a typo in a comment in CMakeLists.txt 2009-11-09 08:31:05 -06:00
Glenn Randers-Pehrson
02a58af3c0 [master] Marked memory allocation function prototypes with PNG_ALLOCATED. 2009-11-09 08:25:36 -06:00
Glenn Randers-Pehrson
86645a3f19 [master] Marked deprecated function prototypes with PNG_DEPRECATED. 2009-11-09 08:10:22 -06:00
Glenn Randers-Pehrson
edc3994cfd [master] In CMakeLists.txt, add "-DPNG_CONFIGURE_LIBPNG" to the definitions. 2009-11-09 07:18:26 -06:00
Glenn Randers-Pehrson
71f29b701d [master] Bump to version 1.2.41beta17 2009-11-09 06:50:36 -06:00
Glenn Randers-Pehrson
b4b853b4c5 [master] Imported from libpng-1.2.41beta16.tar 2009-11-09 06:50:25 -06:00
Glenn Randers-Pehrson
d5483f3352 [master] Make PNG_DEPSTRUCT, etc., configurable.
Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
2009-11-08 20:37:37 -06:00
Glenn Randers-Pehrson
2522de8594 [master] Restore new pngtest.c 2009-11-08 20:07:41 -06:00
Glenn Randers-Pehrson
e5e60564cf [master] Bump to version 1.2.41beta16 2009-11-08 20:06:21 -06:00
Glenn Randers-Pehrson
bf2dabe6f1 [master] Removed three direct references to read_info_ptr members
in pngtest.c that were detected by the new PNG_DEPSTRUCT macro.
2009-11-08 20:01:55 -06:00
Glenn Randers-Pehrson
70c873bcac [master] Remove some extra text from CHANGES 2009-11-08 19:55:14 -06:00
Glenn Randers-Pehrson
5aabf5b8eb [master] Imported from libpng-1.2.41beta15.tar 2009-11-08 19:31:21 -06:00
Glenn Randers-Pehrson
20e82ae2a2 [master] Added deprectated-use reporting
ported from libpng-1.4.0
2009-11-08 19:18:45 -06:00
Glenn Randers-Pehrson
e890cb118c [master] Bump to version bump-to-1.2.41beta15.tar 2009-11-08 17:05:27 -06:00
Glenn Randers-Pehrson
275d1aa94e [master] Imported from libpng-1.2.41beta14.tar 2009-11-08 17:05:18 -06:00
Glenn Randers-Pehrson
f748fda0ed [master] Reverted iTXt compatibility stuff
from 1.2.41beta05, 1.2.41beta11, and 1.2.41beta12.
2009-11-08 16:51:11 -06:00
Glenn Randers-Pehrson
87480bf6d4 [master] Removed reference to png_calloc from scripts/*.def 2009-11-08 15:15:37 -06:00
Glenn Randers-Pehrson
bd6f1edea8 [master] Update png.h and pngconf.h to revert iTXt support. 2009-11-08 15:14:32 -06:00
Glenn Randers-Pehrson
ed4c9fc4e9 [master] Remove mention of empty pngpriv.h in CHANGES 2009-11-03 19:18:56 -06:00
Glenn Randers-Pehrson
8f8be84024 [master] Removed the empty pngpriv.h
due to popular demand.
2009-11-03 19:13:59 -06:00
Glenn Randers-Pehrson
ead562ed05 [master] Make PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED 2009-11-03 12:28:14 -06:00
Glenn Randers-Pehrson
8cf8726c7c [master] Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_tIME_SUPPORTED 2009-11-03 11:42:47 -06:00
Glenn Randers-Pehrson
b83df4e711 [master] Added empty pngpriv.h file
as an aid to migration to 1.4.x
2009-11-03 10:10:20 -06:00
Glenn Randers-Pehrson
7e64470a71 [master] Bump version to libpng-1.2.41beta14 2009-11-03 07:05:11 -06:00
Glenn Randers-Pehrson
fd3d717df5 [master] Imported from libpng-1.2.41beta13.tar 2009-11-03 06:53:07 -06:00
Glenn Randers-Pehrson
d4ebb803fa [master] Added scripts/makefile.wce and scripts/png32ce.def
to support WindowsCE.
2009-11-02 21:03:14 -06:00
Glenn Randers-Pehrson
5d276731e6 [master] Use the new PNG_CONVERT_tIME_SUPPORTED macro in pngwrite.c. 2009-11-02 11:35:26 -06:00
Glenn Randers-Pehrson
6dcfbc479d [master] Added PNG_CONVERT_tIME_SUPPORTED macro. 2009-11-02 11:26:10 -06:00
Glenn Randers-Pehrson
d8bf20d9ac [master] Updated scripts/pngw32.def and added CE support to ltmain.sh 2009-11-02 09:19:11 -06:00
Glenn Randers-Pehrson
38453101f0 [master] Bump version to 1.2.41beta13 2009-11-02 06:26:40 -06:00
Glenn Randers-Pehrson
8e46375186 [master] Free png_ptr->user_png_ver when destroying png_ptr. 2009-11-02 06:04:47 -06:00
Glenn Randers-Pehrson
c75d7fb32e [master] Bump version to 1.2.41beta12 2009-11-02 05:54:39 -06:00
Glenn Randers-Pehrson
6e0cf087ad [master] Imported from libpng-1.2.41beta11.tar 2009-11-01 21:46:17 -06:00
Glenn Randers-Pehrson
af9a41d770 [master] Store user's user_png_ver in new png_ptr->user_png_ver element.
Revised iTXt support. To ensure binary compatibility with
previous versions, the "lang" and "lang_key" members will be assumed
to be omitted from versions prior to 1.2.41beta11 whenever there is a
library mismatch.
2009-11-01 21:22:01 -06:00
Glenn Randers-Pehrson
d6dc43db7d [master] Removed some dead code from pngconf.h
(inside an #if 0/#endif block)
2009-11-01 16:41:09 -06:00
Glenn Randers-Pehrson
4c49647788 [master] Revise pngconf.h (iTXt handling)
and avoid reference to time.h "tm" structure in png.h and pngwrite.c
2009-11-01 16:32:57 -06:00
Glenn Randers-Pehrson
3de7bde0e1 [master] Revised iTXt support and documentation 2009-11-01 08:47:04 -06:00
Glenn Randers-Pehrson
dc38e24fed [master] Bump version to 1.2.41beta11 2009-10-31 23:29:58 -05:00
Glenn Randers-Pehrson
a61724c004 [master] Imported from libpng-1.2.41beta10.tar 2009-10-31 23:24:15 -05:00
Glenn Randers-Pehrson
29b738b4e6 [master] Enabled iTXt support by default.
To ensure binary compatibility with
    previous versions, the "lang" and "lang_key" members will be assumed
    to be omitted from previous versions unless the current libpng
    version was built with PNG_iTXt_SUPPORTED (which is otherwise no
    longer necessary to gain iTXt support), as a signal that the user has
    been building previous versions with PNG_iTXt_SUPPORTED as well.
2009-10-31 23:20:11 -05:00
Glenn Randers-Pehrson
602d314ba0 [master] Bump version to libpng-1.2.41beta10 2009-10-31 21:43:03 -05:00
Glenn Randers-Pehrson
a68974409c [master] Imported from libpng-1.2.41beta09.tar 2009-10-31 21:42:50 -05:00
Glenn Randers-Pehrson
5d67107c79 [master] Fix typo in pngconf.h 2009-10-31 21:32:42 -05:00
Glenn Randers-Pehrson
da9b591621 [master] Updated documentation
Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate.
2009-10-31 19:21:30 -05:00
Glenn Randers-Pehrson
2e8aa25844 [master] Apply png_user_chunk_cache_max within png_decompress_chunk(). 2009-10-31 19:20:20 -05:00
Glenn Randers-Pehrson
6611322a8b [master] Moved CMakeLists.txt from scripts
into the main libpng directory.  More bugfixes and improvements to
CMakeLists.txt (Philip Lowman)
2009-10-31 12:50:05 -05:00
Glenn Randers-Pehrson
948c6ee88d [master] Removed a harmless extra png_set_invert_alpha()
from pngwrite.c
2009-10-31 12:28:23 -05:00
Glenn Randers-Pehrson
b7a9d80f28 [master] Bump version to libpng-1.2.41beta09 2009-10-30 06:54:53 -05:00
Glenn Randers-Pehrson
277f6fbe49 [master] Revert version to 1.2.41beta08 2009-10-30 06:14:45 -05:00
Glenn Randers-Pehrson
e05080f5a8 [master] Added png_get_user_cache_max()
and png_set_user_cache_max() from libpng-1.4.0rc01.
2009-10-30 05:49:16 -05:00
Glenn Randers-Pehrson
4de250dd75 [master] Put new png_struct members at the end. 2009-10-30 05:41:34 -05:00
Glenn Randers-Pehrson
8f2f7f431c [master] Bump version to 1.2.41beta09 2009-10-30 00:10:54 -05:00
Glenn Randers-Pehrson
4f67b78853 [master] Imported from libpng-1.2.41beta08.tar 2009-10-29 23:54:16 -05:00
Glenn Randers-Pehrson
4b14b35208 [master] Ported functions from libpng-1.4.0rc01:
png_calloc(), png_get_io_state(),
    png_get_io_chunk_name(), png_set_premultiply_alpha, and
    png_do_read_premultiply_alpha().
2009-10-29 23:47:05 -05:00
Glenn Randers-Pehrson
bc2ab12f99 [master] Bump version to 1.2.41beta08 2009-10-29 23:41:29 -05:00
Glenn Randers-Pehrson
c3166b2a48 [master] Imported from libpng-1.2.41beta07.tar 2009-10-21 10:42:32 -05:00
Glenn Randers-Pehrson
1eef1e5b2f [master} Ported some cosmetic changes from libpng-1.4.0rc01
changing "#if defined(x)" to "#ifdef x" in png.h and pngconf.h.
2009-10-21 10:32:04 -05:00
Glenn Randers-Pehrson
8191965555 [master] Fixed "DATE" comment in pngrtran.c 2009-10-19 06:39:35 -05:00
Glenn Randers-Pehrson
f1c9244dfd [master] Bump version to 1.2.41beta07 2009-10-18 14:38:38 -05:00
Glenn Randers-Pehrson
58155a9921 [master] Imported from libpng-1.2.41beta06.tar 2009-10-18 14:36:31 -05:00
Glenn Randers-Pehrson
5d398a69fb [master] Converted all PNG_NO_* tests to PNG_*_SUPPORTED
everywhere except pngconf.h as in libpng-1.4.0beta78 and later.
2009-10-18 14:30:53 -05:00
Glenn Randers-Pehrson
4560de58f4 [master] Update CHANGES and ANNOUNCE 2009-10-18 08:07:48 -05:00
Glenn Randers-Pehrson
7f9f605781 [master] Restored PNG_USE_LOCAL_ARRAYS block of pngread.c
that was inadvertently deleted by the previous checkin.
2009-10-18 08:03:07 -05:00
Glenn Randers-Pehrson
41cad5fbed [master] Bump version to 1.2.41beta06 2009-10-17 19:20:53 -05:00
Glenn Randers-Pehrson
e4f15b0f0e [master] Ported cosmetic changes to pngread.c
from libpng-1.4.0beta87.
2009-10-17 19:02:45 -05:00
Glenn Randers-Pehrson
d4e3ef6eae [master] Ported cosmetic changes to pngwrite.c
from libpng-1.4.0beta87.
2009-10-17 18:30:44 -05:00
Glenn Randers-Pehrson
eda90ace80 [master] Port cosmetic changes in png.c
from libpng-1.4.0beta87
2009-10-13 20:12:37 -05:00
Glenn Randers-Pehrson
0c127348e1 [master] Ported cosmetic changes in pngrtran.c
from libpng-1.4.0beta87
2009-10-13 18:31:01 -05:00
Glenn Randers-Pehrson
eb6b59af64 [master] Fixed some indentation in pngrtran.c 2009-10-13 18:29:46 -05:00
Glenn Randers-Pehrson
11066e33f8 [master] Port cosmetic changes in pngrutil.c
from libpng-1.4.0beta87
2009-10-13 09:09:11 -05:00
Glenn Randers-Pehrson
51a32d64d8 [master] Ported cosmetic changes in pngpread.c and pngrtran.c
from libpng-1.4.0beta87.
2009-10-12 13:41:14 -05:00
Glenn Randers-Pehrson
77a9f59487 [master] Ported some cosmetic changes from libpng-1.4.0beta87/pngrutil.c,
changing many "#if defined(x)" to "#ifdef x".
2009-10-11 08:26:03 -05:00
Glenn Randers-Pehrson
1814c4e45b [master] Imported from libpng-1.2.41beta05.tar 2009-10-11 07:49:17 -05:00
Glenn Randers-Pehrson
722f5fd8d4 [master] Ported some cosmetic changes from libpng-1.4.0beta87
changing many "#if defined(x)" to "#ifdef x" in pngtest.c and pngwutil.c.
2009-10-10 09:27:12 -05:00
Glenn Randers-Pehrson
e9c8dcf96c [master] Revised pngconf.h to make it easier to enable iTXt support
by defining PNG_iTXT_SUPPORTED
2009-10-10 08:13:01 -05:00
Glenn Randers-Pehrson
89e0d95883 [master] Bump version to 1.2.41beta05 2009-10-10 06:29:47 -05:00
Glenn Randers-Pehrson
aeb9906717 [master] Imported from libpng-1.2.41beta04.tar 2009-10-10 06:29:36 -05:00
Glenn Randers-Pehrson
368971ec8b [master] Eliminated a shadowed declaration
of "pp" in png_handle_sPLT().
2009-10-07 12:48:44 -05:00
Glenn Randers-Pehrson
0112826daf [master] Change xcode project library name
from libpng.0.dylib to libpng.3.dylib to be consistent with makefile.darwin.
2009-10-05 14:56:46 -05:00
Glenn Randers-Pehrson
9023e8f7bb [master] Ported some cosmetic changes from the devel branch 2009-10-05 13:53:19 -05:00
Glenn Randers-Pehrson
48fac4e8ce [master] Added projects/xcode/libpng.xcodeproj/.gitignore 2009-10-04 16:01:53 -05:00
Glenn Randers-Pehrson
edeccce619 [master] Added "xcode" project
similar one already in libpng-1.4.0beta (Alam Arias).
2009-10-02 14:12:54 -05:00
Glenn Randers-Pehrson
60668aa210 [master] Bump version to 1.2.4beta04 2009-10-02 09:41:34 -05:00
Glenn Randers-Pehrson
455e8a4281 [master] Imported from libpng-1.2.41beta03.tar 2009-09-30 23:14:24 -05:00
Glenn Randers-Pehrson
5d7fe7a718 [master] Revised png_check_IHDR() again
to check info_ptr members instead of the contents of the returned parameters.
2009-09-30 23:10:28 -05:00
Glenn Randers-Pehrson
64ca95e375 [master] Bump version to 1.2.41beta03 2009-09-30 16:03:06 -05:00
Glenn Randers-Pehrson
837eecbc91 [master] Revised png_check_IHDR()
to avoid bogus complaints about filter method.
2009-09-30 14:45:33 -05:00
Glenn Randers-Pehrson
26cc10a00c [master] Reverted recent test in png_get_IHDR(). 2009-09-30 14:35:05 -05:00
Glenn Randers-Pehrson
f12abe957d [master] Revised png_check_IHDR() 2009-09-30 14:29:00 -05:00
Glenn Randers-Pehrson
caaf688582 [master] Imported from libpng-1.2.41beta02.tar 2009-09-30 13:40:53 -05:00
Glenn Randers-Pehrson
3dfd0cd62a [master] Add a test to make sure the user isn't trying to stuff height into
a 16-bit int (assuming height immediately follows width).
2009-09-30 13:38:37 -05:00
Glenn Randers-Pehrson
18bd86f154 [master] Revise documentation to mention not using TAB character 2009-09-25 14:21:52 -05:00
Glenn Randers-Pehrson
338f465019 [master] Expand TAB characters in pngrtran.c 2009-09-25 14:11:33 -05:00
Glenn Randers-Pehrson
ac13f5e6f9 [master] Imported from libpng-1.2.41beta01.tar 2009-09-25 12:07:58 -05:00
Glenn Randers-Pehrson
1b6f6d80ea [master] Imported from libpng-1.2.40.tar 2009-09-10 09:01:41 -05:00
Glenn Randers-Pehrson
18b078414a [master] Imported from libpng-1.2.40rc01.tar 2009-09-02 07:09:11 -05:00
Glenn Randers-Pehrson
f6ce318061 [master] CMakeLists.txt updated with bugfixes and improvements 2009-08-28 07:06:45 -05:00
Glenn Randers-Pehrson
a21c94e3dc [master] Bump version to libpng-1.2.40beta02 2009-08-22 09:26:42 -05:00
Glenn Randers-Pehrson
38b92d56e7 [master] Imported from libpng-1.2.40beta01.tar 2009-08-20 17:39:42 -05:00
Glenn Randers-Pehrson
a08d95b971 [master] Fixed incorrect #ifdef in pngset.c
PNG_UNKNOWN_CHUNKS_SUPPORTED should be PNG_HANDLE_AS_UNKNOWN_SUPPORTED
2009-08-20 16:13:58 -05:00
Glenn Randers-Pehrson
339416b38b [master] Trivial cosmetic changes in comments 2009-08-19 08:42:06 -05:00
Glenn Randers-Pehrson
7e2f07486a [master] Remove an extra png_debug() statement
that was recently added to png_write_find_filter() in pngwutil.c
2009-08-13 17:54:20 -05:00
Glenn Randers-Pehrson
a3e569cdda [master] Bump libpng.3 and ANNOUNCE to version 1.2.40beta01 2009-08-13 17:52:49 -05:00
Glenn Randers-Pehrson
d68d8d82e6 [master] Bump version to libpng-1.2.40beta01 2009-08-13 17:41:35 -05:00
Glenn Randers-Pehrson
997b4a544d [master] Update ANNOUNCE to mention .tar.xz instead of .tgz 2009-08-13 06:15:22 -05:00
Glenn Randers-Pehrson
176d2b622e [master] Imported from libpng-1.2.39.tar 2009-08-13 05:51:34 -05:00
Glenn Randers-Pehrson
3a9ab23713 [master] Imported from libpng-1.2.39rc01.tar 2009-08-05 21:26:48 -05:00
Glenn Randers-Pehrson
9e88fcd58c [master] Imported from libpng-1.2.39beta05.tar 2009-08-01 08:57:10 -05:00
Glenn Randers-Pehrson
39ffc1c3c7 [master] Imported from libpng-1.2.39beta04.tar 2009-08-01 08:57:08 -05:00
Glenn Randers-Pehrson
69d0e44295 [master] Imported from libpng-1.2.39beta03.tar 2009-07-29 05:50:25 -05:00
Glenn Randers-Pehrson
d2d5e540ac [master] Update configure scripts to autoconf-2.64 2009-07-28 16:51:57 -05:00
Glenn Randers-Pehrson
d7bd2d2b2c [master] Relocated prototype for png_64bit_product()
into png.h and revised the documenatation (in the libpng style section) about
placement of prototypes.
2009-07-28 08:18:31 -05:00
Glenn Randers-Pehrson
ddf5fc8a42 [master] Bump version to libpng-1.2.39beta03 2009-07-28 08:05:11 -05:00
Glenn Randers-Pehrson
0841c63e0d [master] Imported from libpng-1.2.39beta02.tar 2009-07-27 22:31:10 -05:00
Glenn Randers-Pehrson
a4d439b975 [master] Avoid a possible NULL dereference in debug build,
in png_set_text_2() (bug introduced in libpng-0.95, discovered by Evan Rouault)
2009-07-27 22:27:30 -05:00
Glenn Randers-Pehrson
8de509a837 [master] Bump version to libpng-1.2.39beta02 2009-07-27 22:26:15 -05:00
Glenn Randers-Pehrson
219760639a [master] Imported from libpng-1.2.39beta01.tar 2009-07-25 09:27:58 -05:00
Glenn Randers-Pehrson
38ed8795ab [master] Added a prototype for png_16bit_product()
(suggested by Peter Breitenlohner)
2009-07-23 13:18:55 -05:00
Glenn Randers-Pehrson
55697d7dc9 [master] Update some dates. 2009-07-23 13:17:27 -05:00
Glenn Randers-Pehrson
a7fb782aea [master] Bump version to libpng-1.2.39beta01 2009-07-23 13:01:03 -05:00
Glenn Randers-Pehrson
d91c64e428 [master] Imported from libpng-1.2.38.tar 2009-07-16 06:01:45 -05:00
Glenn Randers-Pehrson
4aa911abc6 [master] Imported from libpng-1.2.38rc03.tar 2009-07-11 09:16:28 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
64c72bb919 [master] Updated configuration scripts to autoconf-2.63
from autoconf-2.62
2009-07-11 09:07:35 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
fec191d3cc [master] Revised references to libpng license in contrib/visupng
to be consistent with the rest of the source files.
2009-07-11 07:13:56 -05:00
Glenn Randers-Pehrson
7430bcbc44 [master] Add a reference to the "libpng license" in each source file. 2009-06-28 21:38:35 -05:00
Glenn Randers-Pehrson
eba11d2ba5 [master] Imported from libpng-1.2.38rc02.tar 2009-06-28 20:28:53 -05:00
Glenn Randers-Pehrson
a3a724f805 [master] Imported from libpng-1.2.38rc01.tar 2009-06-24 06:59:36 -05:00
Glenn Randers-Pehrson
a770d71890 [master] Bump version to bump-to-libpng-1.2.38beta02 2009-06-18 16:53:56 -05:00
Glenn Randers-Pehrson
1de866cd09 [master] Imported from libpng-1.2.38beta01.tar 2009-06-17 07:46:44 -05:00
Glenn Randers-Pehrson
54380f53a2 [master] Fixed some indentation in pngset.c 2009-06-16 17:53:00 -05:00
Glenn Randers-Pehrson
7d870524d3 [master] Changed PNG_HANDLE_AS_UNKNOWN to PNG_UNKNOWN_CHUNKS_SUPPORTED
in pngset.c
2009-06-16 17:28:01 -05:00
Glenn Randers-Pehrson
d28aad9a58 [master] Added an "#ifdef PNG_WRITE_SUPPORTED/#endif" block in pngconf.h 2009-06-16 17:27:14 -05:00
Glenn Randers-Pehrson
8be63adbc8 [master] Relocated various UNKNOWN_CHUNK macro definitions
outside of the PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED macros and
updated CHANGES and ANNOUNCE.  The definitions were actually relocated
in the previous commit but I forgot to mention it.
2009-06-16 16:13:42 -05:00
Glenn Randers-Pehrson
7d8f352e0a Added a PNG_NO_HANDLE_AS_UNKNOWN inside the LEGACY block of pngconf.h 2009-06-16 13:54:57 -05:00
Glenn Randers-Pehrson
587382c0ba [master] Added 2 "defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)" tests in png.h 2009-06-16 13:35:47 -05:00
Glenn Randers-Pehrson
0f714ca6bc [master] Reformatted some comments. 2009-06-15 22:01:39 -05:00
Glenn Randers-Pehrson
63da1df6fe [master] png.c should have been included in the previous checkin 2009-06-15 20:58:37 -05:00
Glenn Randers-Pehrson
bbe589da44 [master] Change some instances of PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
to PNG_HANDLE_AS_UNKNOWN to make it possible to build a libpng that can
use the png_set_keep_unknown_chunks() mechanism to ignore unused chunks
without having to save unknown chunks.
2009-06-15 20:50:00 -05:00
Glenn Randers-Pehrson
b278e91338 about calling png_set_IHDR() multiple times and about the order
of color samples in the tRNS chunk.
2009-06-08 08:37:58 -05:00
Glenn Randers-Pehrson
f2609e133d [master] Revise libpng*.txt
about calling png_set_IHDR() multiple times and about the order
of color samples in the tRNS chunk.
2009-06-08 08:33:46 -05:00
Glenn Randers-Pehrson
e14fdbbddb [master] Bump version to bump-to-libpng-1.2.38beta01 2009-06-05 17:27:14 -05:00
Glenn Randers-Pehrson
a162155919 Imported from libpng-1.2.37.tar 2009-06-04 06:11:58 -05:00
Glenn Randers-Pehrson
4d7ae382a8 [master] Added a section in documentation
about using png_set_io_ptr() in configure scripts for detecting libpng
2009-06-02 13:48:22 -05:00
Glenn Randers-Pehrson
0c86eb2dc7 Update pngminim/*/pngusr.h
to add PNG_NO_READ_SWAP, PNG_NO_WRITE_SWAP
2009-06-02 06:50:00 -05:00
Glenn Randers-Pehrson
70c2db8b9f Updated documentation about the git repository and libpng coding style. 2009-06-02 06:41:57 -05:00
Glenn Randers-Pehrson
c1dd118d2c Reformatted several "if () statment;"
and "else statement;" into two lines.
2009-05-30 20:25:20 -05:00
Glenn Randers-Pehrson
2d21d91abd Imported from libpng-1.2.37rc01.tar 2009-05-27 06:47:59 -05:00
Glenn Randers-Pehrson
e5ee05dc0d Imported from libpng-1.2.37beta03.tar 2009-05-20 17:19:00 -05:00
Glenn Randers-Pehrson
c0d53e176b Change version from libpng-1.2.37rc01 to libpng-1.2.37beta03
Because of many cosmetic changes, drop back to beta and do rc01 later.
2009-05-20 17:16:46 -05:00
Glenn Randers-Pehrson
b26d188190 Rename contrib/pngminim/*/makefile.std to makefile. 2009-05-19 18:51:08 -05:00
Glenn Randers-Pehrson
0a6382e2af Bump version to libpng-1.2.37rc01 2009-05-19 18:48:06 -05:00
Glenn Randers-Pehrson
1214d8cd26 Fix "AVE" -> "AVG" typo in libpng docs again.
Evidently the fix didn't go into the real master copy.
2009-05-19 07:18:06 -05:00
Glenn Randers-Pehrson
65a30ab0a2 Imported from libpng-1.2.37beta02.tar 2009-05-19 07:05:20 -05:00
Glenn Randers-Pehrson
61616abef2 Fixed cut-and-paste error in contrib/pngminim/preader/README
"pngminus" should be "gregbook"
2009-05-18 15:19:29 -05:00
Glenn Randers-Pehrson
bb1fcd1ba8 Fixed a glitch in contrib/pngminim/preader/README. 2009-05-18 14:57:07 -05:00
Glenn Randers-Pehrson
6d65121993 Add contrib/pngminim/preader files
(README, gather.sh, makefile.std, and pngusr.h)
2009-05-18 14:50:48 -05:00
Glenn Randers-Pehrson
ecf0bffb79 Added contrib/pngminim/preader demo of gregbook/rpng2-x with embedded libpng
also minor editing of encoder/pngusr.h and decoder/pngusr.h
2009-05-18 14:46:35 -05:00
Glenn Randers-Pehrson
af2ea0a1f2 Revise ANNOUNCE to reflect conditional compile of png_read_finish_row(). 2009-05-18 14:43:36 -05:00
Glenn Randers-Pehrson
286467db82 Restored compiling png_combine_row() for progressive readers.
Only png_read_finish_row() can be omitted.
2009-05-18 13:40:23 -05:00
Glenn Randers-Pehrson
6b60a31ebf Restore png_memset() call
This stuff should be handled in the APNG fork.
2009-05-18 11:55:55 -05:00
Glenn Randers-Pehrson
54028e5943 Revert "png_reset_prev_row" from png.h and pngrutil.c
This should be handled in the APNG fork, not in libpng proper.
2009-05-18 11:49:19 -05:00
Glenn Randers-Pehrson
0c062e839d Conditionally compile png_combine_row() and png_read_finish_row()
which are only used by sequential PNG readers.  This can save some
resources in applications that only do progressive reading.
2009-05-18 10:31:21 -05:00
Glenn Randers-Pehrson
0fcbf05b6d Revert "Set png_ptr->old_prev_row_size=0 to force prev_row to be cleared"
This reverts commit f4276c36c93e9a257f0780a3590886d5fa411f1d.
2009-05-18 10:18:00 -05:00
Glenn Randers-Pehrson
f4276c36c9 Set png_ptr->old_prev_row_size=0 to force prev_row to be cleared 2009-05-16 08:47:20 -05:00
Glenn Randers-Pehrson
ba05bddf92 Relocate misplaced #endif directives in pngwrite.c
having to do with sCAL chunk handling
2009-05-16 08:40:25 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
7a63d75a83 Fixed typo in libpng documentation: AVE filter should be AVG filter. 2009-05-15 20:56:43 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
da3f74a70e Bump version to libpng-1.2.37beta02 2009-05-15 20:53:04 -05:00
Glenn Randers-Pehrson
5f26656fc5 Imported from libpng-1.2.37beta01.tar 2009-05-14 05:23:07 -05:00
Glenn Randers-Pehrson
2f76e90d1a Reformatted comments in example.c
Added advice about setting pointers to NULL after png_free(),
capitalized sentences, reformatted long comments in libpng style.
2009-05-13 15:20:53 -05:00
Glenn Randers-Pehrson
1296329f02 Revised commentary in example.c 2009-05-13 07:42:05 -05:00
Glenn Randers-Pehrson
e38b432846 Clarified usage of sig_bit as struct vs sig_bit_p as pointer in example.c
sig_bit was not declared in write_png() and was used differently from
sig_bit in read_png(), as reported by Vincent Torri.  This update changes
sig_bit to sig_bit_p in read_png() and declares sig_bit in write_png().
2009-05-13 05:18:48 -05:00
Glenn Randers-Pehrson
549a5101e7 Fixed inconsistency in use of "row_bytes" in pngrutil.c
The memset() should use "row_bytes" instead of "png_ptr->rowbytes".
This bug was introduced in libpng-1.2.36.
2009-05-12 05:49:10 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
031a8648cb Merged scripts/makefiles and other scripts with libpng-1.4.0beta57.
These are mostly just cosmetic changes.
2009-05-07 17:12:33 -05:00
Glenn Randers-Pehrson glennrp@comcast.net
a8476a8404 Bump internal version to libpng-1.2.37beta01. 2009-05-07 17:09:14 -05:00
Glenn Randers-Pehrson
25c8491fc8 Imported from libpng-1.2.36.tar 2009-05-07 10:59:02 -05:00
Glenn Randers-Pehrson
d0d637dd47 Imported from libpng-1.2.36rc01.tar 2009-04-30 15:29:29 -05:00
Glenn Randers-Pehrson
977c6bd44c Imported from libpng-1.2.36beta05.tar 2009-04-24 15:09:41 -05:00
Glenn Randers-Pehrson
89ad3aa168 Suppress "shadowed declaration" warnings about "gamma" in pngset.c
The variable "gamma" is also defined in math.h on some platforms.
2009-04-20 13:23:24 -05:00
Glenn Randers-Pehrson
55b921dab2 Suppress "shadowed declaration" warnings in pngtest.c
Changed some local variable names such as "buffer" to "buff".
2009-04-20 13:12:07 -05:00
Glenn Randers-Pehrson
92d0fe938f Add PNG_SKIP_SETJMP_CHECK macro 2009-04-20 13:07:01 -05:00
Glenn Randers-Pehrson
d07e9b03c4 Bump versioning to 1.2.36beta05 2009-04-20 13:02:18 -05:00
Glenn Randers-Pehrson
6cbd1cba68 Imported from libpng-1.2.36beta04.tar 2009-04-06 16:18:42 -05:00
Glenn Randers-Pehrson
3b8df1f143 Imported from libpng-1.2.36beta03.tar 2009-04-06 16:18:40 -05:00
Glenn Randers-Pehrson
85f7d0a8d5 Imported from libpng-1.2.36beta02.tar 2009-04-06 16:18:37 -05:00
Glenn Randers-Pehrson
556450a2ff Imported from libpng-1.2.36beta01.tar 2009-04-06 16:18:34 -05:00
Glenn Randers-Pehrson
6048b12510 Imported from libpng-1.2.35.tar 2009-04-06 16:18:32 -05:00
Glenn Randers-Pehrson
8cafc1e1ac Imported from libpng-1.2.35rc02.tar 2009-04-06 16:18:30 -05:00
Glenn Randers-Pehrson
51807d7608 Imported from libpng-1.2.35rc01.tar 2009-04-06 16:18:28 -05:00
Glenn Randers-Pehrson
e104df5bb7 Imported from libpng-1.2.35beta03.tar 2009-04-06 16:18:26 -05:00
Glenn Randers-Pehrson
c6df7e5899 Imported from libpng-1.2.35beta02.tar 2009-04-06 16:18:23 -05:00
Glenn Randers-Pehrson
d0a4300dde Imported from libpng-1.2.35beta01.tar 2009-04-06 16:18:21 -05:00
Glenn Randers-Pehrson
d8865433f9 Imported from libpng-1.2.34.tar 2009-04-06 16:18:19 -05:00
Glenn Randers-Pehrson
9c2bd642ba Imported from libpng-1.2.34rc01.tar 2009-04-06 16:18:17 -05:00
Glenn Randers-Pehrson
09883db208 Imported from libpng-1.2.34beta07.tar 2009-04-06 16:18:14 -05:00
Glenn Randers-Pehrson
f7f68f7160 Imported from libpng-1.2.34beta06.tar 2009-04-06 16:18:12 -05:00
Glenn Randers-Pehrson
31f744a8c0 Imported from libpng-1.2.34beta05.tar 2009-04-06 16:18:10 -05:00
Glenn Randers-Pehrson
bc66c96275 Imported from libpng-1.2.34beta04.tar 2009-04-06 16:18:07 -05:00
Glenn Randers-Pehrson
87c2acdeae Imported from libpng-1.2.34beta03.tar 2009-04-06 16:18:05 -05:00
Glenn Randers-Pehrson
6b90023764 Imported from libpng-1.2.34beta02.tar 2009-04-06 16:18:02 -05:00
Glenn Randers-Pehrson
e502bca962 Imported from libpng-1.2.34beta01.tar 2009-04-06 16:18:00 -05:00
Glenn Randers-Pehrson
c4d44b72e8 Imported from libpng-1.2.33.tar 2009-04-06 16:17:58 -05:00
Glenn Randers-Pehrson
e7324bb94f Imported from libpng-1.2.33rc02.tar 2009-04-06 16:17:56 -05:00
Glenn Randers-Pehrson
8431b2c190 Imported from libpng-1.2.33rc01.tar 2009-04-06 16:17:53 -05:00
Glenn Randers-Pehrson
7d376ccd8c Imported from libpng-1.2.33beta01.tar 2009-04-06 16:17:51 -05:00
Glenn Randers-Pehrson
382410249d Imported from libpng-1.2.32.tar 2009-04-06 16:17:49 -05:00
Glenn Randers-Pehrson
bfb5132362 Imported from libpng-1.2.32rc01.tar 2009-04-06 16:17:47 -05:00
Glenn Randers-Pehrson
4489dbc630 Imported from libpng-1.2.32beta01.tar 2009-04-06 16:17:45 -05:00
Glenn Randers-Pehrson
5c31bc8ffc Imported from libpng-1.2.31.tar 2009-04-06 16:17:42 -05:00
Glenn Randers-Pehrson
baee5f46cf Imported from libpng-1.2.31rc03.tar 2009-04-06 16:17:40 -05:00
Glenn Randers-Pehrson
66ab7ffa15 Imported from libpng-1.2.31rc02.tar 2009-04-06 16:17:37 -05:00
Glenn Randers-Pehrson
32df7eb346 Imported from libpng-1.2.31rc01.tar 2009-04-06 16:17:35 -05:00
Glenn Randers-Pehrson
576b532b45 Imported from libpng-1.2.30.tar 2009-04-06 16:17:33 -05:00
Glenn Randers-Pehrson
b520414d5a Imported from libpng-1.2.30rc08.tar 2009-04-06 16:17:31 -05:00
Glenn Randers-Pehrson
b54fd5c588 Imported from libpng-1.2.30rc07.tar 2009-04-06 16:17:28 -05:00
Glenn Randers-Pehrson
d9b4c01719 Imported from libpng-1.2.30rc06.tar 2009-04-06 16:17:26 -05:00
Glenn Randers-Pehrson
84d5d968a6 Imported from libpng-1.2.30rc05.tar 2009-04-06 16:17:24 -05:00
Glenn Randers-Pehrson
9c8717e42f Imported from libpng-1.2.30rc04.tar 2009-04-06 16:17:21 -05:00
Glenn Randers-Pehrson
3215e97b17 Imported from libpng-1.2.30rc03.tar 2009-04-06 16:17:19 -05:00
Glenn Randers-Pehrson
975e721432 Imported from libpng-1.2.30rc02.tar 2009-04-06 16:17:17 -05:00
Glenn Randers-Pehrson
b8bccdd081 Imported from libpng-1.2.30rc01.tar 2009-04-06 16:17:15 -05:00
Glenn Randers-Pehrson
4310a4d813 Imported from libpng-1.2.30beta04.tar 2009-04-06 16:17:12 -05:00
Glenn Randers-Pehrson
b96b342561 Imported from libpng-1.2.30beta03.tar 2009-04-06 16:17:10 -05:00
Glenn Randers-Pehrson
eb1cd11d57 Imported from libpng-1.2.30beta02.tar 2009-04-06 16:17:07 -05:00
Glenn Randers-Pehrson
a55c72890d Imported from libpng-1.2.30beta01.tar 2009-04-06 16:17:05 -05:00
Glenn Randers-Pehrson
247e230581 Imported from libpng-1.2.29.tar 2009-04-06 16:17:03 -05:00
Glenn Randers-Pehrson
1586ea6fe9 Imported from libpng-1.2.29rc01.tar 2009-04-06 16:17:01 -05:00
Glenn Randers-Pehrson
ae505c50b0 Imported from libpng-1.2.29beta03.tar 2009-04-06 16:16:58 -05:00
Glenn Randers-Pehrson
fce1b4b1fb Imported from libpng-1.2.29beta02.tar 2009-04-06 16:16:55 -05:00
Glenn Randers-Pehrson
c6bcbf4951 Imported from libpng-1.2.29beta01.tar 2009-04-06 16:16:53 -05:00
Glenn Randers-Pehrson
6ed6086da5 Imported from libpng-1.2.28.tar 2009-04-06 16:16:51 -05:00
Glenn Randers-Pehrson
9f7b16ad19 Imported from libpng-1.2.27.tar 2009-04-06 16:16:49 -05:00
Glenn Randers-Pehrson
fc70a92071 Imported from libpng-1.2.27rc01.tar 2009-04-06 16:16:46 -05:00
Glenn Randers-Pehrson
ccaaab2898 Imported from libpng-1.2.27beta06.tar 2009-04-06 16:16:43 -05:00
Glenn Randers-Pehrson
8d36e630f2 Imported from libpng-1.2.27beta05.tar 2009-04-06 16:16:41 -05:00
Glenn Randers-Pehrson
eb1f347bca Imported from libpng-1.2.27beta04.tar 2009-04-06 16:16:38 -05:00
Glenn Randers-Pehrson
7db798186c Imported from libpng-1.2.27beta03.tar 2009-04-06 16:16:36 -05:00
Glenn Randers-Pehrson
a1cd94bfbb Imported from libpng-1.2.27beta02.tar 2009-04-06 16:16:34 -05:00
Glenn Randers-Pehrson
d9d2a6f6d9 Imported from libpng-1.2.27beta01.tar 2009-04-06 16:16:31 -05:00
Glenn Randers-Pehrson
b8c4b82d18 Imported from libpng-1.2.26.tar 2009-04-06 16:16:29 -05:00
Glenn Randers-Pehrson
b8f615d7a1 Imported from libpng-1.2.26rc01.tar 2009-04-06 16:16:27 -05:00
Glenn Randers-Pehrson
35d97eb5c5 Imported from libpng-1.2.26beta06.tar 2009-04-06 16:16:24 -05:00
Glenn Randers-Pehrson
fc15b2e479 Imported from libpng-1.2.26beta05.tar 2009-04-06 16:16:22 -05:00
Glenn Randers-Pehrson
936df0d290 Imported from libpng-1.2.26beta04.tar 2009-04-06 16:16:20 -05:00
Glenn Randers-Pehrson
3236beddf8 Imported from libpng-1.2.26beta03.tar 2009-04-06 16:16:18 -05:00
Glenn Randers-Pehrson
c13f8f10e6 Imported from libpng-1.2.26beta02.tar 2009-04-06 16:16:15 -05:00
Glenn Randers-Pehrson
d8b530b93c Imported from libpng-1.2.26beta01.tar 2009-04-06 16:16:13 -05:00
Glenn Randers-Pehrson
2296f211e8 Imported from libpng-1.2.25.tar 2009-04-06 16:16:10 -05:00
Glenn Randers-Pehrson
a5136b8863 Imported from libpng-1.2.25rc02.tar 2009-04-06 16:16:08 -05:00
Glenn Randers-Pehrson
913bc38217 Imported from libpng-1.2.25beta06.tar 2009-04-06 16:16:05 -05:00
Glenn Randers-Pehrson
4b7dca3d2c Imported from libpng-1.2.25beta05.tar 2009-04-06 16:16:03 -05:00
Glenn Randers-Pehrson
5c58e3ee31 Imported from libpng-1.2.25beta04.tar 2009-04-06 16:16:00 -05:00
Glenn Randers-Pehrson
49f304bd07 Imported from libpng-1.2.25beta03.tar 2009-04-06 16:15:58 -05:00
Glenn Randers-Pehrson
c95be42221 Imported from libpng-1.2.25rc01.tar 2009-04-06 16:15:56 -05:00
Glenn Randers-Pehrson
dbc07e13bb Imported from libpng-1.2.25beta02.tar 2009-04-06 16:15:54 -05:00
Glenn Randers-Pehrson
5ca40ebc22 Imported from libpng-1.2.25beta01.tar 2009-04-06 16:15:51 -05:00
Glenn Randers-Pehrson
a8e07274ae Imported from libpng-1.2.24.tar 2009-04-06 16:15:49 -05:00
Glenn Randers-Pehrson
af99dba018 Imported from libpng-1.2.24rc01.tar 2009-04-06 16:15:46 -05:00
Glenn Randers-Pehrson
03dfa028d2 Imported from libpng-1.2.24beta02.tar 2009-04-06 16:15:44 -05:00
Glenn Randers-Pehrson
541b47ac2a Imported from libpng-1.2.24beta01.tar 2009-04-06 16:15:42 -05:00
Glenn Randers-Pehrson
507a35a9be Imported from libpng-1.2.23.tar 2009-04-06 16:15:39 -05:00
Glenn Randers-Pehrson
1eddb5463e Imported from libpng-1.2.23rc01.tar 2009-04-06 16:15:37 -05:00
Glenn Randers-Pehrson
d91769efd4 Imported from libpng-1.2.23beta05.tar 2009-04-06 16:15:34 -05:00
Glenn Randers-Pehrson
134a8eb272 Imported from libpng-1.2.23beta04.tar 2009-04-06 16:15:32 -05:00
Glenn Randers-Pehrson
930be98598 Imported from libpng-1.2.23beta03.tar 2009-04-06 16:15:30 -05:00
Glenn Randers-Pehrson
28e3cb3e93 Imported from libpng-1.2.23beta02.tar 2009-04-06 16:15:28 -05:00
Glenn Randers-Pehrson
6328671ef8 Imported from libpng-1.2.23beta01.tar 2009-04-06 16:15:25 -05:00
Glenn Randers-Pehrson
fab1959d00 Imported from libpng-1.2.22.tar 2009-04-06 16:15:23 -05:00
Glenn Randers-Pehrson
5ab788cd84 Imported from libpng-1.2.22rc1.tar 2009-04-06 16:15:21 -05:00
Glenn Randers-Pehrson
ce2a6d3739 Imported from libpng-1.2.22beta4.tar 2009-04-06 16:15:18 -05:00
Glenn Randers-Pehrson
40dd10dfb2 Imported from libpng-1.2.22beta3.tar 2009-04-06 16:15:16 -05:00
Glenn Randers-Pehrson
e41076e082 Imported from libpng-1.2.22beta2.tar 2009-04-06 16:15:14 -05:00
Glenn Randers-Pehrson
582fec4e11 Imported from libpng-1.2.22beta1.tar 2009-04-06 16:15:11 -05:00
Glenn Randers-Pehrson
42ae02aa08 Imported from libpng-1.2.21.tar 2009-04-06 16:15:08 -05:00
Glenn Randers-Pehrson
79e3fc64c4 Imported from libpng-1.2.21rc3.tar 2009-04-06 16:15:06 -05:00
Glenn Randers-Pehrson
b188d671d1 Imported from libpng-1.2.21rc2.tar 2009-04-06 16:15:04 -05:00
Glenn Randers-Pehrson
5ecf1b53ea Imported from libpng-1.2.21rc1.tar 2009-04-06 16:15:01 -05:00
Glenn Randers-Pehrson
0636311d37 Imported from libpng-1.2.21beta2.tar 2009-04-06 16:14:59 -05:00
Glenn Randers-Pehrson
219d3b449f Imported from libpng-1.2.21beta1.tar 2009-04-06 16:14:57 -05:00
Glenn Randers-Pehrson
22eaa89c5a Imported from libpng-1.2.20.tar 2009-04-06 16:14:55 -05:00
Glenn Randers-Pehrson
79e28a4c2e Imported from libpng-1.2.20rc6.tar 2009-04-06 16:14:52 -05:00
Glenn Randers-Pehrson
db05b1eb2b Imported from libpng-1.2.20rc5.tar 2009-04-06 16:14:50 -05:00
Glenn Randers-Pehrson
d20666a228 Imported from libpng-1.2.20rc4.tar 2009-04-06 16:14:48 -05:00
Glenn Randers-Pehrson
9cc7b03503 Imported from libpng-1.2.20rc3.tar 2009-04-06 16:14:45 -05:00
Glenn Randers-Pehrson
b38f12d519 Imported from libpng-1.2.20rc2.tar 2009-04-06 16:14:43 -05:00
Glenn Randers-Pehrson
e736f1ead9 Imported from libpng-1.2.20rc1.tar 2009-04-06 16:14:40 -05:00
Glenn Randers-Pehrson
b56c1f6023 Imported from libpng-1.2.20beta04.tar 2009-04-06 16:14:37 -05:00
Glenn Randers-Pehrson
268f0d64fc Imported from libpng-1.2.20beta03.tar 2009-04-06 16:14:35 -05:00
Glenn Randers-Pehrson
b3ea17736b Imported from libpng-1.2.20beta02.tar 2009-04-06 16:14:33 -05:00
Glenn Randers-Pehrson
963daeaec5 Imported from libpng-1.2.20beta01.tar 2009-04-06 16:14:30 -05:00
Glenn Randers-Pehrson
249bd44ebc Imported from libpng-1.2.19.tar 2009-04-06 16:14:28 -05:00
Glenn Randers-Pehrson
04a1b1c123 Imported from libpng-1.2.19rc6.tar 2009-04-06 16:14:25 -05:00
Glenn Randers-Pehrson
3922e7afc3 Imported from libpng-1.2.19rc5.tar 2009-04-06 16:14:23 -05:00
Glenn Randers-Pehrson
f0a97a0d80 Imported from libpng-1.2.19rc4.tar 2009-04-06 16:14:21 -05:00
Glenn Randers-Pehrson
88713fd590 Imported from libpng-1.2.19rc3.tar 2009-04-06 16:14:18 -05:00
Glenn Randers-Pehrson
394759e0c8 Imported from libpng-1.2.19rc2.tar 2009-04-06 16:14:16 -05:00
Glenn Randers-Pehrson
c229f65dcf Imported from libpng-1.2.19rc1.tar 2009-04-06 16:14:13 -05:00
Glenn Randers-Pehrson
f929861609 Imported from libpng-1.2.19beta31.tar 2009-04-06 16:14:10 -05:00
Glenn Randers-Pehrson
f024ce7675 Imported from libpng-1.2.19beta30.tar 2009-04-06 16:14:08 -05:00
Glenn Randers-Pehrson
f3fcf00392 Imported from libpng-1.2.19beta29.tar 2009-04-06 16:14:05 -05:00
Glenn Randers-Pehrson
08313ef870 Imported from libpng-1.2.19beta28.tar 2009-04-06 16:14:03 -05:00
Glenn Randers-Pehrson
911c469d69 Imported from libpng-1.2.19beta27.tar 2009-04-06 16:14:00 -05:00
Glenn Randers-Pehrson
07c089ee04 Imported from libpng-1.2.19beta26.tar 2009-04-06 16:13:58 -05:00
Glenn Randers-Pehrson
dadc944810 Imported from libpng-1.2.19beta25.tar 2009-04-06 16:13:55 -05:00
Glenn Randers-Pehrson
80663032a9 Imported from libpng-1.2.19beta24.tar 2009-04-06 16:13:53 -05:00
Glenn Randers-Pehrson
67c75ee7f0 Imported from libpng-1.2.19beta23.tar 2009-04-06 16:13:51 -05:00
Glenn Randers-Pehrson
62626737a5 Imported from libpng-1.2.19beta22.tar 2009-04-06 16:13:48 -05:00
Glenn Randers-Pehrson
e404eed318 Imported from libpng-1.2.19beta21.tar 2009-04-06 16:13:46 -05:00
Glenn Randers-Pehrson
3c115428ea Imported from libpng-1.2.19beta20.tar 2009-04-06 16:13:43 -05:00
Glenn Randers-Pehrson
db40ca4aca Imported from libpng-1.2.19beta19.tar 2009-04-06 16:13:41 -05:00
Glenn Randers-Pehrson
f456d0d6bb Imported from libpng-1.2.19beta18.tar 2009-04-06 16:13:38 -05:00
Glenn Randers-Pehrson
06fe17eb9f Imported from libpng-1.2.19beta17.tar 2009-04-06 16:13:36 -05:00
Glenn Randers-Pehrson
7945bdb88f Imported from libpng-1.2.19beta16.tar 2009-04-06 16:13:33 -05:00
Glenn Randers-Pehrson
f7794ec181 Imported from libpng-1.2.19beta15.tar 2009-04-06 16:13:31 -05:00
Glenn Randers-Pehrson
16851b3eb3 Imported from libpng-1.2.19beta14.tar 2009-04-06 16:13:29 -05:00
Glenn Randers-Pehrson
c72d8d4d29 Imported from libpng-1.2.19beta13.tar 2009-04-06 16:13:26 -05:00
Glenn Randers-Pehrson
2b7436558e Imported from libpng-1.2.19beta12.tar 2009-04-06 16:13:24 -05:00
Glenn Randers-Pehrson
e59c47d5b1 Imported from libpng-1.2.19beta11.tar 2009-04-06 16:13:22 -05:00
Glenn Randers-Pehrson
c1523ad16d Imported from libpng-1.2.19beta10.tar 2009-04-06 16:13:19 -05:00
Glenn Randers-Pehrson
d0be8e27de Imported from libpng-1.2.19beta9.tar 2009-04-06 16:13:17 -05:00
Glenn Randers-Pehrson
5c66b81289 Imported from libpng-1.2.19beta8.tar 2009-04-06 16:13:15 -05:00
Glenn Randers-Pehrson
1a42cb2013 Imported from libpng-1.2.19beta7.tar 2009-04-06 16:13:12 -05:00
Glenn Randers-Pehrson
cf2978cbbb Imported from libpng-1.2.19beta6.tar 2009-04-06 16:13:10 -05:00
Glenn Randers-Pehrson
8a9733e777 Imported from libpng-1.2.19beta5.tar 2009-04-06 16:13:07 -05:00
Glenn Randers-Pehrson
ba880c5501 Imported from libpng-1.2.19beta4.tar 2009-04-06 16:13:05 -05:00
Glenn Randers-Pehrson
788f962fbd Imported from libpng-1.2.19beta3.tar 2009-04-06 16:13:03 -05:00
Glenn Randers-Pehrson
12f8283560 Imported from libpng-1.2.19beta2.tar 2009-04-06 16:13:01 -05:00
Glenn Randers-Pehrson
4d27f6b77b Imported from libpng-1.2.19beta1.tar 2009-04-06 16:12:58 -05:00
Glenn Randers-Pehrson
413ed28246 Imported from libpng-1.2.18.tar 2009-04-06 16:12:56 -05:00
Glenn Randers-Pehrson
ad084f559a Imported from libpng-1.2.17.tar 2009-04-06 16:12:54 -05:00
Glenn Randers-Pehrson
3832ab1c21 Imported from libpng-1.2.17rc4.tar 2009-04-06 16:12:52 -05:00
Glenn Randers-Pehrson
999bceb413 Imported from libpng-1.2.17rc3.tar 2009-04-06 16:12:49 -05:00
Glenn Randers-Pehrson
e8f6605642 Imported from libpng-1.2.17rc2.tar 2009-04-06 16:12:47 -05:00
Glenn Randers-Pehrson
3148c65323 Imported from libpng-1.2.17rc1.tar 2009-04-06 16:12:45 -05:00
Glenn Randers-Pehrson
0a3d2cc68b Imported from libpng-1.2.17beta2.tar 2009-04-06 16:12:43 -05:00
Glenn Randers-Pehrson
11cf76edb3 Imported from libpng-1.2.17beta1.tar 2009-04-06 16:12:40 -05:00
Glenn Randers-Pehrson
8833ad415c Imported from libpng-1.2.16.tar 2009-04-06 16:12:38 -05:00
Glenn Randers-Pehrson
bc290d8e6c Imported from libpng-1.2.16rc1.tar 2009-04-06 16:12:35 -05:00
Glenn Randers-Pehrson
9c5b3a4060 Imported from libpng-1.2.16beta2.tar 2009-04-06 16:12:33 -05:00
Glenn Randers-Pehrson
04bbba55c7 Imported from libpng-1.2.16beta1.tar 2009-04-06 16:12:31 -05:00
Glenn Randers-Pehrson
40b70d5373 Imported from libpng-1.2.15.tar 2009-04-06 16:12:29 -05:00
Glenn Randers-Pehrson
833d32646e Imported from libpng-1.2.15rc5.tar 2009-04-06 16:12:27 -05:00
Glenn Randers-Pehrson
6cdefb3cac Imported from libpng-1.2.15rc4.tar 2009-04-06 16:12:25 -05:00
Glenn Randers-Pehrson
f959d3ee7a Imported from libpng-1.2.15rc3.tar 2009-04-06 16:12:22 -05:00
Glenn Randers-Pehrson
b0952eabc7 Imported from libpng-1.2.15rc2.tar 2009-04-06 16:12:20 -05:00
Glenn Randers-Pehrson
43bb4ba4bf Imported from libpng-1.2.15rc1.tar 2009-04-06 16:12:18 -05:00
Glenn Randers-Pehrson
c2de22abeb Imported from libpng-1.2.15beta6.tar 2009-04-06 16:12:15 -05:00
Glenn Randers-Pehrson
a0113ee049 Imported from libpng-1.2.15beta5.tar 2009-04-06 16:12:13 -05:00
Glenn Randers-Pehrson
05db10fda3 Imported from libpng-1.2.15beta4.tar 2009-04-06 16:12:11 -05:00
Glenn Randers-Pehrson
948ee23a2a Imported from libpng-1.2.15beta3.tar 2009-04-06 16:12:08 -05:00
Glenn Randers-Pehrson
271a2931b6 Imported from libpng-1.2.15beta2.tar 2009-04-06 16:12:06 -05:00
Glenn Randers-Pehrson
9fe05edd47 Imported from libpng-1.2.15beta1.tar 2009-04-06 16:12:04 -05:00
Glenn Randers-Pehrson
c2573702cf Imported from libpng-1.2.14.tar 2009-04-06 16:12:02 -05:00
Glenn Randers-Pehrson
b8e76b586e Imported from libpng-1.2.14rc1.tar 2009-04-06 16:11:59 -05:00
Glenn Randers-Pehrson
11a89964b9 Imported from libpng-1.2.14beta2.tar 2009-04-06 16:11:57 -05:00
Glenn Randers-Pehrson
b5bfcbae59 Imported from libpng-1.2.14beta1.tar 2009-04-06 16:11:55 -05:00
Glenn Randers-Pehrson
efe95a6953 Imported from libpng-1.2.13.tar 2009-04-06 16:11:53 -05:00
Glenn Randers-Pehrson
e88a5eca8b Imported from libpng-1.2.13rc2.tar 2009-04-06 16:11:51 -05:00
Glenn Randers-Pehrson
2e3980e1de Imported from libpng-1.2.13rc1.tar 2009-04-06 16:11:49 -05:00
Glenn Randers-Pehrson
0ff85c6923 Imported from libpng-1.2.13beta1.tar 2009-04-06 16:11:47 -05:00
Glenn Randers-Pehrson
e3358d1839 Imported from libpng-1.2.12.tar 2009-04-06 16:11:45 -05:00
Glenn Randers-Pehrson
f5eac0c7fa Imported from libpng-1.2.11.tar 2009-04-06 16:11:42 -05:00
Glenn Randers-Pehrson
6034592a27 Imported from libpng-1.2.11rc5.tar 2009-04-06 16:11:40 -05:00
Glenn Randers-Pehrson
7b00d826d3 Imported from libpng-1.2.11rc3.tar 2009-04-06 16:11:37 -05:00
Glenn Randers-Pehrson
52ef3586b9 Imported from libpng-1.2.11rc2.tar 2009-04-06 16:11:35 -05:00
Glenn Randers-Pehrson
4118fcdd14 Imported from libpng-1.2.11rc1.tar 2009-04-06 16:11:33 -05:00
Glenn Randers-Pehrson
d9e18047d3 Imported from libpng-1.2.11beta4.tar 2009-04-06 16:11:31 -05:00
Glenn Randers-Pehrson
734f320ade Imported from libpng-1.2.11beta3.tar 2009-04-06 16:11:29 -05:00
Glenn Randers-Pehrson
79f25cdeb2 Imported from libpng-1.2.11beta2cos.tar 2009-04-06 16:11:27 -05:00
Glenn Randers-Pehrson
413f3db617 Imported from libpng-1.2.11beta2.tar 2009-04-06 16:11:25 -05:00
Glenn Randers-Pehrson
4db11d5143 Imported from libpng-1.2.11beta1.tar 2009-04-06 16:11:23 -05:00
Glenn Randers-Pehrson
78d28c6b96 Imported from libpng-1.2.10.tar 2009-04-06 16:11:21 -05:00
Glenn Randers-Pehrson
24df7333a2 Imported from libpng-1.2.10rc3.tar 2009-04-06 16:11:18 -05:00
Glenn Randers-Pehrson
8694cd8bf5 Imported from libpng-1.2.10rc2.tar 2009-04-06 16:11:16 -05:00
555 changed files with 99285 additions and 22084 deletions

81
.appveyor.yml Normal file
View File

@ -0,0 +1,81 @@
version: 1.6.x-{build}
branches:
except:
- /libpng[0-1][0-8]/
- /v[0-1][.][0-8][.][0-9]+/
image:
- Visual Studio 2022
shallow_clone: true
environment:
matrix:
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: x86
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: x64
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: arm64
- TOOLCHAIN: llvm
AUTOMATION: cmake
ARCH: x64
- TOOLCHAIN: msys2
AUTOMATION: cmake
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: cmake
ARCH: x86_64
- TOOLCHAIN: msys2
AUTOMATION: configure
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: configure
ARCH: x86_64
- TOOLCHAIN: msys2
AUTOMATION: makefiles
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: makefiles
ARCH: x86_64
install:
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-ninja'
before_build:
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang'
- 'if "%TOOLCHAIN%"=="msys2" set CI_CMAKE_GENERATOR=Ninja'
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=gcc'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set MSYSTEM=MINGW32'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set MSYSTEM=MINGW64'
- 'set CI_CMAKE_BUILD_FLAGS=-j2'
- 'set CI_CTEST_FLAGS=-j2'
- 'set CI_MAKE_FLAGS=-j2'
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'
build_script:
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'
cache:
- 'C:\tools\vcpkg\installed'
- 'C:\msys64\var\cache\pacman'

94
.cmake-format.yaml Normal file
View File

@ -0,0 +1,94 @@
# https://pypi.org/project/cmakelang
# https://github.com/cheshirekow/cmake_format
# ----------------------
# Options for formatting
# ----------------------
# How wide to allow formatted cmake files
# TODO: Reflow the CMake files to allow setting the maximum line width to 100.
line_width: 255
# How many spaces to tab for indent
tab_size: 2
# If true, lines are indented using tab characters (utf-8 0x09) instead of
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
# require a fractional tab character, the behavior of the fractional
# indentation is governed by <fractional_tab_policy>
use_tabchars: false
# If <use_tabchars> is True, then the value of this variable indicates how
# fractional indentions are handled during whitespace replacement. If set to
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
# to `round-up` fractional indentation is replaced with a single tab character
# (utf-8 0x09) effectively shifting the column to the next tabstop
fractional_tab_policy: "use-space"
# Enable comment markup parsing and reflow
enable_markup: false
# -------------------
# Options for linting
# -------------------
# Lint codes to disable
disabled_codes: [
# TODO:
# Reconcile the CMake variable names with the patterns below, then
# re-enable the "invalid variable name XXX" messages.
"C0103",
# TODO:
# Add brief COMMENT arguments to the `add_custom_target` commands.
"C0113",
]
# Regular expression pattern describing valid function names
function_pattern: "[0-9a-z_]+"
# Regular expression pattern describing valid macro names
macro_pattern: "[0-9A-Z_]+"
# Regular expression pattern describing valid names for variables with global
# (cache) scope
global_var_pattern: "[A-Z][0-9A-Z_]+"
# Regular expression pattern describing valid names for variables with global
# scope (but internal semantic)
internal_var_pattern: "_[A-Z][0-9A-Z_]+"
# Regular expression pattern describing valid names for variables with local
# scope
local_var_pattern: "[a-z][a-z0-9_]+"
# Regular expression pattern describing valid names for privatedirectory
# variables
private_var_pattern: "_[0-9a-z_]+"
# Regular expression pattern describing valid names for public directory
# variables
public_var_pattern: "[A-Z][0-9A-Z_]+"
# Regular expression pattern describing valid names for function/macro
# arguments and loop variables.
argument_var_pattern: "[a-z][a-z0-9_]+"
# Regular expression pattern describing valid names for keywords used in
# functions or macros
keyword_pattern: "[A-Z][0-9A-Z_]+"
# In the heuristic for C0201, how many conditionals to match within a loop in
# before considering the loop a parser
max_conditionals_custom_parser: 2
# Require at least this many newlines between statements;
# require no more than this many newlines between statements;
# etc.
min_statement_spacing: 1
max_statement_spacing: 2
max_returns: 6
max_branches: 12
max_arguments: 5
max_localvars: 15
max_statements: 50

55
.editorconfig Normal file
View File

@ -0,0 +1,55 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[*.txt]
indent_size = unset
indent_style = space
[*.[chS]]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 80
[*.dfa]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 80
[*.awk]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 100
[*.cmake]
indent_size = 2
indent_style = space
max_doc_length = 80
max_line_length = 100
[*.sh]
indent_size = 4
indent_style = space
max_doc_length = 100
max_line_length = 100
[{Makefile.in,aclocal.m4,ltmain.sh}]
indent_size = unset
indent_style = unset
insert_final_newline = unset
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset
[COMMIT_EDITMSG]
indent_style = space
max_doc_length = unset
max_line_length = 72

View File

@ -0,0 +1,9 @@
{
"Disable": {
"IndentSize": true
},
"Exclude": [
".git/",
"out/"
]
}

31
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Linting libpng
on:
push:
branches:
- libpng16
- libpng18
pull_request:
branches:
- libpng16
- libpng18
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up the cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pip.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install yamllint
run: pip install yamllint
- name: Install editorconfig-checker
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Check out the code
uses: actions/checkout@v4
- name: Run the linting script
run: bash ./ci/ci_lint.sh

159
.gitignore vendored Normal file
View File

@ -0,0 +1,159 @@
# Prerequisites
*.d
# Precompiled headers
*.gch
*.pch
# Object files
*.slo
*.lo
*.o
*.obj
# Linker output files
*.exp
*.ilk
*.map
# Compiled dynamic libraries
*.dll
*.dylib
*.so
*.so.*
# Compiled static libraries
*.a
*.la
*.lai
*.lib
# Compiled executables
*.app/
*.exe
a.out
# Debug files
*.dSYM/
*.idb
*.pdb
*.su
# Tag files
TAGS
.TAGS
!TAGS/
tags
.tags
!tags/
gtags.files
GTAGS
GRTAGS
GPATH
GSYMS
cscope.files
cscope.out
cscope.*.out
# Text editing and text processing artifacts
\#*\#
.\#*
[._]*.sw[a-p]
[._]sw[a-p]
*.bak
*.orig
*.rej
*.tmp
*~
# IDE files and directories
## Eclipse
.cproject/
.project/
.settings/
## Embarcadero RAD Studio
*.cbproj.*
__recovery/
## JetBrains
.idea/
## NetBeans
nbbuild/
nbdist/
nbproject/
## Visual Studio
.vs/
### Visual Studio user files
*.rsuser
*.sln.docstates
*.suo
*.user
*.userprefs
### Visual Studio cache files (for older versions)
*.aps
*.ncb
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
ipch/
## Visual Studio Code
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
## (Various)
*.*cache
*.cache*
[._]*_history
.history/
[Bb]ackup*/
# Build, test and CI output directories
*[Dd]ebug/
[Dd]ebug*/
*[Rr]elease/
[Rr]elease*/
[._]build*/
/[Bb]uild*/
/[Oo]ut/
# Libpng configuration and auxiliary build artifacts
*.out
*out.png
[._]deps/
[._]libs/
.dirstamp
/Makefile
/autom4te.cache/
/config*~
/config.h
/config.log
/config.status
/install*~
/libpng*-config
/libpng*.pc
/libpng.vers
/libtool
/stamp-h1
CMake*.json
!CMakePresets.json
CMakeLists.txt.*
pnglibconf.[ch]
pnglibconf.dfn
pnglibconf.pre
pngprefix.h
# Libpng test programs, scripts and artifacts
/test-suite.log
/tests/*.log
/tests/*.trs
/png-fix-itxt
/pngcp
/pngfix
/pngimage
/pngstest
/pngtest
/pngunknown
/pngvalid
/timepng

7
.yamllint.yml Normal file
View File

@ -0,0 +1,7 @@
extends: default
rules:
document-start: disable
document-end: disable
line-length: disable
truthy:
check-keys: false

589
ANNOUNCE
View File

@ -1,568 +1,53 @@
libpng 1.6.51.git
=================
Libpng 1.6.0beta33 - December 10, 2012 This is a development version, not intended to be a public release.
It will be replaced by a public release, or by another development
version, at a later time.
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.
Files available for download: libpng 1.6.50 - July 1, 2025
============================
Source files with LF line endings (for Unix/Linux) and with a This is a public release of libpng, intended for use in production code.
"configure" script
1.6.0beta33.tar.xz (LZMA-compressed, recommended)
1.6.0beta33.tar.gz
1.6.0beta33.tar.bz2
Source files with CRLF line endings (for Windows), without the Files available for download
"configure" script ----------------------------
lp160b33.7z (LZMA-compressed, recommended) Source files with LF line endings (for Unix/Linux):
lp160b33.zip
* libpng-1.6.50.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.50.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
* lpng1650.7z (LZMA-compressed, recommended)
* lpng1650.zip (deflate-compressed)
Other information: Other information:
1.6.0beta33-README.txt * README.md
1.6.0beta33-LICENSE.txt * LICENSE.md
* AUTHORS.md
* TRADEMARK.md
Changes since the last public release (1.5.7):
Version 1.6.0beta01 [December 15, 2011] Changes from version 1.6.49 to version 1.6.50
Removed machine-generated configure files from the GIT repository (they will ---------------------------------------------
continue to appear in the tarball distributions).
Restored the new 'simplified' API, which was started in libpng-1.5.7beta02
but later deleted from libpng-1.5.7beta05.
Added example programs for the new 'simplified' API.
Added ANSI-C (C90) headers and require them, and take advantage of the
change. Also fixed some of the projects/* and contrib/* files that needed
updates for libpng16 and the move of pngvalid.c.
With this change the required ANSI-C header files are assumed to exist: the
implementation must provide float.h, limits.h, stdarg.h and stddef.h and
libpng relies on limits.h and stddef.h existing and behaving as defined
(the other two required headers aren't used). Non-ANSI systems that don't
have stddef.h or limits.h will have to provide an appropriate fake
containing the relevant types and #defines.
The use of FAR/far has been eliminated and the definition of png_alloc_size_t
is now controlled by a flag so that 'small size_t' systems can select it
if necessary. Libpng 1.6 may not currently work on such systems -- it
seems likely that it will ask 'malloc' for more than 65535 bytes with any
image that has a sufficiently large row size (rather than simply failing
to read such images).
New tools directory containing tools used to generate libpng code.
Fixed race conditions in parallel make builds. With higher degrees of
parallelism during 'make' the use of the same temporary file names such
as 'dfn*' can result in a race where a temporary file from one arm of the
build is deleted or overwritten in another arm. This changes the
temporary files for suffix rules to always use $* and ensures that the
non-suffix rules use unique file names.
Version 1.6.0beta02 [December 21, 2011] * Improved the detection of the RVV Extension on the RISC-V platform.
Correct configure builds where build and source directories are separate. (Contributed by Filip Wasil)
The include path of 'config.h' was erroneously made relative in pngvalid.c * Replaced inline ASM with C intrinsics in the RVV code.
in libpng 1.5.7. (Contributed by Filip Wasil)
* Fixed a decoder defect in which unknown chunks trailing IDAT, set
to go through the unknown chunk handler, incorrectly triggered
out-of-place IEND errors.
(Contributed by John Bowler)
* Fixed the CMake file for cross-platform builds that require `libm`.
Version 1.6.0beta03 [December 22, 2011]
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.
Added png_convert_to_rfc1123_buffer() and deprecated png_convert_to_rfc1123()
to avoid including a spurious buffer in the png_struct.
Version 1.6.0beta04 [December 30, 2011] Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Regenerated configure scripts with automake-1.11.2 Subscription is required; visit
Eliminated png_info_destroy(). It is now used only in png.c and only calls
one other internal function and memset().
Enabled png_get_sCAL_fixed() if floating point APIs are enabled. Previously
it was disabled whenever internal fixed point arithmetic was selected,
which meant it didn't exist even on systems where FP was available but not
preferred.
Added pngvalid.c compile time checks for const APIs.
Implemented 'restrict' for png_info and png_struct. 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.
Moved AC_MSG_CHECKING([if libraries can be versioned]) later to the proper
location in configure.ac (Gilles Espinasse).
Changed png_memcpy to C assignment where appropriate. Changed all those
uses of png_memcpy that were doing a simple assignment to assignments
(all those cases where the thing being copied is a non-array C L-value).
Added some error checking to png_set_*() routines.
Removed the reference to the non-exported function png_memcpy() from
example.c.
Fixed the Visual C 64-bit build - it requires jmp_buf to be aligned, but
it had become misaligned.
Revised contrib/pngminus/pnm2png.c to avoid warnings when png_uint_32
and unsigned long are of different sizes.
Version 1.6.0beta05 [January 15, 2012]
Updated manual with description of the simplified API (copied from png.h)
Fix bug in pngerror.c: some long warnings were being improperly truncated
(CVE-2011-3464, bug introduced in libpng-1.5.3beta05).
Version 1.6.0beta06 [January 24, 2012]
Added palette support to the simplified APIs. This commit
changes some of the macro definitions in png.h, app code
may need corresponding changes.
Increased the formatted warning buffer to 192 bytes.
Added color-map support to simplified API. This is an initial version for
review; the documentation has not yet been updated.
Fixed Min/GW uninstall to remove libpng.dll.a
Version 1.6.0beta07 [January 28, 2012]
Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites.
Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
(replaced with 3-character indentation). Obsolete macros identified by
autoupdate have been removed; the replacements are all in 2.59 so
the pre-req hasn't been changed. --enable-werror checks for support
for -Werror (or the given argument) in the compiler. This mimics the
gcc configure option by allowing -Werror to be turned on safely; without
the option the tests written in configure itself fail compilation because
they cause compiler warnings.
Rewrote autogen.sh to run autoreconf instead of running tools one-by-one.
Conditionalize the install rules for MINGW and CYGWIN in CMakeLists.txt and
set CMAKE_LIBRARY_OUTPUT_DIRECTORY to "lib" on all platforms (C. Yapp).
Freeze libtool files in the 'scripts' directory. This version of autogen.sh
attempts to dissuade people from running it when it is not, or should not,
be necessary. In fact, autogen.sh does not work when run in a libpng
directory extracted from atar distribution anymore. You must run it in
a GIT clone instead.
Added two images to contrib/pngsuite (1-bit and 2-bit transparent grayscale),
and renamed three whose names were inconsistent with those in
pngsuite/README.txt.
Version 1.6.0beta08 [February 1, 2012]
Fixed Image::colormap misalignment in pngstest.c
Check libtool/libtoolize version number (2.4.2) in configure.ac
Divide test-pngstest.sh into separate pngstest runs for basic and
transparent images.
Moved automake options to AM_INIT_AUTOMAKE in configure.ac
Added color-tests, silent-rules (Not yet implemented in Makefile.am) and
version checking to configure.ac
Improved pngstest speed by not doing redundant tests and add const to
the background parameter of png_image_finish_read. The --background
option is now done automagically only when required, so that commandline
option no longer exists.
Cleaned up pngpriv.h to consistently declare all functions and data.
Also eliminated PNG_CONST_DATA, which is apparently not needed but we
can't be sure until it is gone.
Added symbol prefixing that allows all the libpng external symbols
to be prefixed (suggested by Reuben Hawkins).
Updated "ftbb*.png" list in the owatcom and vstudio projects.
Fixed 'prefix' builds on clean systems. The generation of pngprefix.h
should not require itself.
Updated INSTALL to explain that autogen.sh must be run in a GIT clone,
not in a libpng directory extracted from a tar distribution.
Version 1.6.0beta09 [February 1, 2012]
Reverted the prebuilt configure files to libpng-1.6.0beta05 condition.
Version 1.6.0beta10 [February 3, 2012]
Added Z_SOLO for zlib-1.2.6+ and correct pngstest tests
Updated list of test images in CMakeLists.txt
Updated the prebuilt configure files to current condition.
Revised INSTALL information about autogen.sh; it works in tar distributions.
Version 1.6.0beta11 [February 16, 2012]
Fix character count in pngstest command in projects/owatcom/pngstest.tgt
Revised test-pngstest.sh to report PASS/FAIL for each image.
Updated documentation about the simplified API.
Corrected estimate of error in libpng png_set_rgb_to_gray API. The API is
extremely inaccurate for sRGB conversions because it uses an 8-bit
intermediate linear value and it does not use the sRGB transform, so it
suffers from the known instability in gamma transforms for values close
to 0 (see Poynton). The net result is that the calculation has a maximum
error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the
permitted 8-bit error. This may still not be enough because of arithmetic
error.
Removed some unused arrays (with #ifdef) from png_read_push_finish_row().
Fixed a memory overwrite bug in simplified read of RGB PNG with
non-linear gamma Also bugs in the error checking in pngread.c and changed
quite a lot of the checks in pngstest.c to be correct; either correctly
written or not over-optimistic. The pngstest changes are insufficient to
allow all possible RGB transforms to be passed; pngstest cmppixel needs
to be rewritten to make it clearer which errors it allows and then changed
to permit known inaccuracies.
Removed tests for no-longer-used *_EMPTY_PLTE_SUPPORTED from pngstruct.h
Fixed fixed/float API export conditionals. 1) If FIXED_POINT or
FLOATING_POINT options were switched off, png.h ended up with lone ';'
characters. This is not valid ANSI-C outside a function. The ';'
characters have been moved inside the definition of PNG_FP_EXPORT and
PNG_FIXED_EXPORT. 2) If either option was switched off, the declaration
of the corresponding functions were completely omitted, even though some
of them are still used internally. The result is still valid, but
produces warnings from gcc with some warning options (including -Wall). The
fix is to cause png.h to declare the functions with PNG_INTERNAL_FUNCTION
when png.h is included from pngpriv.h.
Check for invalid palette index while reading paletted PNG. When one is
found, issue a warning and increase png_ptr->num_palette accordingly.
Apps are responsible for checking to see if that happened.
Version 1.6.0beta12 [February 18, 2012]
Do not increase num_palette on invalid_index.
Relocated check for invalid palette index to pngrtran.c, after unpacking
the sub-8-bit pixels.
Fixed CVE-2011-3026 buffer overrun bug. Deal more correctly with the test
on iCCP chunk length. Also removed spurious casts that may hide problems
on 16-bit systems.
Version 1.6.0beta13 [February 24, 2012]
Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from
pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c;
now that png_ptr->buffer is inaccessible to applications, the special
handling is no longer useful.
Added PNG_SAFE_LIMITS feature to pnglibconf.dfa, pngpriv.h, and new
pngusr.dfa to reset the user limits to safe ones if PNG_SAFE_LIMITS is
defined. To enable, use "CPPFLAGS=-DPNG_SAFE_LIMITS_SUPPORTED=1" on the
configure command or put #define PNG_SAFE_LIMITS_SUPPORTED in
pnglibconf.h.prebuilt and pnglibconf.h.
Version 1.6.0beta14 [February 27, 2012]
Added information about the new limits in the manual.
Updated Makefile.in
Version 1.6.0beta15 [March 2, 2012]
Removed unused "current_text" members of png_struct and the png_free()
of png_ptr->current_text from pngread.c
Rewrote pngstest.c for substantial speed improvement.
Fixed transparent pixel and 16-bit rgb tests in pngstest and removed a
spurious check in pngwrite.c
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.
Improved pngstest fine tuning of error numbers, new test file generator.
The generator generates images that test the full range of sample values,
allow the error numbers in pngstest to be tuned and checked. makepng
also allows generation of images with extra chunks, although this is
still work-in-progress.
Added tests for invalid palette index while reading and writing (work in
progress, the latter isn't finished).
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.
Removed whitespace from the end of lines in all source files and scripts.
Version 1.6.0beta16 [March 6, 2012]
Relocated palette-index checking function from pngrutil.c to pngtrans.c
Added palette-index checking while writing.
Changed png_inflate() and calling routines to avoid overflow problems.
This is an intermediate check-in that solves the immediate problems and
introduces one performance improvement (avoiding a copy via png_ptr->zbuf.)
Further changes will be made to make ICC profile handling more secure.
Fixed build warnings (MSVC, GCC, GCC v3). Cygwin GCC with default options
declares 'index' as a global, causing a warning if it is used as a local
variable. GCC 64-bit warns about assigning a (size_t) (unsigned 64-bit)
to an (int) (signed 32-bit). MSVC, however, warns about using the
unary '-' operator on an unsigned value (even though it is well defined
by ANSI-C to be ~x+1). The padding calculation was changed to use a
different method. Removed the tests on png_ptr->pass.
Added contrib/libtests/tarith.c to test internal arithmetic functions from
png.c. This is a libpng maintainer program used to validate changes to the
internal arithmetic functions.
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.
Validate the zTXt strings in pngvalid.
Added code to validate the windowBits value passed to deflateInit2().
If the call to deflateInit2() is wrong a png_warning will be issued
(in fact this is harmless, but the PNG data produced may be sub-optimal).
Version 1.6.0beta17 [March 10, 2012]
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
Reject all iCCP chunks after the first, even if the first one is invalid.
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.
If benign errors are disabled use maximum window on ancilliary inflate.
This works round a bug introduced in 1.5.4 where compressed ancillary
chunks could end up with a too-small windowBits value in the deflate
header.
Version 1.6.0beta18 [March 16, 2012]
Issue a png_benign_error() instead of png_warning() about bad palette index.
In pngtest, treat benign errors as errors if "-strict" is present.
Fixed an off-by-one error in the palette index checking function.
Fixed a compiler warning under Cygwin (Windows-7, 32-bit system)
Revised example.c to put text strings in a temporary character array
instead of directly assigning string constants to png_textp members.
This avoids compiler warnings when -Wwrite-strings is enabled.
Added output flushing to aid debugging under Visual Studio. Unfortunately
this is necessary because the VS2010 output window otherwise simply loses
the error messages on error (they weren't flushed to the window before
the process exited, apparently!)
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 warnings (regardless of the system default, unless
this is disabled in which case the simplified API can't be built.)
Version 1.6.0beta19 [March 18,2012]
Work around for duplicate row start calls; added warning messages.
This turns on PNG_FLAG_DETECT_UNINITIALIZED to detect app code that
fails to call one of the 'start' routines (not enabled in libpng-1.5
because it is technically an API change, since it did normally work
before.) It also makes duplicate calls to png_read_start_row (an
internal function called at the start of the image read) benign, as
they were before changes to use png_inflate_claim. Somehow webkit is
causing this to happen; this is probably a mis-feature in the zlib
changes so this commit is only a work-round.
Removed erroneous setting of DETECT_UNINITIALIZED and added more
checks. The code now does a png_error if an attempt is made to do the
row initialization twice; this is an application error and it has
serious consequences because the transform data in png_struct is
changed by each call.
Added application error reporting and added chunk names to read
benign errors; also added --strict to pngstest - not enabled
yet because a warning is produced.
Avoid the double gamma correction warning in the simplified API.
This allows the --strict option to pass in the pngstest checks
Version 1.6.0beta20 [March 29, 2012]
Changed chunk handler warnings into benign errors, incrementally load iCCP
Added checksum-icc.c to contrib/tools
Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
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.
Revised png_set_text_2() to avoid potential memory corruption (fixes
CVE-2011-3048, also known as CVE-2012-3425).
Version 1.6.0beta21 [April 27, 2012]
Revised scripts/makefile.darwin: use system zlib; remove quotes around
architecture list; add missing ppc architecture; add architecture options
to shared library link; don't try to create a shared lib based on missing
RELEASE variable.
Enable png_set_check_for_invalid_index() for both read and write.
Removed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpriv.h around
declaration of png_handle_unknown().
Added -lssp_nonshared in a comment in scripts/makefile.freebsd
and changed deprecated NOOBJ and NOPROFILE to NO_OBJ and NO_PROFILE.
Version 1.6.0beta22 [May 23, 2012]
Removed need for -Wno-cast-align with clang. clang correctly warns on
alignment increasing pointer casts when -Wcast-align is passed. This
fixes the cases that clang warns about either by eliminating the
casts from png_bytep to png_uint_16p (pngread.c), or, for pngrutil.c
where the cast is previously verified or pngstest.c where it is OK, by
introducing new png_aligncast macros to do the cast in a way that clang
accepts.
Version 1.6.0beta23 [June 6, 2012]
Revised CMakeLists.txt to not attempt to make a symlink under mingw.
Made fixes for new optimization warnings from gcc 4.7.0. The compiler
performs an optimization which is safe; however it then warns about it.
Changing the type of 'palette_number' in pngvalid.c removes the warning.
Do not depend upon a GCC feature macro being available for use in generating
the linker mapfile symbol prefix.
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.
Version 1.6.0beta24 [June 7, 2012]
Don't check palette indexes if num_palette is 0 (as it can be in MNG files).
Version 1.6.0beta25 [June 16, 2012]
Revised png_set_keep_unknown_chunks() so num_chunks < 0 means ignore all
unknown chunks and all known chunks except for IHDR, PLTE, tRNS, IDAT,
and IEND. Previously it only meant ignore all unknown chunks, the
same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
provide a list of chunks to be processed instead of a list of chunks to
ignore. Revised contrib/gregbook/readpng2.c accordingly.
Version 1.6.0beta26 [July 10, 2012]
Removed scripts/makefile.cegcc from the *.zip and *.7z distributions; it
depends on configure, which is not included in those archives.
Moved scripts/chkfmt to contrib/tools.
Changed "a+w" to "u+w" in Makefile.in to fix CVE-2012-3386.
Version 1.6.0beta27 [August 11, 2012]
Do not compile PNG_DEPRECATED, PNG_ALLOC and PNG_PRIVATE when __GNUC__ < 3.
Do not use __restrict when GNUC is <= 3.1
Removed references to png_zalloc() and png_zfree() from the manual.
Fixed configurations where floating point is completely disabled. Because
of the changes to support symbol prefixing PNG_INTERNAL_FUNCTION declares
floating point APIs during libpng builds even if they are completely
disabled. This requires the png floating point types (png_double*) to be
declared even though the functions are never actually defined. This
change provides a dummy definition so that the declarations work, yet any
implementation will fail to compile because of an incomplete type.
Re-eliminated the use of strcpy() in pngtest.c. An unncessary use of
strcpy() was accidentally re-introduced in libpng16; this change replaces
it with strncpy().
Eliminated use of png_sizeof(); use sizeof() instead.
Use a consistent style for (sizeof type) and (sizeof (array))
Cleanup of png_set_filler(). This function does very different things on
read and write. In libpng 1.6 the two cases can be distinguished and
considerable code cleanup, and extra error checking, is possible. This
makes calls on the write side that have no effect be ignored with a
png_app_error(), which can be disabled in the app using
png_set_benign_errors(), and removes the spurious use of usr_channels
on the read side.
Insist on autotools 1.12.1 for git builds because there are security issues
with 1.12 and insisting on anything less would allow 1.12 to be used.
Removed info_ptr->signature[8] from WRITE-only builds.
Add some conditions for compiling png_fixed(). This is a small function
but it requires "-lm" on some platforms.
Cause pngtest --strict to fail on any warning from libpng (not just errors)
and cause it not to fail at the comparison step if libpng lacks support
for writing chunks that it reads from the input (currently only implemented
for compressed text chunks).
Make all three "make check" test programs work without READ or WRITE support.
Now "make check" will succeed even if libpng is compiled with -DPNG_NO_READ
or -DPNG_NO_WRITE. The tests performed are reduced, but the basic reading
and writing of a PNG file is always tested by one or more of the tests.
Consistently use strlen(), memset(), memcpy(), and memcmp() instead of the
png_strlen(), png_memset(), png_memcpy(), and png_memcmp() macros.
Removed the png_sizeof(), png_strlen(), png_memset(), png_memcpy(), and
png_memcmp() macros.
Work around gcc 3.x and Microsoft Visual Studio 2010 complaints. Both object
to the split initialization of num_chunks.
Version 1.6.0beta28 [August 29, 2012]
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.
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.
Corrected fix for unknown handling in pngtest. This reinstates the
libpng handling of unknown chunks other than vpAg and sTER (including
unsafe-to-copy chunks which were dropped before) and eliminates the
repositioning of vpAg and sTER in pngtest.png by changing pngtest.png
(so the chunks are where libpng would put them).
Added "tunknown" test and corrected a logic error in png_handle_unknown()
when SAVE support is absent. Moved the shell test scripts for
contrib/libtests from the libpng top directory to contrib/libtests.
png_handle_unknown() must always read or skip the chunk, if
SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
a user callback an unknown chunk will not be read, leading to a read
error, which was revealed by the "tunknown" test.
Cleaned up and corrected ICC profile handling.
contrib/libtests/makepng: corrected 'rgb' and 'gray' cases. profile_error
messages could be truncated; made a correct buffer size calculation and
adjusted pngerror.c appropriately. png_icc_check_* checking improved;
changed the functions to receive the correct color type of the PNG on read
or write and check that it matches the color space of the profile (despite
what the comments said before, there is danger in assuming the app will
cope correctly with an RGB profile on a grayscale image and, since it
violates the PNG spec, allowing it is certain to produce inconsistent
app behavior and might even cause app crashes.) Check that profiles
contain the tags needed to process the PNG (tags all required by the ICC
spec). Removed unused PNG_STATIC from pngpriv.h.
Version 1.6.0beta29 [September 4, 2012]
Fixed the simplified API example programs and improved the error message
if the version field is not set.
Added contrib/examples/* to the *.zip and *.7z distributions.
Updated simplified API synopses and description of the png_image structure
in the manual.
Made makepng and pngtest produce identical PNGs, add "--relaxed" option
to pngtest. The "--relaxed" option turns off the benign errors that are
enabled by default in pre-RC builds. makepng can now write ICC profiles
where the length has not been extended to a multiple of 4, and pngtest
now intercepts all libpng errors, allowing the previously-introduced
"--strict test" on no warnings to actually work.
Improved ICC profile handling including cHRM chunk generation and fixed
Cygwin+MSVC build errors. The ICC profile handling now includes more
checking. Several errors that caused rejection of the profile are now
handled with a warning in such a way that the invalid profiles will be
read by default in release (but not pre-RC) builds but will not be
written by default. The easy part of handling the cHRM chunk is written,
where the ICC profile contains the required data. The more difficult
part plus guessing a gAMA value requires code to pass selected RGB values
through the profile.
Version 1.6.0beta30 [October 24, 2012]
Changed ICC profile matrix/vector types to not depend on array type rules.
By the ANSI-C standard the new types should be identical to the previous
versions, and all known versions of gcc tested with the previous versions
except for GCC-4.2.1 work with this version. The change makes the ANSI-C
rule that const applied to an array of elements applies instead to the
elements in the array moot by explicitly applying const to the base
elements of the png_icc_matrix and png_icc_vector types. The accidental
(harmless) 'const' previously applied to the parameters of two of the
functions have also been removed.
Added a work around for GCC 4.2 optimization bug.
Marked the broken (bad white point) original HP sRGB profiles correctly and
correct comments.
Added -DZ_SOLO to contrib/pngminim/*/makefile to work with zlib-1.2.7
Use /MDd for vstudio debug builds. Also added pngunkown to the vstudio
builds, fixed build errors and corrected a minor exit code error in
pngvalid if the 'touch' file name is invalid.
Add updated WARNING file to projects/vstudio from libpng 1.5/vstudio
Fixed build when using #define PNG_NO_READ_GAMMA in png_do_compose() in
pngrtran.c (Domani Hannes).
Version 1.6.0beta31 [November 1, 2012]
Undid the erroneous change to vstudio/pngvalid build in libpng-1.6.0beta30.
Made pngvalid so that it will build outside the libpng source tree.
Made builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail).
Made PNG_NO_READ_GAMMA switch off interfaces that depend on READ_GAMMA.
Prior to 1.6.0 switching off READ_GAMMA did unpredictable things to the
interfaces that use it (specifically, png_do_background in 1.4 would
simply display composite for grayscale images but do composition
with the incorrect arithmetic for color ones). In 1.6 the semantic
of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
depends on it; this obliges people who set it to consider whether they
really want it off if they happen to use any of the interfaces in
question (typically most users who disable it won't).
Fixed GUIDs in projects/vstudio. Some were duplicated or missing,
resulting in VS2010 having to update the files.
Removed non-working ICC profile support code that was mostly added to
libpng-1.6.0beta29 and beta30. There was too much code for too little
gain; implementing full ICC color correction may be desireable but is left
up to applications.
Version 1.6.0beta32 [November 25, 2012]
Fixed an intermittent SEGV in pngstest due to an uninitialized array element.
Added the ability for contrib/libtests/makepng.c to make a PNG with just one
color. This is useful for debugging pngstest color inaccuracy reports.
Fixed error checking in the simplified write API (Olaf van der Spek)
Made png_user_version_check() ok to use with libpng version 1.10.x and later.
Version 1.6.0beta33 [December 10, 2012]
Fixed typo in png.c (PNG_SET_CHUNK_MALLOC_MAX should be PNG_CHUNK_MALLOC_MAX)
that causes the MALLOC_MAX limit not to work (John Bowler)
Change png_warning() to png_app_error() in pngwrite.c and comment the
fall-through condition.
Change png_warning() to png_app_warning() in png_write_tRNS().
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) to subscribe.
or to glennrp at users.sourceforge.net
Glenn R-P

66
AUTHORS Normal file
View File

@ -0,0 +1,66 @@
PNG REFERENCE LIBRARY AUTHORS
=============================
This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
* Adam Richter
* Andreas Dilger
* Chris Blume
* Cosmin Truta
* Dave Martindale
* Eric S. Raymond
* Gilles Vollant
* Glenn Randers-Pehrson
* Greg Roelofs
* Guy Eric Schalnat
* James Yu
* John Bowler
* Kevin Bracey
* Lucas Chollet
* Magnus Holmgren
* Mandar Sahastrabuddhe
* Manfred Schlaegl
* Mans Rullgard
* Matt Sarett
* Mike Klein
* Pascal Massimino
* Paul Schmidt
* Philippe Antoine
* Qiang Zhou
* Sam Bushell
* Samuel Williams
* Simon-Pierre Cadieux
* Tim Wegner
* Tom Lane
* Tom Tanner
* Vadim Barkov
* Willem van Schaik
* Zhijie Liang
* Apple Inc.
- Zixu Wang (王子旭)
* Arm Holdings
- Richard Townsend
* Google LLC
- Dan Field
- Dragoș Tiselice
- Leon Scroggins III
- Matt Sarett
- Mike Klein
- Sami Boukortt
- Wan-Teh Chang
* Loongson Technology Corporation Ltd.
- GuXiWei (顾希伟)
- JinBo (金波)
- ZhangLixia (张利霞)
* Samsung Group
- Filip Wasil
The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have
other copyright owners, but are released under the libpng license.
Some files in the "ci" and "contrib" directories, as well as some
of the tools-generated files that are distributed with libpng, have
other copyright owners, and are released under other open source
licenses.

2095
CHANGES

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

436
INSTALL
View File

@ -1,5 +1,27 @@
Installing libpng
Installing libpng Contents
I. Simple installation
II. Rebuilding the configure scripts
III. Using scripts/makefile*
IV. Using cmake
V. Directory structure
VI. Building with project files
VII. Building with makefiles
VIII. Configuring libpng for 16-bit platforms
IX. Configuring for DOS
X. Configuring for Medium Model
XI. Prepending a prefix to exported symbols
XII. Configuring for compiler xxx:
XIII. Removing unwanted object code
XIV. Enabling or disabling hardware optimizations
XV. Changes to the build and configuration of libpng in libpng-1.5.x
XVI. Setjmp/longjmp issues
XVII. Common linking failures
XVIII. Other sources of information about libpng
I. Simple installation
On Unix/Linux and similar systems, you can simply type On Unix/Linux and similar systems, you can simply type
@ -7,13 +29,28 @@ On Unix/Linux and similar systems, you can simply type
make check make check
make install make install
and ignore the rest of this document. and ignore the rest of this document. "/path" is the path to the directory
where you want to install the libpng "lib", "include", and "bin"
subdirectories.
If you downloaded a GIT clone, you will need to run ./autogen.sh before
running ./configure, to create "configure" and "Makefile.in" which are
not included in the GIT repository.
Note that "configure" is only included in the "*.tar" distributions and not
in the "*.zip" or "*.7z" distributions. If you downloaded one of those
distributions, see "Building with project files" or "Building with makefiles",
below.
II. Rebuilding the configure scripts
If configure does not work on your system, or if you have a need to If configure does not work on your system, or if you have a need to
change configure.ac or Makefile.am, and you have a reasonably change configure.ac or Makefile.am, and you have a reasonably
up-to-date set of tools, running ./autogen.sh in a git clone before up-to-date set of tools, running ./autogen.sh in a git clone before
running ./configure may fix the problem. To be really sure that you running ./configure may fix the problem. To be really sure that you
aren't using any of the included pre-built scripts, you can do this: aren't using any of the included pre-built scripts, especially if you
are building from a tar distribution instead of a git distribution,
do this:
./configure --enable-maintainer-mode ./configure --enable-maintainer-mode
make maintainer-clean make maintainer-clean
@ -24,9 +61,12 @@ aren't using any of the included pre-built scripts, you can do this:
make install make install
make check make check
III. Using scripts/makefile*
Instead, you can use one of the custom-built makefiles in the Instead, you can use one of the custom-built makefiles in the
"scripts" directory "scripts" directory
cp scripts/pnglibconf.h.prebuilt pnglibconf.h
cp scripts/makefile.system makefile cp scripts/makefile.system makefile
make test make test
make install make install
@ -38,46 +78,67 @@ Or you can use one of the "projects" in the "projects" directory.
Before installing libpng, you must first install zlib, if it Before installing libpng, you must first install zlib, if it
is not already on your system. zlib can usually be found is not already on your system. zlib can usually be found
wherever you got libpng. zlib can be placed in another directory, wherever you got libpng; otherwise go to https://zlib.net/. You can
at the same level as libpng. place zlib in the same directory as libpng or in another directory.
If you want to use "cmake" (see www.cmake.org), type
cmake . -DCMAKE_INSTALL_PREFIX=/path
make
make install
If your system already has a preinstalled zlib you will still need If your system already has a preinstalled zlib you will still need
to have access to the zlib.h and zconf.h include files that to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed. correspond to the version of zlib that's installed.
If you wish to test with a particular zlib that is not first in the
standard library search path, put ZLIBLIB, ZLIBINC, CPPFLAGS, LDFLAGS,
and LD_LIBRARY_PATH in your environment before running "make test"
or "make distcheck":
ZLIBLIB=/path/to/lib export ZLIBLIB
ZLIBINC=/path/to/include export ZLIBINC
CPPFLAGS="-I$ZLIBINC" export CPPFLAGS
LDFLAGS="-L$ZLIBLIB" export LDFLAGS
LD_LIBRARY_PATH="$ZLIBLIB:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
If you are using one of the makefile scripts, put ZLIBLIB and ZLIBINC
in your environment and type
make ZLIBLIB=$ZLIBLIB ZLIBINC=$ZLIBINC test
IV. Using cmake
If you want to use "cmake" (see www.cmake.org), type
cmake . -DCMAKE_INSTALL_PREFIX=/path
make
make install
As when using the simple configure method described above, "/path" points to
the installation directory where you want to put the libpng "lib", "include",
and "bin" subdirectories.
V. Directory structure
You can rename the directories that you downloaded (they You can rename the directories that you downloaded (they
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.5" might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.8"
or "zlib125") so that you have directories called "zlib" and "libpng". or "zlib128") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this: Your directory structure should look like this:
.. (the parent directory) .. (the parent directory)
libpng (this directory) libpng (this directory)
INSTALL (this file) INSTALL (this file)
README README
*.h *.h, *.c => libpng source files
*.c
CMakeLists.txt => "cmake" script CMakeLists.txt => "cmake" script
ci
ci_*.sh
configuration files: configuration files:
configure.ac, configure, Makefile.am, Makefile.in, configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in, autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub, libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, mkinstalldirs, test-pngtest.sh depcomp, install-sh, mkinstalldirs, test-pngtest.sh, etc.
contrib contrib
gregbook arm-neon, conftest, examples, gregbook, libtests, pngminim,
pngminim pngminus, pngsuite, tools, visupng, riscv-rvv
pngminus
pngsuite
visupng
projects projects
visualc71 owatcom, visualc71, vstudio
vstudio
scripts scripts
makefile.* makefile.*
*.def (module definition files) *.def (module definition files)
@ -85,29 +146,35 @@ Your directory structure should look like this:
pngtest.png pngtest.png
etc. etc.
zlib zlib
README README, *.h, *.c, contrib, etc.
*.h
*.c
contrib
etc.
If the line endings in the files look funny, you may wish to get the other If the line endings in the files look funny, you may wish to get the other
distribution of libpng. It is available in both tar.gz (UNIX style line distribution of libpng. It is available in both tar.gz (UNIX style line
endings) and zip (DOS style line endings) formats. endings) and zip (DOS style line endings) formats.
If you are building libpng with MSVC, you can enter the VI. Building with project files
libpng projects\visualc6 or visualc71 directory and follow the instructions
in README.txt.
Otherwise enter the zlib directory and follow the instructions in zlib/README, If you are building libpng with Microsoft Visual Studio, you can enter
then come back here and run "configure" or choose the appropriate the directory projects\visualc71 or projects\vstudio and follow the
makefile.sys in the scripts directory. instructions in README.txt.
Otherwise, enter the zlib directory and follow the instructions in
zlib/README, then come back here and run "configure" or choose the
appropriate makefile in the scripts directory.
VII. Building with makefiles
Copy the file (or files) that you need from the Copy the file (or files) that you need from the
scripts directory into this directory, for example scripts directory into this directory, for example
MSDOS example: copy scripts\makefile.msc makefile UNIX example:
UNIX example: cp scripts/makefile.std makefile
cp scripts/makefile.std Makefile
make
Windows example:
nmake -f scripts\makefile.vcwin32
Read the makefile to see if you need to change any source or Read the makefile to see if you need to change any source or
target directories to match your preferences. target directories to match your preferences.
@ -124,32 +191,277 @@ test. For more confidence, you can run another test by typing
Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare
your output with the result shown in contrib/pngsuite/README. your output with the result shown in contrib/pngsuite/README.
Most of the makefiles will allow you to run "make install" to Most of the makefiles used to allow you to run "make install" to put
put the library in its final resting place (if you want to the library in its final resting place, but that feature is no longer
do that, run "make install" in the zlib directory first if necessary). supported. The only tested and supported manners to install libpng are
Some also allow you to run "make test-installed" after you have the conventional build and install procedures driven by the configure
run "make install". script or by the CMake file.
VIII. Configuring for DOS and other 16-bit platforms
Officially, the support for 16-bit platforms has been removed.
For DOS users who only have access to the lower 640K, you will
have to limit zlib's memory usage via a png_set_compression_mem_level()
call. See zlib.h or zconf.h in the zlib library for more information.
You may be or may not be in luck if you target the "large" memory model,
but all the smaller models ("small", "compact" and "medium") are known
to be unworkable. For DOS users who have access beyond the lower 640K,
a "flat" 32-bit DOS model (such as DJGPP) is strongly recommended.
For DOS users who only have access to the lower 640K, you will have to
limit zlib's memory usage via a png_set_compression_mem_level() call.
You will also have to look into zconf.h to tell zlib (and thus libpng)
that it cannot allocate more than 64K at a time. Even if you can, the
memory won't be accessible. Therefore, you should limit zlib and libpng
to 64K by defining MAXSEG_64K.
IX. Prepending a prefix to exported symbols
Starting with libpng-1.6.0, you can configure libpng (when using the
"configure" script) to prefix all exported symbols by means of the
configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any
string beginning with a letter and containing only uppercase
and lowercase letters, digits, and the underscore (i.e., a C language
identifier). This creates a set of macros in pnglibconf.h, so this is
transparent to applications; their function calls get transformed by
the macros to use the modified names.
X. Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it.
The includes that are not needed outside libpng are placed in pngpriv.h,
which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h and, as of libpng-1.5.0, pnglibconf.h.
As of libpng-1.5.0, pngpriv.h also includes three other private header
files, pngstruct.h, pnginfo.h, and pngdebug.h, which contain material
that previously appeared in the public headers.
XI. Removing unwanted object code
There are a bunch of #define's in pngconf.h that control what parts of
libpng are compiled. All the defines end in _SUPPORTED. If you are
never going to use a capability, you can change the #define to #undef
before recompiling libpng and save yourself code and data space, or
you can turn off individual capabilities with defines that begin with
"PNG_NO_".
In libpng-1.5.0 and later, the #define's are in pnglibconf.h instead.
You can also turn all of the transforms and ancillary chunk capabilities
off en masse with compiler directives that define
PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS,
or all four, along with directives to turn on any of the capabilities that
you do want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the
extra transformations but still leave the library fully capable of reading
and writing PNG files with all known public chunks. Use of the
PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library
that is incapable of reading or writing ancillary chunks. If you are
not using the progressive reading capability, you can turn that off
with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING
capability, which you'll still have).
All the reading and writing specific code are in separate files, so the
linker should only grab the files it needs. However, if you want to
make sure, or if you are building a stand alone library, all the
reading files start with "pngr" and all the writing files start with "pngw".
The files that don't match either (like png.c, pngtrans.c, etc.)
are used for both reading and writing, and always need to be included.
The progressive reader is in pngpread.c
If you are creating or distributing a dynamically linked library (a .so
or DLL file), you should not remove or disable any parts of the library,
as this will cause applications linked with different versions of the
library to fail if they call functions not available in your library.
The size of the library itself should not be an issue, because only
those sections that are actually used will be loaded into memory.
XII. Enabling or disabling hardware optimizations
Certain hardware capabilities, such as the Intel SSE instructions,
are normally detected at run time. Enable them with configure options
such as one of
--enable-arm-neon=yes
--enable-mips-msa=yes
--enable-intel-sse=yes
--enable-powerpc-vsx=yes
--enable-riscv-rvv=yes
or enable them all at once with
--enable-hardware-optimizations=yes
or, if you are not using "configure", you can use one
or more of
CPPFLAGS += "-DPNG_ARM_NEON"
CPPFLAGS += "-DPNG_MIPS_MSA"
CPPFLAGS += "-DPNG_INTEL_SSE"
CPPFLAGS += "-DPNG_POWERPC_VSX"
CPPFLAGS += "-DPNG_RISCV_RVV"
See for example scripts/makefile.linux-opt
If you wish to avoid using them,
you can disable them via the configure option
--disable-hardware-optimizations
to disable them all, or
--enable-intel-sse=no
to disable a particular one,
or via compiler-command options such as
CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
-DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0,
-DPNG_RISCV_RVV_OPT=0"
If you are using cmake, hardware optimizations are "on"
by default. To disable them, use
cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
-DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no \
-DPNG_RISCV_RVV=no
or disable them all at once with
cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
XIII. Changes to the build and configuration of libpng in libpng-1.5.x
Details of internal changes to the library code can be found in the CHANGES
file and in the GIT repository logs. These will be of no concern to the vast
majority of library users or builders; however, the few who configure libpng
to a non-default feature set may need to change how this is done.
There should be no need for library builders to alter build scripts if
these use the distributed build support - configure or the makefiles -
however, users of the makefiles may care to update their build scripts
to build pnglibconf.h where the corresponding makefile does not do so.
Building libpng with a non-default configuration has changed completely.
The old method using pngusr.h should still work correctly even though the
way pngusr.h is used in the build has been changed; however, library
builders will probably want to examine the changes to take advantage of
new capabilities and to simplify their build system.
A. Specific changes to library configuration capabilities
The exact mechanism used to control attributes of API functions has
changed. A single set of operating system independent macro definitions
is used and operating system specific directives are defined in
pnglibconf.h
As part of this the mechanism used to choose procedure call standards on
those systems that allow a choice has been changed. At present this only
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
running on Intel processors. As before, PNGAPI is defined where required
to control the exported API functions; however, two new macros, PNGCBAPI
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
(PNGCAPI) for functions that must match a C library prototype (currently
only png_longjmp_ptr, which must match the C longjmp function.) The new
approach is documented in pngconf.h
Despite these changes, libpng 1.5.0 only supports the native C function
calling standard on those platforms tested so far ("__cdecl" on Microsoft
Windows). This is because the support requirements for alternative
calling conventions seem to no longer exist. Developers who find it
necessary to set PNG_API_RULE to 1 should advise the mailing list
(png-mng-implement) of this and library builders who use Openwatcom and
therefore set PNG_API_RULE to 2 should also contact the mailing list.
B. Changes to the configuration mechanism
Prior to libpng-1.5.0 library builders who needed to configure libpng
had either to modify the exported pngconf.h header file to add system
specific configuration or had to write feature selection macros into
pngusr.h and cause this to be included into pngconf.h by defining
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
application built without PNG_USER_CONFIG defined would see the
unmodified, default, libpng API and thus would probably fail to link.
These mechanisms still work in the configure build and in any makefile
build that builds pnglibconf.h, although the feature selection macros
have changed somewhat as described above. In 1.5.0, however, pngusr.h is
processed only once, at the time the exported header file pnglibconf.h is
built. pngconf.h no longer includes pngusr.h; therefore, pngusr.h is ignored
after the build of pnglibconf.h and it is never included in an application
build.
The formerly used alternative of adding a list of feature macros to the
CPPFLAGS setting in the build also still works; however, the macros will be
copied to pnglibconf.h and this may produce macro redefinition warnings
when the individual C files are compiled.
All configuration now only works if pnglibconf.h is built from
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
(the original author of awk) maintains C source code of that awk and this
and all known later implementations (often called by subtly different
names - nawk and gawk for example) are adequate to build pnglibconf.h.
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
and does not work; this may also apply to other systems that have a
functioning awk called 'nawk'.
Configuration options are now documented in scripts/pnglibconf.dfa. This
file also includes dependency information that ensures a configuration is
consistent; that is, if a feature is switched off, dependent features are
also switched off. As a recommended alternative to using feature macros in
pngusr.h a system builder may also define equivalent options in pngusr.dfa
(or, indeed, any file) and add that to the configuration by setting
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
how to do this, and also illustrate a case where pngusr.h is still required.
After you have built libpng, the definitions that were recorded in
pnglibconf.h are available to your application (pnglibconf.h is included
in png.h and gets installed alongside png.h and pngconf.h in your
$PREFIX/include directory). Do not edit pnglibconf.h after you have built
libpng, because than the settings would not accurately reflect the settings
that were used to build libpng.
XIV. Setjmp/longjmp issues
Libpng uses setjmp()/longjmp() for error handling. Unfortunately setjmp()
is known to be not thread-safe on some platforms and we don't know of
any platform where it is guaranteed to be thread-safe. Therefore, if
your application is going to be using multiple threads, you should
configure libpng with PNG_NO_SETJMP in your pngusr.dfa file, with
-DPNG_NO_SETJMP on your compile line, or with
#undef PNG_SETJMP_SUPPORTED
in your pnglibconf.h or pngusr.h.
Starting with libpng-1.6.0, the library included a "simplified API".
This requires setjmp/longjmp, so you must either build the library
with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
XV. Common linking failures
If your application fails to find libpng or zlib entries while linking:
Be sure "-lz" appears after "-lpng" on your linking command.
Be sure you have built libpng, zlib, and your application for the
same platform (e.g., 32-bit or 64-bit).
If you are using the vstudio project, observe the WARNING in
project/vstudio/README.txt.
XVI. Other sources of information about libpng:
Further information can be found in the README and libpng-manual.txt Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5. libpng.3 and png.5.
Using the ./configure script -- 16 December 2002. Copyright (c) 2022 Cosmin Truta
================================================= Copyright (c) 1998-2002,2006-2016 Glenn Randers-Pehrson
This document is released under the libpng license.
The ./configure script should work compatibly with what scripts/makefile.* For conditions of distribution and use, see the disclaimer
did, however there are some options you might need to add to configure and license in png.h.
explicitly, which previously was done semi-automatically (if you didn't edit
scripts/makefile.* yourself, that is)
CFLAGS="-Wall -O -funroll-loops \
-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \
--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include
You can alternatively specify --includedir=/usr/include, /usr/local/include,
/usr/include/libpng%NN%, or whatever.
If you find that the configure script is out-of-date or is not supporting
your platform properly, try running autogen.sh to regenerate "configure",
"Makefile.in", and the other configuration files. Then try configure again.

181
LICENSE
View File

@ -1,111 +1,134 @@
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
=========================================
This copy of the libpng notices is provided for your convenience. In case of PNG Reference Library License version 2
any discrepancy between this copy and the notices in the file png.h that is ---------------------------------------
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: * Copyright (c) 1995-2025 The PNG Reference Library Authors.
* Copyright (c) 2018-2025 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
If you modify libpng you may insert additional notices immediately following The software is supplied "as is", without warranty of any kind,
this sentence. express or implied, including, without limitation, the warranties
of merchantability, fitness for a particular purpose, title, and
non-infringement. In no event shall the Copyright owners, or
anyone distributing the software, be liable for any damages or
other liability, whether in contract, tort or otherwise, arising
from, out of, or in connection with the software, or the use or
other dealings in the software, even if advised of the possibility
of such damage.
This code is released under the libpng license. Permission is hereby granted to use, copy, modify, and distribute
this software, or portions hereof, for any purpose, without fee,
subject to the following restrictions:
libpng versions 1.2.6, August 15, 2004, through 1.6.0beta33, December 10, 2012, are 1. The origin of this software must not be misrepresented; you
Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are must not claim that you wrote the original software. If you
distributed according to the same disclaimer and license as libpng-1.2.5 use this software in a product, an acknowledgment in the product
with the following individual added to the list of Contributing Authors documentation would be appreciated, but is not required.
Cosmin Truta 2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are 3. This Copyright notice may not be removed or altered from any
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are source or altered source distribution.
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors
Simon-Pierre Cadieux
Eric S. Raymond PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
Gilles Vollant -----------------------------------------------------------------------
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors:
Simon-Pierre Cadieux
Eric S. Raymond
Mans Rullgard
Cosmin Truta
Gilles Vollant
James Yu
Mandar Sahastrabuddhe
Google Inc.
Vadim Barkov
and with the following additions to the disclaimer: and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the There is no warranty against interference with your enjoyment of
library or against infringement. There is no warranty that our the library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with risk of satisfactory quality, performance, accuracy, and effort is
the user. with the user.
Some files in the "contrib" directory and some configure-generated
files that are distributed with libpng have other copyright owners, and
are released under other open source licenses.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
distributed according to the same disclaimer and license as libpng-0.96, libpng-0.96, and are distributed according to the same disclaimer and
with the following individuals added to the list of Contributing Authors: license as libpng-0.96, with the following individuals added to the
list of Contributing Authors:
Tom Lane Tom Lane
Glenn Randers-Pehrson Glenn Randers-Pehrson
Willem van Schaik Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
Distributed according to the same disclaimer and license as libpng-0.88, and are distributed according to the same disclaimer and license as
with the following individuals added to the list of Contributing Authors: libpng-0.88, with the following individuals added to the list of
Contributing Authors:
John Bowler John Bowler
Kevin Bracey Kevin Bracey
Sam Bushell Sam Bushell
Magnus Holmgren Magnus Holmgren
Greg Roelofs Greg Roelofs
Tom Tanner Tom Tanner
Some files in the "scripts" directory have other copyright owners,
but are released under this license.
libpng versions 0.5, May 1995, through 0.88, January 1996, are libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors" For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals: is defined as the following set of individuals:
Andreas Dilger Andreas Dilger
Dave Martindale Dave Martindale
Guy Eric Schalnat Guy Eric Schalnat
Paul Schmidt Paul Schmidt
Tim Wegner Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors The PNG Reference Library is supplied "AS IS". The Contributing
and Group 42, Inc. disclaim all warranties, expressed or implied, Authors and Group 42, Inc. disclaim all warranties, expressed or
including, without limitation, the warranties of merchantability and of implied, including, without limitation, the warranties of
fitness for any purpose. The Contributing Authors and Group 42, Inc. merchantability and of fitness for any purpose. The Contributing
assume no liability for direct, indirect, incidental, special, exemplary, Authors and Group 42, Inc. assume no liability for direct, indirect,
or consequential damages, which may result from the use of the PNG incidental, special, exemplary, or consequential damages, which may
Reference Library, even if advised of the possibility of such damage. result from the use of the PNG Reference Library, even if advised of
the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions: to the following restrictions:
1. The origin of this source code must not be misrepresented. 1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not 2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source. be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any 3. This Copyright notice may not be removed or altered from any
source or altered source distribution. source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without The Contributing Authors and Group 42, Inc. specifically permit,
fee, and encourage the use of this source code as a component to without fee, and encourage the use of this source code as a component
supporting the PNG file format in commercial products. If you use this to supporting the PNG file format in commercial products. If you use
source code in a product, acknowledgment is not required but would be this source code in a product, acknowledgment is not required but would
appreciated. be appreciated.
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
printf("%s",png_get_copyright(NULL));
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
December 10, 2012

View File

@ -1,30 +1,94 @@
# Makefile.am: # Makefile.am, the source file for Makefile.in (and hence Makefile), is
# Source file for Makefile.in (and hence Makefile)
# #
# Copyright (c) 2018-2025 Cosmin Truta
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
ACLOCAL_AMFLAGS = -I scripts ACLOCAL_AMFLAGS = -I scripts/autoconf
# test programs - run on make check, make distcheck # test programs - run on make check, make distcheck
TESTS_ENVIRONMENT= srcdir=$(srcdir) if ENABLE_TESTS
check_PROGRAMS= pngtest check_PROGRAMS= pngtest pngunknown pngstest pngvalid pngimage pngcp
if HAVE_CLOCK_GETTIME
check_PROGRAMS += timepng
endif
else
check_PROGRAMS=
endif
# Utilities - installed
if ENABLE_TOOLS
bin_PROGRAMS= pngfix png-fix-itxt
else
bin_PROGRAMS=
endif
# This ensures that pnglibconf.h gets built at the start of 'make all' or
# 'make check', but it does not add dependencies to the individual programs,
# this is done below.
#
# IMPORTANT: always add the object modules of new programs to the list below
# because otherwise the sequence 'configure; make new-program' will *sometimes*
# result in the installed (system) pnglibconf.h being used and the result is
# always wrong and always very confusing.
BUILT_SOURCES = pnglibconf.h
if ENABLE_TESTS
pngtest_SOURCES = pngtest.c pngtest_SOURCES = pngtest.c
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
TESTS = test-pngtest.sh
# Only do the following if the contrib directory is present.
check_PROGRAMS+= pngvalid pngstest pngunknown
pngvalid_SOURCES = contrib/libtests/pngvalid.c pngvalid_SOURCES = contrib/libtests/pngvalid.c
pngstest_SOURCES = contrib/libtests/pngstest.c
pngunknown_SOURCES = contrib/libtests/pngunknown.c
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngstest_SOURCES = contrib/libtests/pngstest.c
pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la pngstest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngunknown_SOURCES = contrib/libtests/pngunknown.c
pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la pngunknown_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
TESTS += contrib/libtests/test-pngunknown.sh\
contrib/libtests/test-pngvalid-simple.sh\ pngimage_SOURCES = contrib/libtests/pngimage.c
contrib/libtests/test-pngvalid-full.sh\ pngimage_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
contrib/libtests/test-pngstest.sh
timepng_SOURCES = contrib/libtests/timepng.c
timepng_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
pngcp_SOURCES = contrib/tools/pngcp.c
pngcp_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
endif
if ENABLE_TOOLS
pngfix_SOURCES = contrib/tools/pngfix.c
pngfix_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
png_fix_itxt_SOURCES = contrib/tools/png-fix-itxt.c
endif
# Generally these are single line shell scripts to run a test with a particular
# set of parameters:
if ENABLE_TESTS
TESTS =\
tests/pngtest-all\
tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
tests/pngvalid-gamma-expand16-background\
tests/pngvalid-gamma-expand16-transform tests/pngvalid-gamma-sbit\
tests/pngvalid-gamma-threshold tests/pngvalid-gamma-transform\
tests/pngvalid-progressive-size\
tests/pngvalid-progressive-interlace-standard\
tests/pngvalid-transform\
tests/pngvalid-progressive-standard tests/pngvalid-standard\
tests/pngstest-1.8 tests/pngstest-1.8-alpha tests/pngstest-linear\
tests/pngstest-linear-alpha tests/pngstest-none tests/pngstest-none-alpha\
tests/pngstest-sRGB tests/pngstest-sRGB-alpha tests/pngunknown-IDAT\
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
tests/pngimage-quick tests/pngimage-full
endif
# man pages # man pages
dist_man_MANS= libpng.3 libpngpf.3 png.5 dist_man_MANS= libpng.3 libpngpf.3 png.5
@ -43,7 +107,47 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
if PNG_ARM_NEON if PNG_ARM_NEON
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/filter_neon.S libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
arm/filter_neon_intrinsics.c \
arm/palette_neon_intrinsics.c
endif
if PNG_MIPS_MSA
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c\
mips/filter_msa_intrinsics.c
endif
if PNG_MIPS_MMI
if !PNG_MIPS_MSA
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/mips_init.c
endif
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += mips/filter_mmi_inline_assembly.c
endif
if PNG_INTEL_SSE
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\
intel/filter_sse2_intrinsics.c
endif
if PNG_POWERPC_VSX
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += powerpc/powerpc_init.c\
powerpc/filter_vsx_intrinsics.c
endif
if PNG_RISCV_RVV
noinst_LTLIBRARIES= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_SOURCES = riscv/riscv_init.c\
riscv/filter_rvv_intrinsics.c
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv_la_CFLAGS = -march=rv64gv
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la
endif
if PNG_LOONGARCH_LSX
noinst_LTLIBRARIES= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_SOURCES = loongarch/loongarch_lsx_init.c\
loongarch/filter_lsx_intrinsics.c
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx_la_CFLAGS = -mlsx
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
endif endif
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
@ -66,6 +170,14 @@ else
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym
endif endif
if PNG_RISCV_RVV
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@rvv.la
endif
if PNG_LOONGARCH_LSX
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES += libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@lsx.la
endif
#distribute headers in /usr/include/libpng/* #distribute headers in /usr/include/libpng/*
pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) pkgincludedir= $(includedir)/$(PNGLIB_BASENAME)
pkginclude_HEADERS= png.h pngconf.h pkginclude_HEADERS= png.h pngconf.h
@ -76,26 +188,29 @@ nodist_pkginclude_HEADERS= pnglibconf.h
pkgconfigdir = @pkgconfigdir@ pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
#extra source distribution files. # Extra source distribution files, '${srcdir}' is used below to stop build files
# from those directories being included. This only works if the configure is
# not done in the source directory!
EXTRA_DIST= \ EXTRA_DIST= \
ANNOUNCE CHANGES INSTALL LICENSE README TODO \ ANNOUNCE AUTHORS CHANGES INSTALL LICENSE README TODO TRADEMARK \
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \ ${srcdir}/ci ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \
$(TESTS) \ $(TESTS) $(XFAIL_TESTS) tests/pngstest \
CMakeLists.txt example.c libpng-manual.txt CMakeLists.txt example.c libpng-manual.txt
SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk
CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ CLEANFILES= *.tf? pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
check.new pnglibconf.* pngprefix.h symbols.new pngtest-log.txt \ check.new pnglibconf.h pngprefix.h symbols.new pngtest-log.txt \
pnglibconf.out pnglibconf.c pnglibconf.pre pnglibconf.dfn \
$(SCRIPT_CLEANFILES) $(SCRIPT_CLEANFILES)
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
config.sub configure depcomp install-sh ltmain.sh missing config.sub configure depcomp install-sh ltmain.sh missing
# PNG_COPTS give extra options for the C compiler to be used on all compilation # PNG_COPTS give extra options for the C compiler to be used on all compilation
# steps (unless targe_CFLAGS is specified; that will take precedence over # steps (unless target_CFLAGS is specified; that will take precedence over
# AM_CFLAGS) # AM_CFLAGS)
PNG_COPTS = @PNG_COPTS@ PNG_COPTS = @PNG_COPTS@
AM_CFLAGS = ${PNG_COPTS} AM_CFLAGS = ${PNG_COPTS}
@ -107,7 +222,7 @@ AM_CFLAGS = ${PNG_COPTS}
# checks for this and sets DFNCPP appropriately. # checks for this and sets DFNCPP appropriately.
DFNCPP = @DFNCPP@ DFNCPP = @DFNCPP@
SUFFIXES = .chk .dfn .out SUFFIXES = .chk .out
$(PNGLIB_BASENAME).pc: libpng.pc $(PNGLIB_BASENAME).pc: libpng.pc
cp libpng.pc $@ cp libpng.pc $@
@ -118,6 +233,7 @@ $(PNGLIB_BASENAME)-config: libpng-config
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
scripts/prefix.out: png.h pngconf.h pnglibconf.out scripts/prefix.out: png.h pngconf.h pnglibconf.out
scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt scripts/symbols.out: png.h pngconf.h $(srcdir)/scripts/pnglibconf.h.prebuilt
scripts/intprefix.out: pnglibconf.h
libpng.sym: scripts/sym.out libpng.sym: scripts/sym.out
rm -f $@ rm -f $@
@ -156,14 +272,29 @@ endif
$(srcdir)/scripts/pnglibconf.h.prebuilt: $(srcdir)/scripts/pnglibconf.h.prebuilt:
@echo "Attempting to build $@" >&2 @echo "Attempting to build $@" >&2
@echo "This is a machine generated file, but if you want to make" >&2 @echo "This is a machine generated file, but if you want to make" >&2
@echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2 @echo "a new one simply make 'scripts/pnglibconf.out', copy that" >&2
@echo "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)" >&2
@exit 1 @exit 1
# The following is necessary to ensure that the local pnglibconf.h is used, not # The following is necessary to ensure that the local pnglibconf.h is used, not
# an installed one (this can happen immediately after on a clean system if # an installed one (this can happen immediately after on a clean system if
# 'make test' is the first thing the user does.) # 'make test' is the first thing the user does.) Only files which include
contrib/libtests/pngstest.o contrib/libtests/pngvalid.o pngtest.o: pnglibconf.h # one of the png source files (typically png.h or pngpriv.h) need to be listed
# here:
pngtest.o: pnglibconf.h
contrib/libtests/makepng.o: pnglibconf.h
contrib/libtests/pngstest.o: pnglibconf.h
contrib/libtests/pngunknown.o: pnglibconf.h contrib/libtests/pngunknown.o: pnglibconf.h
contrib/libtests/pngimage.o: pnglibconf.h
contrib/libtests/pngvalid.o: pnglibconf.h
contrib/libtests/readpng.o: pnglibconf.h
contrib/libtests/tarith.o: pnglibconf.h
contrib/libtests/timepng.o: pnglibconf.h
contrib/tools/makesRGB.o: pnglibconf.h
contrib/tools/pngfix.o: pnglibconf.h
contrib/tools/pngcp.o: pnglibconf.h
# We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually # We must use -DPNG_NO_USE_READ_MACROS here even when the library may actually
# be built with PNG_USE_READ_MACROS; this prevents the read macros from # be built with PNG_USE_READ_MACROS; this prevents the read macros from
@ -177,20 +308,17 @@ if DO_PNG_PREFIX
SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@' SYMBOL_CFLAGS += -DPNG_PREFIX='@PNG_PREFIX@'
endif endif
.dfn.out: .c.out:
rm -f $@ $*.c $*.tf[123] rm -f $@ $*.tf[12]
test -d scripts || mkdir scripts test -d scripts || mkdir scripts || test -d scripts
echo '#include "$<"' >$*.c
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\ $(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)\
$(CPPFLAGS) $(SYMBOL_CFLAGS) $*.c > $*.tf1 $(CPPFLAGS) $(SYMBOL_CFLAGS) $< > $*.tf1
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\ $(AWK) -f "${srcdir}/scripts/dfn.awk" out="$*.tf2" $*.tf1 1>&2
$*.tf1 >$*.tf2 rm -f $*.tf1
$(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' $*.tf2 >$*.tf3 mv $*.tf2 $@
rm -f $*.c $*.tf[12]
mv $*.tf3 $@
# The .dfn file for pnglibconf.h is machine generated # The .c file for pnglibconf.h is machine generated
pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA) pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h pngusr.dfa $(DFA_XTRA)
rm -f $@ $*.tf[45] rm -f $@ $*.tf[45]
$(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\ $(AWK) -f ${srcdir}/scripts/options.awk out=$*.tf4 version=search\
${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\ ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
@ -210,7 +338,7 @@ scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.ou
# used on demand to regenerate the standard header, CPPFLAGS should # used on demand to regenerate the standard header, CPPFLAGS should
# be empty - no non-standard defines # be empty - no non-standard defines
scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk pngconf.h scripts/pnglibconf.c: scripts/pnglibconf.dfa scripts/options.awk pngconf.h
rm -f $@ pnglibconf.tf[67] rm -f $@ pnglibconf.tf[67]
test -z "$(CPPFLAGS)" test -z "$(CPPFLAGS)"
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
@ -234,34 +362,76 @@ check: scripts/symbols.chk
dist-hook: dist-hook:
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
# install the .../include headers as links to the new ones # Make links between installed files with release-specific names and the generic
install-data-hook: # file names. If this install rule is run the generic names will be deleted and
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.h # recreated - this has obvious issues for systems with multiple installations.
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
pngconf.h
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \
pnglibconf.h
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
# do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used install-header-links:
install-exec-hook: @set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \
cd $(DESTDIR)$(bindir); rm -f libpng-config rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
@set -x;\ uninstall-header-links:
cd $(DESTDIR)$(libdir);\ cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS)
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib dll.a; do\
rm -f libpng.$$ext;\ install-libpng-pc:
if test -f $(PNGLIB_BASENAME).$$ext; then\ @set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\ $(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc
fi;\
uninstall-libpng-pc:
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
# EXT_LIST is a list of the possibly library directory extensions, this exists
# because we can't find a good way of discovering the file extensions that are
# actually installed on a given system, so instead we check for every extension
# we have seen.
EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib
install-library-links:
@set -x; cd '$(DESTDIR)$(libdir)';\
for ext in $(EXT_LIST); do\
rm -f "libpng.$$ext";\
if test -f "$(PNGLIB_BASENAME).$$ext"; then\
$(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\
fi;\
done done
uninstall-hook: uninstall-library-links:
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.h @set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\
rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc rm -f "libpng.$$ext"; done
rm -f $(DESTDIR)$(bindir)/libpng-config
rm -f $(DESTDIR)$(libdir)/libpng.a install-libpng-config:
rm -f $(DESTDIR)$(libdir)/libpng.la @set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \
rm -f $(DESTDIR)$(libdir)/libpng.dll.a $(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config
uninstall-libpng-config:
rm -f '$(DESTDIR)$(bindir)/libpng-config'
if DO_INSTALL_LINKS
# If --enable-unversioned-links is specified the header and lib file links
# will be automatically made on a 'make install':
install-data-hook: install-header-links
uninstall-hook: uninstall-header-links
install-exec-hook: install-library-links
uninstall-hook: uninstall-library-links
endif
if DO_INSTALL_LIBPNG_PC
# Likewise, --install-pc causes libpng.pc to be constructed:
install-data-hook: install-libpng-pc
uninstall-hook: uninstall-libpng-pc
endif
if DO_INSTALL_LIBPNG_CONFIG
# And --install-config:
install-exec-hook: install-libpng-config
uninstall-hook: uninstall-libpng-config
endif
# The following addition ensures that 'make all' always builds the test programs
# too. It used to, but some change either in libpng or configure stopped this
# working.
all-am: $(check_PROGRAMS)

2610
Makefile.in Normal file

File diff suppressed because it is too large Load Diff

338
README
View File

@ -1,49 +1,88 @@
README for libpng version 1.6.0beta33 - December 10, 2012 (shared library 16.0) README for libpng version 1.6.51.git
See the note about version numbers near the top of png.h ====================================
See INSTALL for instructions on how to install libpng. See the note about version numbers near the top of `png.h`.
See `INSTALL` for instructions on how to install libpng.
Libpng comes in several distribution formats. Get libpng-*.tar.gz, Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
libpng-*.tar.xz or libpng-*.tar.bz2 if you want UNIX-style line endings or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
in the text files, or lpng*.zip if you want DOS-style line endings. files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.
Version 0.89 was the first official release of libpng. Don't let the For a detailed description on using libpng, read `libpng-manual.txt`.
fact that it's the first release fool you. The libpng library has been in For examples of libpng in a program, see `example.c` and `pngtest.c`.
extensive use and testing since mid-1995. By late 1997 it had For usage information and restrictions (what little they are) on libpng,
finally gotten to the stage where there hadn't been significant see `png.h`. For a description on using zlib (the compression library
changes to the API in some time, and people have a bad feeling about used by libpng) and zlib's restrictions, see `zlib.h`.
libraries with versions < 1.0. Version 1.0.0 was released in
March 1998.
**** You should use zlib 1.0.4 or later to run this, but it _may_ work with
Note that some of the changes to the png_info structure render this versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for
some images.
You should also note that zlib is a compression library that is useful
for more things than just PNG files. You can use zlib as a drop-in
replacement for `fread()` and `fwrite()`, if you are so inclined.
zlib should be available at the same place that libpng is, or at
https://zlib.net .
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html .
This code is currently being archived at https://libpng.sourceforge.io
in the download area, and at http://libpng.download/src .
This release, based in a large way on Glenn's, Guy's and Andreas'
earlier work, was created and will be supported by myself and the PNG
development group.
Send comments, corrections and commendations to `png-mng-implement`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.)
Send general questions about the PNG specification to `png-mng-misc`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
to subscribe.)
Historical notes
----------------
The libpng library has been in extensive use and testing since mid-1995.
Version 0.89, published a year later, was the first official release.
By late 1997, it had finally gotten to the stage where there hadn't
been significant changes to the API in some time, and people have a bad
feeling about libraries with versions below 1.0. Version 1.0.0 was
released in March 1998.
Note that some of the changes to the `png_info` structure render this
version of the library binary incompatible with libpng-0.89 or version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the earlier versions if you are using a shared library. The type of the
"filler" parameter for png_set_filler() has changed from png_byte to `filler` parameter for `png_set_filler()` has changed from `png_byte`
png_uint_32, which will affect shared-library applications that use to `png_uint_32`, which will affect shared-library applications that
this function. use this function.
To avoid problems with changes to the internals of png_info_struct, To avoid problems with changes to the internals of the `info_struct`,
new APIs have been made available in 0.95 to avoid direct application new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and access to `info_ptr`. These functions are the `png_set_<chunk>` and
png_get_<chunk> functions. These functions should be used when `png_get_<chunk>` functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it accessing/storing the `info_struct` data, rather than manipulating it
directly, to avoid such problems in the future. directly, to avoid such problems in the future.
It is important to note that the APIs do not make current programs It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new that access the info struct directly incompatible with the new
library. However, it is strongly suggested that new programs use library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
the new APIs (as shown in example.c and pngtest.c), and older programs be a transitional release, members of the `png_struct` and the
be converted to the new format, to facilitate upgrades in the future. `info_struct` can still be accessed, but the compiler will issue a
**** warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
Additions since 0.90 include the ability to compile libpng as a reside in private `pngstruct.h` and `pnginfo.h` header files that are
Windows DLL, and new APIs for accessing data in the info struct. not accessible to applications. It is strongly suggested that new
Experimental functions include the ability to set weighting and cost programs use the new APIs (as shown in `example.c` and `pngtest.c`),
factors for row filter selection, direct reads of integers from buffers and older programs be converted to the new format, to facilitate
on big-endian processors that support misaligned data access, faster upgrades in the future.
methods of doing alpha composition, and more accurate 16->8 bit color
conversion.
The additions since 0.89 include the ability to read from a PNG stream The additions since 0.89 include the ability to read from a PNG stream
which has had some (or all) of the signature bytes read by the calling which has had some (or all) of the signature bytes read by the calling
@ -53,150 +92,93 @@ the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk. critical or an ancillary chunk.
The changes made to the library, and bugs fixed are based on discussions The additions since 0.90 include the ability to compile libpng as a
on the PNG-implement mailing list and not on material submitted Windows DLL, and new APIs for accessing data in the `info_struct`.
privately to Guy, Andreas, or Glenn. They will forward any good Experimental functions included the ability to set weighting and cost
suggestions to the list. factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16-to-8 bit color
conversion. Some of these experimental functions, such as the weighted
filter heuristics, have since been removed.
For a detailed description on using libpng, read libpng-manual.txt. For Files included in this distribution
examples of libpng in a program, see example.c and pngtest.c. For usage -----------------------------------
information and restrictions (what little they are) on libpng, see
png.h. For a description on using zlib (the compression library used by
libpng) and zlib's restrictions, see zlib.h
I have included a general makefile, as well as several machine and ANNOUNCE => Announcement of this version, with recent changes
compiler specific ones, but you may have to modify one for your own needs. AUTHORS => List of contributing authors
CHANGES => Description of changes between libpng versions
INSTALL => Instructions to install libpng
LICENSE => License to use and redistribute libpng
README => This file
TODO => Things not implemented in the current library
TRADEMARK => Trademark information
example.c => Example code for using libpng functions
libpng.3 => Manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => Manual page for libpng's private functions (deprecated)
png.5 => Manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
pngbar.png => PNG logo, 88x31
pngnow.png => PNG logo, 98x31
pngpread.c => Progressive reading functions
pngread.c => Read data/helper high-level functions
pngrio.c => Lowest-level data read I/O functions
pngrtran.c => Read data transformation functions
pngrutil.c => Read data utility functions
pngset.c => Functions for storing data into the info_struct
pngtest.c => Library test program
pngtest.png => Library test sample image
pngtrans.c => Common data transformation functions
pngwio.c => Lowest-level write I/O functions
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
arm/ => Optimized code for ARM Neon
intel/ => Optimized code for INTEL SSE2
loongarch/ => Optimized code for LoongArch LSX
mips/ => Optimized code for MIPS MSA and MIPS MMI
powerpc/ => Optimized code for PowerPC VSX
riscv/ => Optimized code for the RISC-V platform
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
mips-msa/ => Optimized code for the MIPS-MSA platform
powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
examples/ => Examples of libpng usage
gregbook/ => Source code for PNG reading and writing, from
"PNG: The Definitive Guide" by Greg Roelofs,
O'Reilly, 1999
libtests/ => Test programs
pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
riscv-rvv/ => Optimized code for the RISC-V Vector platform
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images
projects/ => Project files and workspaces for various IDEs
owatcom/ => OpenWatcom project
visualc71/ => Microsoft Visual C++ 7.1 workspace
vstudio/ => Microsoft Visual Studio workspace
scripts/ => Scripts and makefiles for building libpng
(see scripts/README.txt for the complete list)
tests/ => Test scripts
You should use zlib 1.0.4 or later to run this, but it MAY work with Good luck, and happy coding!
versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for
some images. You will definitely need zlib 1.0.4 or later if you are
taking advantage of the MS-DOS "far" structure allocation for the small
and medium memory models. You should also note that zlib is a
compression library that is useful for more things than just PNG files.
You can use zlib as a drop-in replacement for fread() and fwrite() if
you are so inclined.
zlib should be available at the same place that libpng is, or at. * Cosmin Truta (current maintainer, since 2018)
ftp://ftp.info-zip.org/pub/infozip/zlib * Glenn Randers-Pehrson (former maintainer, 1998-2018)
* Andreas Eric Dilger (former maintainer, 1996-1997)
You may also want a copy of the PNG specification. It is available * Guy Eric Schalnat (original author and former maintainer, 1995-1996)
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find (formerly of Group 42, Inc.)
these at http://www.libpng.org/pub/png/documents/
This code is currently being archived at libpng.sf.net in the
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
at GO GRAPHSUP. If you can't find it in any of those places,
e-mail me, and I'll help you find it.
If you have any code changes, requests, problems, etc., please e-mail
them to me. Also, I'd appreciate any make files or project files,
and any modifications you needed to make to get libpng to compile,
along with a #define variable to tell what compiler/system you are on.
If you needed to add transformations to libpng, or wish libpng would
provide the image in a different way, drop me a note (and code, if
possible), so I can consider supporting the transformation.
Finally, if you get any warning messages when compiling libpng
(note: not zlib), and they are easy to fix, I'd appreciate the
fix. Please mention "libpng" somewhere in the subject line. Thanks.
This release was created and will be supported by myself (of course
based in a large way on Guy's and Andreas' earlier work), and the PNG
development group.
Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) or to glennrp at users.sourceforge.net
You can't reach Guy, the original libpng author, at the addresses
given in previous versions of this document. He and Andreas will
read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
png-mng-misc at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe). If you have a question about something
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for sixteen years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
Files in this distribution:
ANNOUNCE => Announcement of this version, with recent changes
CHANGES => Description of changes between libpng versions
KNOWNBUG => List of known bugs and deficiencies
LICENSE => License to use and redistribute libpng
README => This file
TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions
libpng.3 => manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions
png.5 => manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
pngbar.png => PNG logo, 88x31
pngnow.png => PNG logo, 98x31
pngpread.c => Progressive reading functions
pngread.c => Read data/helper high-level functions
pngrio.c => Lowest-level data read I/O functions
pngrtran.c => Read data transformation functions
pngrutil.c => Read data utility functions
pngset.c => Functions for storing data into the info_struct
pngtest.c => Library test program
pngtest.png => Library test sample image
pngtrans.c => Common data transformation functions
pngwio.c => Lowest-level write I/O functions
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
contrib => Contributions
gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999
msvctest => Builds and runs pngtest using a MSVC workspace
pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
cbuilder5 => Contains a Borland workspace for building
libpng and zlib
visualc6 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
xcode => Contains an Apple xcode
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
(see scripts/README.txt for the list of scripts)
Good luck, and happy coding.
-Glenn Randers-Pehrson (current maintainer, since 1998)
Internet: glennrp at users.sourceforge.net
-Andreas Eric Dilger (former maintainer, 1996-1997)
Internet: adilger at enel.ucalgary.ca
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
(formerly of Group 42, Inc)
Internet: gschal at infinet.com

47
TODO
View File

@ -1,27 +1,22 @@
/* TODO list for libpng
TODO - list of things to do for libpng: --------------------
Final bug fixes. * Fix all defects (duh!)
Better C++ wrapper/full C++ implementation? * cHRM transformation.
Fix problem with C++ and EXTERN "C". * Palette creation.
cHRM transformation. * "grayscale->palette" transformation and "palette->grayscale" detection.
Remove setjmp/longjmp usage in favor of returning error codes. * Improved dithering.
Add "grayscale->palette" transformation and "palette->grayscale" detection. * Multi-lingual error and warning message support.
Improved dithering. * Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
Multi-lingual error and warning message support. * Man pages for function calls.
Complete sRGB transformation (presently it simply uses gamma=0.45455). * Better documentation.
Man pages for function calls. * Better filter selection
Better documentation. (e.g., counting huffman bits/precompression; filter inertia; filter costs).
Better filter selection * Histogram creation.
(counting huffman bits/precompression? filter inertia? filter costs?). * Text conversion between different code pages (e.g., Latin-1 to Mac).
Histogram creation. * Avoid building gamma tables whenever possible.
Text conversion between different code pages (Latin-1 -> Mac and DOS). * Greater precision in changing to linear gamma for compositing against
Avoid building gamma tables whenever possible. background, and in doing rgb-to-gray transformations.
Use greater precision when changing to linear gamma for compositing against * Investigate pre-incremented loop counters and other loop constructions.
background and doing rgb-to-gray transformation. * Interpolated method of handling interlacing.
Investigate pre-incremented loop counters and other loop constructions. * More validations for libpng transformations.
Add interpolated method of handling interlacing.
Switch to the simpler zlib (zlib/libpng) license if legally possible.
Extend pngvalid.c to validate more of the libpng transformations.
*/

8
TRADEMARK Normal file
View File

@ -0,0 +1,8 @@
TRADEMARK
=========
The name "libpng" has not been registered by the Copyright owners
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owners claim "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.

1378
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

138
arm/arm_init.c Normal file
View File

@ -0,0 +1,138 @@
/* arm_init.c - NEON optimised filter functions
*
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* This module requires POSIX 1003.1 functions. */
#define _POSIX_SOURCE 1
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_OPT > 0
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED /* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the ARM
* NEON instructions there is no processor-specific way of detecting the
* presence of the required support, therefore run-time detection is extremely
* OS specific.
*
* You may set the macro PNG_ARM_NEON_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_neon function. There
* are a number of implementations in contrib/arm-neon, but the only one that
* has partial support is contrib/arm-neon/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
#include <signal.h> /* for sig_atomic_t */
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
static int png_have_neon(png_structp png_ptr);
#ifdef PNG_ARM_NEON_FILE
# include PNG_ARM_NEON_FILE
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
void
png_init_filter_functions_neon(png_structp pp, unsigned int bpp)
{
/* The switch statement is compiled in for ARM_NEON_API, the call to
* png_have_neon is compiled in for ARM_NEON_CHECK. If both are defined
* the check is only performed if the API has not set the NEON option on
* or off explicitly. In this case the check controls what happens.
*
* If the CHECK is not compiled in and the option is UNSET the behavior prior
* to 1.6.7 was to use the NEON code - this was a bug caused by having the
* wrong order of the 'ON' and 'default' cases. UNSET now defaults to OFF,
* as documented in png.h
*/
png_debug(1, "in png_init_filter_functions_neon");
#ifdef PNG_ARM_NEON_API_SUPPORTED
switch ((pp->options >> PNG_ARM_NEON) & 3)
{
case PNG_OPTION_UNSET:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif /* PNG_ARM_NEON_API_SUPPORTED */
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
{
static volatile sig_atomic_t no_neon = -1; /* not checked */
if (no_neon < 0)
no_neon = !png_have_neon(pp);
if (no_neon)
return;
}
#ifdef PNG_ARM_NEON_API_SUPPORTED
break;
#endif
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifdef PNG_ARM_NEON_API_SUPPORTED
default: /* OFF or INVALID */
return;
case PNG_OPTION_ON:
/* Option turned on */
break;
}
#endif
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_neon;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth3_neon;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_neon;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_neon;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
png_read_filter_row_paeth4_neon;
}
}
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* READ */

View File

@ -1,225 +1,60 @@
/* filter_neon.S - placeholder file
/* filter_neon.S - NEON optimised filter functions
* *
* Copyright (c) 2011 Glenn Randers-Pehrson * Copyright (c) 2024 Cosmin Truta
* Written by Mans Rullgard, 2011.
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer * For conditions of distribution and use, see the disclaimer
* and license in png.h * and license in png.h
*/ */
#if defined(__linux__) && defined(__ELF__) /* IMPORTANT NOTE:
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */ *
#endif * Historically, the hand-coded assembler implementation of Neon optimizations
* in this module had not been in sync with the intrinsics-based implementation
* in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
* the introduction of riffled palette optimizations. Moreover, the assembler
* code used to work on 32-bit ARM only, and it caused problems, even if empty,
* on 64-bit ARM.
*
* All references to this module from our internal build scripts and projects
* have been removed.
*
* For the external projects that might still expect this module to be present,
* we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
* Everything should continue to function normally, as long as there are no
* deliberate attempts to use the old hand-made assembler code. A build error
* will be raised otherwise.
*/
#ifdef __ELF__ /* This is required to get the symbol renames, which are #defines, and the
# define ELF * definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
#if PNG_ARM_NEON_OPT > 0
#if defined(__clang__)
#define GNUC_VERSION 0 /* not gcc, although it might pretend to be */
#elif defined(__GNUC__)
#define GNUC_MAJOR (__GNUC__ + 0)
#define GNUC_MINOR (__GNUC_MINOR__ + 0)
#define GNUC_PATCHLEVEL (__GNUC_PATCHLEVEL__ + 0)
#define GNUC_VERSION (GNUC_MAJOR * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL)
#else #else
# define ELF @ #define GNUC_VERSION 0 /* not gcc */
#endif #endif
.arch armv7-a #if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
.fpu neon #error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
#elif GNUC_VERSION == 40504
#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
#else
#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
#endif
.macro func name, export=0 #endif /* PNG_ARM_NEON_OPT > 0 */
.macro endfunc #endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
ELF .size \name, . - \name #endif /* READ */
.endfunc
.purgem endfunc
.endm
.text
.if \export
.global \name
.endif
ELF .type \name, STT_FUNC
.func \name
\name:
.endm
func png_read_filter_row_sub4_neon, export=1
ldr r3, [r0, #4] @ rowbytes
vmov.i8 d3, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vadd.u8 d0, d3, d4
vadd.u8 d1, d0, d5
vadd.u8 d2, d1, d6
vadd.u8 d3, d2, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r3, r3, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_sub3_neon, export=1
ldr r3, [r0, #4] @ rowbytes
vmov.i8 d3, #0
mov r0, r1
mov r2, #3
mov r12, #12
vld1.8 {q11}, [r0], r12
1:
vext.8 d5, d22, d23, #3
vadd.u8 d0, d3, d22
vext.8 d6, d22, d23, #6
vadd.u8 d1, d0, d5
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], r12
vst1.32 {d0[0]}, [r1,:32], r2
vadd.u8 d2, d1, d6
vst1.32 {d1[0]}, [r1], r2
vadd.u8 d3, d2, d7
vst1.32 {d2[0]}, [r1], r2
vst1.32 {d3[0]}, [r1], r2
subs r3, r3, #12
bgt 1b
bx lr
endfunc
func png_read_filter_row_up_neon, export=1
ldr r3, [r0, #4] @ rowbytes
1:
vld1.8 {q0}, [r1,:128]
vld1.8 {q1}, [r2,:128]!
vadd.u8 q0, q0, q1
vst1.8 {q0}, [r1,:128]!
subs r3, r3, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_avg4_neon, export=1
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
vhadd.u8 d0, d3, d16
vadd.u8 d0, d0, d4
vhadd.u8 d1, d0, d17
vadd.u8 d1, d1, d5
vhadd.u8 d2, d1, d18
vadd.u8 d2, d2, d6
vhadd.u8 d3, d2, d19
vadd.u8 d3, d3, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r12, r12, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_avg3_neon, export=1
push {r4,lr}
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
mov r0, r1
mov r4, #3
mov lr, #12
vld1.8 {q11}, [r0], lr
1:
vld1.8 {q10}, [r2], lr
vext.8 d5, d22, d23, #3
vhadd.u8 d0, d3, d20
vext.8 d17, d20, d21, #3
vadd.u8 d0, d0, d22
vext.8 d6, d22, d23, #6
vhadd.u8 d1, d0, d17
vext.8 d18, d20, d21, #6
vadd.u8 d1, d1, d5
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], lr
vst1.32 {d0[0]}, [r1,:32], r4
vhadd.u8 d2, d1, d18
vst1.32 {d1[0]}, [r1], r4
vext.8 d19, d21, d21, #1
vadd.u8 d2, d2, d6
vhadd.u8 d3, d2, d19
vst1.32 {d2[0]}, [r1], r4
vadd.u8 d3, d3, d7
vst1.32 {d3[0]}, [r1], r4
subs r12, r12, #12
bgt 1b
pop {r4,pc}
endfunc
.macro paeth rx, ra, rb, rc
vaddl.u8 q12, \ra, \rb @ a + b
vaddl.u8 q15, \rc, \rc @ 2*c
vabdl.u8 q13, \rb, \rc @ pa
vabdl.u8 q14, \ra, \rc @ pb
vabd.u16 q15, q12, q15 @ pc
vcle.u16 q12, q13, q14 @ pa <= pb
vcle.u16 q13, q13, q15 @ pa <= pc
vcle.u16 q14, q14, q15 @ pb <= pc
vand q12, q12, q13 @ pa <= pb && pa <= pc
vmovn.u16 d28, q14
vmovn.u16 \rx, q12
vbsl d28, \rb, \rc
vbsl \rx, \ra, d28
.endm
func png_read_filter_row_paeth4_neon, export=1
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
vmov.i8 d20, #0
1:
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
paeth d0, d3, d16, d20
vadd.u8 d0, d0, d4
paeth d1, d0, d17, d16
vadd.u8 d1, d1, d5
paeth d2, d1, d18, d17
vadd.u8 d2, d2, d6
paeth d3, d2, d19, d18
vmov d20, d19
vadd.u8 d3, d3, d7
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
subs r12, r12, #16
bgt 1b
bx lr
endfunc
func png_read_filter_row_paeth3_neon, export=1
push {r4,lr}
ldr r12, [r0, #4] @ rowbytes
vmov.i8 d3, #0
vmov.i8 d4, #0
mov r0, r1
mov r4, #3
mov lr, #12
vld1.8 {q11}, [r0], lr
1:
vld1.8 {q10}, [r2], lr
paeth d0, d3, d20, d4
vext.8 d5, d22, d23, #3
vadd.u8 d0, d0, d22
vext.8 d17, d20, d21, #3
paeth d1, d0, d17, d20
vst1.32 {d0[0]}, [r1,:32], r4
vext.8 d6, d22, d23, #6
vadd.u8 d1, d1, d5
vext.8 d18, d20, d21, #6
paeth d2, d1, d18, d17
vext.8 d7, d23, d23, #1
vld1.8 {q11}, [r0], lr
vst1.32 {d1[0]}, [r1], r4
vadd.u8 d2, d2, d6
vext.8 d19, d21, d21, #1
paeth d3, d2, d19, d18
vst1.32 {d2[0]}, [r1], r4
vmov d4, d19
vadd.u8 d3, d3, d7
vst1.32 {d3[0]}, [r1], r4
subs r12, r12, #12
bgt 1b
pop {r4,pc}
endfunc

View File

@ -0,0 +1,401 @@
/* filter_neon_intrinsics.c - NEON optimised filter functions
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
* Written by James Yu <james.yu at linaro.org>, October 2013.
* Based on filter_neon.S, written by Mans Rullgard, 2011.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
/* This code requires -mfpu=neon on the command line: */
#if PNG_ARM_NEON_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
# include <arm64_neon.h>
#else
# include <arm_neon.h>
#endif
/* libpng row pointers are not necessarily aligned to any particular boundary,
* however this code will only work with appropriate alignment. arm/arm_init.c
* checks for this (and will not compile unless it is done). This code uses
* variants of png_aligncast to avoid compiler warnings.
*/
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer)
/* The following relies on a variable 'temp_pointer' being declared with type
* 'type'. This is written this way just to hide the GCC strict aliasing
* warning; note that the code is safe because there never is an alias between
* the input and output pointers.
*
* When compiling with MSVC ARM64, the png_ldr macro can't be passed directly
* to vst4_lane_u32, because of an internal compiler error inside MSVC.
* To avoid this compiler bug, we use a temporary variable (vdest_val) to store
* the result of png_ldr.
*/
#define png_ldr(type,pointer)\
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
#if PNG_ARM_NEON_OPT > 0
void
png_read_filter_row_up_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
png_const_bytep pp = prev_row;
png_debug(1, "in png_read_filter_row_up_neon");
for (; rp < rp_stop; rp += 16, pp += 16)
{
uint8x16_t qrp, qpp;
qrp = vld1q_u8(rp);
qpp = vld1q_u8(pp);
qrp = vaddq_u8(qrp, qpp);
vst1q_u8(rp, qrp);
}
}
void
png_read_filter_row_sub3_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
uint8x16_t vtmp = vld1q_u8(rp);
uint8x8x2_t *vrpt = png_ptr(uint8x8x2_t, &vtmp);
uint8x8x2_t vrp = *vrpt;
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
png_debug(1, "in png_read_filter_row_sub3_neon");
for (; rp < rp_stop;)
{
uint8x8_t vtmp1, vtmp2;
uint32x2_t *temp_pointer;
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
vtmp2 = vext_u8(vrp.val[0], vrp.val[1], 6);
vdest.val[1] = vadd_u8(vdest.val[0], vtmp1);
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
vdest.val[2] = vadd_u8(vdest.val[1], vtmp2);
vdest.val[3] = vadd_u8(vdest.val[2], vtmp1);
vtmp = vld1q_u8(rp + 12);
vrpt = png_ptr(uint8x8x2_t, &vtmp);
vrp = *vrpt;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
rp += 3;
}
PNG_UNUSED(prev_row)
}
void
png_read_filter_row_sub4_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
png_debug(1, "in png_read_filter_row_sub4_neon");
for (; rp < rp_stop; rp += 16)
{
uint32x2x4_t vtmp = vld4_u32(png_ptr(uint32_t,rp));
uint8x8x4_t *vrpt = png_ptr(uint8x8x4_t,&vtmp);
uint8x8x4_t vrp = *vrpt;
uint32x2x4_t *temp_pointer;
uint32x2x4_t vdest_val;
vdest.val[0] = vadd_u8(vdest.val[3], vrp.val[0]);
vdest.val[1] = vadd_u8(vdest.val[0], vrp.val[1]);
vdest.val[2] = vadd_u8(vdest.val[1], vrp.val[2]);
vdest.val[3] = vadd_u8(vdest.val[2], vrp.val[3]);
vdest_val = png_ldr(uint32x2x4_t, &vdest);
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
PNG_UNUSED(prev_row)
}
void
png_read_filter_row_avg3_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_const_bytep pp = prev_row;
png_bytep rp_stop = row + row_info->rowbytes;
uint8x16_t vtmp;
uint8x8x2_t *vrpt;
uint8x8x2_t vrp;
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
vtmp = vld1q_u8(rp);
vrpt = png_ptr(uint8x8x2_t,&vtmp);
vrp = *vrpt;
png_debug(1, "in png_read_filter_row_avg3_neon");
for (; rp < rp_stop; pp += 12)
{
uint8x8_t vtmp1, vtmp2, vtmp3;
uint8x8x2_t *vppt;
uint8x8x2_t vpp;
uint32x2_t *temp_pointer;
vtmp = vld1q_u8(pp);
vppt = png_ptr(uint8x8x2_t,&vtmp);
vpp = *vppt;
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
vtmp3 = vext_u8(vrp.val[0], vrp.val[1], 6);
vdest.val[1] = vhadd_u8(vdest.val[0], vtmp2);
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 6);
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
vtmp = vld1q_u8(rp + 12);
vrpt = png_ptr(uint8x8x2_t,&vtmp);
vrp = *vrpt;
vdest.val[2] = vhadd_u8(vdest.val[1], vtmp2);
vdest.val[2] = vadd_u8(vdest.val[2], vtmp3);
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
vdest.val[3] = vhadd_u8(vdest.val[2], vtmp2);
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
rp += 3;
}
}
void
png_read_filter_row_avg4_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
png_const_bytep pp = prev_row;
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
png_debug(1, "in png_read_filter_row_avg4_neon");
for (; rp < rp_stop; rp += 16, pp += 16)
{
uint32x2x4_t vtmp;
uint8x8x4_t *vrpt, *vppt;
uint8x8x4_t vrp, vpp;
uint32x2x4_t *temp_pointer;
uint32x2x4_t vdest_val;
vtmp = vld4_u32(png_ptr(uint32_t,rp));
vrpt = png_ptr(uint8x8x4_t,&vtmp);
vrp = *vrpt;
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
vppt = png_ptr(uint8x8x4_t,&vtmp);
vpp = *vppt;
vdest.val[0] = vhadd_u8(vdest.val[3], vpp.val[0]);
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
vdest.val[1] = vhadd_u8(vdest.val[0], vpp.val[1]);
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
vdest.val[2] = vhadd_u8(vdest.val[1], vpp.val[2]);
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
vdest.val[3] = vhadd_u8(vdest.val[2], vpp.val[3]);
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
vdest_val = png_ldr(uint32x2x4_t, &vdest);
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
}
static uint8x8_t
paeth(uint8x8_t a, uint8x8_t b, uint8x8_t c)
{
uint8x8_t d, e;
uint16x8_t p1, pa, pb, pc;
p1 = vaddl_u8(a, b); /* a + b */
pc = vaddl_u8(c, c); /* c * 2 */
pa = vabdl_u8(b, c); /* pa */
pb = vabdl_u8(a, c); /* pb */
pc = vabdq_u16(p1, pc); /* pc */
p1 = vcleq_u16(pa, pb); /* pa <= pb */
pa = vcleq_u16(pa, pc); /* pa <= pc */
pb = vcleq_u16(pb, pc); /* pb <= pc */
p1 = vandq_u16(p1, pa); /* pa <= pb && pa <= pc */
d = vmovn_u16(pb);
e = vmovn_u16(p1);
d = vbsl_u8(d, b, c);
e = vbsl_u8(e, a, d);
return e;
}
void
png_read_filter_row_paeth3_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_const_bytep pp = prev_row;
png_bytep rp_stop = row + row_info->rowbytes;
uint8x16_t vtmp;
uint8x8x2_t *vrpt;
uint8x8x2_t vrp;
uint8x8_t vlast = vdup_n_u8(0);
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
vtmp = vld1q_u8(rp);
vrpt = png_ptr(uint8x8x2_t,&vtmp);
vrp = *vrpt;
png_debug(1, "in png_read_filter_row_paeth3_neon");
for (; rp < rp_stop; pp += 12)
{
uint8x8x2_t *vppt;
uint8x8x2_t vpp;
uint8x8_t vtmp1, vtmp2, vtmp3;
uint32x2_t *temp_pointer;
vtmp = vld1q_u8(pp);
vppt = png_ptr(uint8x8x2_t,&vtmp);
vpp = *vppt;
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 3);
vtmp2 = vext_u8(vpp.val[0], vpp.val[1], 3);
vdest.val[1] = paeth(vdest.val[0], vtmp2, vpp.val[0]);
vdest.val[1] = vadd_u8(vdest.val[1], vtmp1);
vtmp1 = vext_u8(vrp.val[0], vrp.val[1], 6);
vtmp3 = vext_u8(vpp.val[0], vpp.val[1], 6);
vdest.val[2] = paeth(vdest.val[1], vtmp3, vtmp2);
vdest.val[2] = vadd_u8(vdest.val[2], vtmp1);
vtmp1 = vext_u8(vrp.val[1], vrp.val[1], 1);
vtmp2 = vext_u8(vpp.val[1], vpp.val[1], 1);
vtmp = vld1q_u8(rp + 12);
vrpt = png_ptr(uint8x8x2_t,&vtmp);
vrp = *vrpt;
vdest.val[3] = paeth(vdest.val[2], vtmp2, vtmp3);
vdest.val[3] = vadd_u8(vdest.val[3], vtmp1);
vlast = vtmp2;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[0]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[1]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[2]), 0);
rp += 3;
vst1_lane_u32(png_ptr(uint32_t,rp), png_ldr(uint32x2_t,&vdest.val[3]), 0);
rp += 3;
}
}
void
png_read_filter_row_paeth4_neon(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row)
{
png_bytep rp = row;
png_bytep rp_stop = row + row_info->rowbytes;
png_const_bytep pp = prev_row;
uint8x8_t vlast = vdup_n_u8(0);
uint8x8x4_t vdest;
vdest.val[3] = vdup_n_u8(0);
png_debug(1, "in png_read_filter_row_paeth4_neon");
for (; rp < rp_stop; rp += 16, pp += 16)
{
uint32x2x4_t vtmp;
uint8x8x4_t *vrpt, *vppt;
uint8x8x4_t vrp, vpp;
uint32x2x4_t *temp_pointer;
uint32x2x4_t vdest_val;
vtmp = vld4_u32(png_ptr(uint32_t,rp));
vrpt = png_ptr(uint8x8x4_t,&vtmp);
vrp = *vrpt;
vtmp = vld4_u32(png_ptrc(uint32_t,pp));
vppt = png_ptr(uint8x8x4_t,&vtmp);
vpp = *vppt;
vdest.val[0] = paeth(vdest.val[3], vpp.val[0], vlast);
vdest.val[0] = vadd_u8(vdest.val[0], vrp.val[0]);
vdest.val[1] = paeth(vdest.val[0], vpp.val[1], vpp.val[0]);
vdest.val[1] = vadd_u8(vdest.val[1], vrp.val[1]);
vdest.val[2] = paeth(vdest.val[1], vpp.val[2], vpp.val[1]);
vdest.val[2] = vadd_u8(vdest.val[2], vrp.val[2]);
vdest.val[3] = paeth(vdest.val[2], vpp.val[3], vpp.val[2]);
vdest.val[3] = vadd_u8(vdest.val[3], vrp.val[3]);
vlast = vpp.val[3];
vdest_val = png_ldr(uint32x2x4_t, &vdest);
vst4_lane_u32(png_ptr(uint32_t,rp), vdest_val, 0);
}
}
#endif /* PNG_ARM_NEON_OPT > 0 */
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 1 (intrinsics) */
#endif /* READ */

View File

@ -0,0 +1,150 @@
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
*
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include "../pngpriv.h"
#if PNG_ARM_NEON_IMPLEMENTATION == 1
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
# include <arm64_neon.h>
#else
# include <arm_neon.h>
#endif
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
void
png_riffle_palette_neon(png_structrp png_ptr)
{
png_const_colorp palette = png_ptr->palette;
png_bytep riffled_palette = png_ptr->riffled_palette;
png_const_bytep trans_alpha = png_ptr->trans_alpha;
int num_trans = png_ptr->num_trans;
int i;
/* Initially black, opaque. */
uint8x16x4_t w = {{
vdupq_n_u8(0x00),
vdupq_n_u8(0x00),
vdupq_n_u8(0x00),
vdupq_n_u8(0xff),
}};
png_debug(1, "in png_riffle_palette_neon");
/* First, riffle the RGB colours into an RGBA8 palette.
* The alpha component is set to opaque for now.
*/
for (i = 0; i < 256; i += 16)
{
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
w.val[0] = v.val[0];
w.val[1] = v.val[1];
w.val[2] = v.val[2];
vst4q_u8(riffled_palette + (i << 2), w);
}
/* Fix up the missing transparency values. */
for (i = 0; i < num_trans; i++)
riffled_palette[(i << 2) + 3] = trans_alpha[i];
}
/* Expands a palettized row into RGBA8. */
int
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
const png_uint_32 *riffled_palette =
png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette);
const png_uint_32 pixels_per_chunk = 4;
png_uint_32 i;
png_debug(1, "in png_do_expand_palette_rgba8_neon");
PNG_UNUSED(row)
if (row_width < pixels_per_chunk)
return 0;
/* This function originally gets the last byte of the output row.
* The NEON part writes forward from a given position, so we have
* to seek this back by 4 pixels x 4 bytes.
*/
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_uint_32)) - 1);
for (i = 0; i < row_width; i += pixels_per_chunk)
{
uint32x4_t cur;
png_bytep sp = *ssp - i, dp = *ddp - (i << 2);
cur = vld1q_dup_u32 (riffled_palette + *(sp - 3));
cur = vld1q_lane_u32(riffled_palette + *(sp - 2), cur, 1);
cur = vld1q_lane_u32(riffled_palette + *(sp - 1), cur, 2);
cur = vld1q_lane_u32(riffled_palette + *(sp - 0), cur, 3);
vst1q_u32((void *)dp, cur);
}
if (i != row_width)
{
/* Remove the amount that wasn't processed. */
i -= pixels_per_chunk;
}
/* Decrement output pointers. */
*ssp = *ssp - i;
*ddp = *ddp - (i << 2);
return i;
}
/* Expands a palettized row into RGB8. */
int
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
{
png_uint_32 row_width = row_info->width;
png_const_bytep palette = (png_const_bytep)png_ptr->palette;
const png_uint_32 pixels_per_chunk = 8;
png_uint_32 i;
png_debug(1, "in png_do_expand_palette_rgb8_neon");
PNG_UNUSED(row)
if (row_width <= pixels_per_chunk)
return 0;
/* Seeking this back by 8 pixels x 3 bytes. */
*ddp = *ddp - ((pixels_per_chunk * sizeof(png_color)) - 1);
for (i = 0; i < row_width; i += pixels_per_chunk)
{
uint8x8x3_t cur;
png_bytep sp = *ssp - i, dp = *ddp - ((i << 1) + i);
cur = vld3_dup_u8(palette + sizeof(png_color) * (*(sp - 7)));
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 6)), cur, 1);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 5)), cur, 2);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 4)), cur, 3);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 3)), cur, 4);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 2)), cur, 5);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 1)), cur, 6);
cur = vld3_lane_u8(palette + sizeof(png_color) * (*(sp - 0)), cur, 7);
vst3_u8((void *)dp, cur);
}
if (i != row_width)
{
/* Remove the amount that wasn't processed. */
i -= pixels_per_chunk;
}
/* Decrement output pointers. */
*ssp = *ssp - i;
*ddp = *ddp - ((i << 1) + i);
return i;
}
#endif /* PNG_ARM_NEON_IMPLEMENTATION */

View File

@ -9,15 +9,15 @@
# #
# For regular ("tarball") distributions all the files should exist. We do not # For regular ("tarball") distributions all the files should exist. We do not
# want them to be updated *under any circumstances*. It should never be # want them to be updated *under any circumstances*. It should never be
# necessary to rune autogen.sh because ./configure --enable-maintainer-mode says # necessary to run autogen.sh because ./configure --enable-maintainer-mode says
# what to do if Makeile.am or configure.ac are changed. # what to do if Makefile.am or configure.ac are changed.
# #
# It is *probably* OK to update the files on a GIT checkout, because they have # It is *probably* OK to update the files on a GIT checkout, because they have
# come from the local tools, but leave that to the user who is assumed to know # come from the local tools, but leave that to the user who is assumed to know
# whether it is ok or required. # whether it is ok or required.
# #
# This script is intended to work without arguments, there are, however, hidden # This script is intended to work without arguments, there are, however, hidden
# arguments for (a) use while testing the script and (b) to fix up systems that # arguments (a) for use while testing the script and (b) to fix up systems that
# have been broken. If (b) is required the script prompts for the correct # have been broken. If (b) is required the script prompts for the correct
# options. For this reason the options are *NOT* documented in the help; this # options. For this reason the options are *NOT* documented in the help; this
# is deliberate; UTSL. # is deliberate; UTSL.
@ -73,12 +73,18 @@ done
# present bad things are happening. # present bad things are happening.
# #
# The autotools generated files: # The autotools generated files:
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in\ libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
config.sub configure depcomp install-sh ltmain.sh missing" config.sub configure depcomp install-sh ltmain.sh missing\
test-driver"
#
# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
# versions than those required by configure.ac):
libpng_autotools_extra="compile config.h.in~"
# #
# These are separate because 'maintainer-clean' does not remove them. # These are separate because 'maintainer-clean' does not remove them.
libpng_libtool_files="scripts/libtool.m4 scripts/ltoptions.m4\ libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4" scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
scripts/autoconf/lt~obsolete.m4"
libpng_autotools_dirs="autom4te.cache" # not required libpng_autotools_dirs="autom4te.cache" # not required
# #
@ -94,6 +100,7 @@ libpng_configure_dirs=".deps"
# of Makefile. These functions do the two bits of cleaning. # of Makefile. These functions do the two bits of cleaning.
clean_autotools(){ clean_autotools(){
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
rm -rf $libpng_autotools_extra
} }
clean_configure(){ clean_configure(){
@ -188,7 +195,7 @@ case "$mode" in
if test -d .git if test -d .git
then then
exec >&2 exec >&2
echo "ERROR: running autoreconf on an initialized sytem" echo "ERROR: running autoreconf on an initialized system"
echo " This is not necessary; it is only necessary to remake the" echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac" echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:" echo " change and make does the right thing with:"
@ -198,7 +205,7 @@ case "$mode" in
echo " You can run autoreconf yourself if you don't like maintainer" echo " You can run autoreconf yourself if you don't like maintainer"
echo " mode and you can also just run autoreconf -f -i to initialize" echo " mode and you can also just run autoreconf -f -i to initialize"
echo " everything in the first place; this script is only for" echo " everything in the first place; this script is only for"
echo " compatiblity with prior releases." echo " compatibility with prior releases."
exit 1 exit 1
else else
exec >&2 exec >&2

11
ci/.shellcheckrc Normal file
View File

@ -0,0 +1,11 @@
# Disable the "expressions don't expand in single quotes, use double quotes"
# advice. We need the regular expressions to remain uninterpolated.
disable=SC2016
# Disable the "variable appears unused" warning caused by the use of getopts
# with an obligatory (but unused) variable name in the main function.
disable=SC2034
# Disable all the "quote to prevent globbing or word splitting" advice.
# We need word splitting for well-known variables like MAKEFLAGS and CFLAGS.
disable=SC2086,SC2206

19
ci/LICENSE_MIT.txt Normal file
View File

@ -0,0 +1,19 @@
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

25
ci/README.md Normal file
View File

@ -0,0 +1,25 @@
Scripts for the Continuous Integration of the PNG Reference Library
===================================================================
Copyright Notice
----------------
Copyright (c) 2019-2025 Cosmin Truta.
Use, modification and distribution are subject to the MIT License.
Please see the accompanying file `LICENSE_MIT.txt` or visit
https://opensource.org/license/mit
File List
---------
LICENSE_MIT.txt ==> The License file
README.md ==> This file
ci_lint.sh ==> Lint the source code
ci_shellify.sh ==> Convert select definitions to shell syntax
ci_verify_cmake.sh ==> Verify the build driven by CMakeLists.txt
ci_verify_configure.sh ==> Verify the build driven by configure
ci_verify_makefiles.sh ==> Verify the build driven by scripts/makefile.*
ci_verify_version.sh ==> Verify the consistency of version definitions
lib/ci.lib.sh ==> Shell utilities for the main ci_*.sh scripts
targets/*/ci_env.*.sh ==> Shell environments for cross-platform testing

142
ci/ci_lint.sh Executable file
View File

@ -0,0 +1,142 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
# Initialize the global constants CI_{...}{CHECK,CHECKER,LINT}.
CI_SHELLCHECK="${CI_SHELLCHECK:-shellcheck}"
CI_EDITORCONFIG_CHECKER="${CI_EDITORCONFIG_CHECKER:-editorconfig-checker}"
CI_YAMLLINT="${CI_YAMLLINT:-yamllint}"
# Initialize the global lint status.
CI_LINT_STATUS=0
function ci_init_lint {
ci_info "## START OF LINTING ##"
local my_program
# Complete the initialization of CI_SHELLCHECK.
# Set it to the empty string if the shellcheck program is unavailable.
my_program="$(command -v "$CI_SHELLCHECK")" || {
ci_warn "program not found: '$CI_SHELLCHECK'"
}
CI_SHELLCHECK="$my_program"
# Complete the initialization of CI_EDITORCONFIG_CHECKER.
# Set it to the empty string if the editorconfig-checker program is unavailable.
my_program="$(command -v "$CI_EDITORCONFIG_CHECKER")" || {
ci_warn "program not found: '$CI_EDITORCONFIG_CHECKER'"
}
CI_EDITORCONFIG_CHECKER="$my_program"
# Complete the initialization of CI_YAMLLINT.
# Set it to the empty string if the yamllint program is unavailable.
my_program="$(command -v "$CI_YAMLLINT")" || {
ci_warn "program not found: '$CI_YAMLLINT'"
}
CI_YAMLLINT="$my_program"
}
function ci_finish_lint {
ci_info "## END OF LINTING ##"
if [[ $CI_LINT_STATUS -eq 0 ]]
then
ci_info "## SUCCESS ##"
else
ci_info "linting failed"
fi
return "$CI_LINT_STATUS"
}
function ci_lint_ci_scripts {
[[ -x $CI_SHELLCHECK ]] || {
ci_warn "## NOT LINTING: CI scripts ##"
return 0
}
ci_info "## LINTING: CI scripts ##"
ci_spawn "$CI_SHELLCHECK" --version
find ./ci -name "ci_*.sh" -not -name "ci_env.*.sh" | {
local my_file
while IFS="" read -r my_file
do
ci_spawn "$CI_SHELLCHECK" -x "$my_file" || {
# Linting failed.
return 1
}
done
}
}
function ci_lint_text_files {
[[ -x $CI_EDITORCONFIG_CHECKER ]] || {
ci_warn "## NOT LINTING: text files ##"
return 0
}
ci_info "## LINTING: text files ##"
ci_spawn "$CI_EDITORCONFIG_CHECKER" --version
ci_spawn "$CI_EDITORCONFIG_CHECKER" --config .editorconfig-checker.json || {
# Linting failed.
return 1
}
}
function ci_lint_yaml_files {
[[ -x $CI_YAMLLINT ]] || {
ci_warn "## NOT LINTING: YAML files ##"
return 0
}
ci_info "## LINTING: YAML files ##"
ci_spawn "$CI_YAMLLINT" --version
# Considering that the YAML format is an extension of the JSON format,
# we can lint both the YAML files and the plain JSON files here.
find . \( -iname "*.yml" -o -iname "*.yaml" -o -iname "*.json" \) -not -path "./out/*" | {
local my_file
while IFS="" read -r my_file
do
ci_spawn "$CI_YAMLLINT" --strict "$my_file" || {
# Linting failed.
return 1
}
done
}
}
function ci_lint {
ci_init_lint
ci_lint_ci_scripts || CI_LINT_STATUS=1
ci_lint_text_files || CI_LINT_STATUS=1
ci_lint_yaml_files || CI_LINT_STATUS=1
# TODO: ci_lint_png_files, etc.
ci_finish_lint
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] || {
echo >&2 "error: unexpected argument: '$1'"
usage 2
}
# And... go!
ci_lint
}
main "$@"

209
ci/ci_verify_cmake.sh Executable file
View File

@ -0,0 +1,209 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_cmake.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
function ci_init_build {
# Ensure that the mandatory variables are initialized.
CI_CMAKE="${CI_CMAKE:-cmake}"
CI_CTEST="${CI_CTEST:-ctest}"
CI_CMAKE_BUILD_TYPE="${CI_CMAKE_BUILD_TYPE:-Release}"
if [[ $CI_CMAKE_GENERATOR == "Visual Studio"* ]]
then
# Clean up incidental mixtures of Windows and Bash-on-Windows
# environment variables, to avoid confusing MSBuild.
[[ $TEMP && ( $Temp || $temp ) ]] && unset TEMP
[[ $TMP && ( $Tmp || $tmp ) ]] && unset TMP
# Ensure that CI_CMAKE_GENERATOR_PLATFORM is initialized for this generator.
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] || {
ci_err_internal "missing \$CI_CMAKE_GENERATOR_PLATFORM"
}
elif [[ -x $(command -v ninja) ]]
then
CI_CMAKE_GENERATOR="${CI_CMAKE_GENERATOR:-Ninja}"
fi
}
function ci_trace_build {
ci_info "## START OF CONFIGURATION ##"
ci_info "build arch: $CI_BUILD_ARCH"
ci_info "build system: $CI_BUILD_SYSTEM"
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
ci_info "target arch: $CI_TARGET_ARCH"
ci_info "target system: $CI_TARGET_SYSTEM"
}
ci_info "source directory: $CI_SRC_DIR"
ci_info "build directory: $CI_BUILD_DIR"
ci_info "install directory: $CI_INSTALL_DIR"
ci_info "environment option: \$CI_CMAKE: '$CI_CMAKE'"
ci_info "environment option: \$CI_CMAKE_GENERATOR: '$CI_CMAKE_GENERATOR'"
ci_info "environment option: \$CI_CMAKE_GENERATOR_PLATFORM: '$CI_CMAKE_GENERATOR_PLATFORM'"
ci_info "environment option: \$CI_CMAKE_BUILD_TYPE: '$CI_CMAKE_BUILD_TYPE'"
ci_info "environment option: \$CI_CMAKE_BUILD_FLAGS: '$CI_CMAKE_BUILD_FLAGS'"
ci_info "environment option: \$CI_CMAKE_TOOLCHAIN_FILE: '$CI_CMAKE_TOOLCHAIN_FILE'"
ci_info "environment option: \$CI_CMAKE_VARS: '$CI_CMAKE_VARS'"
ci_info "environment option: \$CI_CTEST: '$CI_CTEST'"
ci_info "environment option: \$CI_CTEST_FLAGS: '$CI_CTEST_FLAGS'"
ci_info "environment option: \$CI_CC: '$CI_CC'"
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
ci_info "environment option: \$CI_AR: '$CI_AR'"
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_CMAKE: $(command -V "$CI_CMAKE")"
ci_info "executable: \$CI_CTEST: $(command -V "$CI_CTEST")"
[[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
}
[[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
}
[[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
}
ci_info "## END OF CONFIGURATION ##"
}
function ci_cleanup_old_build {
ci_info "## START OF PRE-BUILD CLEANUP ##"
[[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
ci_spawn rm -fr "$CI_BUILD_DIR"
ci_spawn rm -fr "$CI_INSTALL_DIR"
}
ci_info "## END OF PRE-BUILD CLEANUP ##"
}
function ci_build {
ci_info "## START OF BUILD ##"
# Adjust the CI environment variables, as needed.
CI_CMAKE="$(command -v "$CI_CMAKE")" || ci_err "bad or missing \$CI_CMAKE"
ci_spawn "$CI_CMAKE" --version
CI_CTEST="$(command -v "$CI_CTEST")" || ci_err "bad or missing \$CI_CTEST"
ci_spawn "$CI_CTEST" --version
[[ $CI_CMAKE_GENERATOR == *"Ninja"* ]] && {
CI_NINJA="$(command -v ninja)" || ci_err "bad or missing ninja, no pun intended"
ci_spawn "$CI_NINJA" --version
}
[[ $CI_AR ]] && {
# Use the full path of CI_AR to work around a mysterious CMake error.
CI_AR="$(command -v "$CI_AR")" || ci_err "bad or missing \$CI_AR"
}
[[ $CI_RANLIB ]] && {
# Use the full path of CI_RANLIB to work around a mysterious CMake error.
CI_RANLIB="$(command -v "$CI_RANLIB")" || ci_err "bad or missing \$CI_RANLIB"
}
# Export the CMake environment variables.
[[ $CI_CMAKE_GENERATOR ]] && {
ci_spawn export CMAKE_GENERATOR="$CI_CMAKE_GENERATOR"
}
[[ $CI_CMAKE_GENERATOR_PLATFORM ]] && {
ci_spawn export CMAKE_GENERATOR_PLATFORM="$CI_CMAKE_GENERATOR_PLATFORM"
}
# Initialize and populate the local arrays.
local all_cmake_vars=()
local all_cmake_build_flags=()
local all_ctest_flags=()
[[ $CI_CMAKE_TOOLCHAIN_FILE ]] && {
all_cmake_vars+=("-DCMAKE_TOOLCHAIN_FILE=$CI_CMAKE_TOOLCHAIN_FILE")
}
[[ $CI_CC ]] && {
all_cmake_vars+=("-DCMAKE_C_COMPILER=$CI_CC")
}
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS+="${CI_CC_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
all_cmake_vars+=("-DCMAKE_C_FLAGS=$CI_CC_FLAGS")
}
[[ $CI_AR ]] && {
all_cmake_vars+=("-DCMAKE_AR=$CI_AR")
}
[[ $CI_RANLIB ]] && {
all_cmake_vars+=("-DCMAKE_RANLIB=$CI_RANLIB")
}
all_cmake_vars+=("-DCMAKE_BUILD_TYPE=$CI_CMAKE_BUILD_TYPE")
all_cmake_vars+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
all_cmake_vars+=($CI_CMAKE_VARS)
all_cmake_build_flags+=($CI_CMAKE_BUILD_FLAGS)
all_ctest_flags+=($CI_CTEST_FLAGS)
# And... build!
ci_spawn mkdir -p "$CI_BUILD_DIR"
# Spawn "cmake ...".
ci_spawn "$CI_CMAKE" -B "$CI_BUILD_DIR" \
-S . \
-DCMAKE_INSTALL_PREFIX="$CI_INSTALL_DIR" \
"${all_cmake_vars[@]}"
ci_expr $((CI_NO_BUILD)) || {
# Spawn "cmake --build ...".
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
--config "$CI_CMAKE_BUILD_TYPE" \
"${all_cmake_build_flags[@]}"
}
ci_expr $((CI_NO_TEST)) || {
# Spawn "ctest" if testing is not disabled.
ci_spawn pushd "$CI_BUILD_DIR"
ci_spawn "$CI_CTEST" --build-config "$CI_CMAKE_BUILD_TYPE" \
"${all_ctest_flags[@]}"
ci_spawn popd
}
ci_expr $((CI_NO_INSTALL)) || {
# Spawn "cmake --build ... --target install" if installation is not disabled.
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
--config "$CI_CMAKE_BUILD_TYPE" \
--target install \
"${all_cmake_build_flags[@]}"
}
ci_expr $((CI_NO_CLEAN)) || {
# Spawn "make --build ... --target clean" if cleaning is not disabled.
ci_spawn "$CI_CMAKE" --build "$CI_BUILD_DIR" \
--config "$CI_CMAKE_BUILD_TYPE" \
--target clean \
"${all_cmake_build_flags[@]}"
}
ci_info "## END OF BUILD ##"
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
# And... go!
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
echo >&2 "error: unexpected argument: '$1'"
echo >&2 "note: this program accepts environment options only"
usage 2
}
ci_cleanup_old_build
ci_build
}
main "$@"

182
ci/ci_verify_configure.sh Executable file
View File

@ -0,0 +1,182 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
CI_OUT_DIR="$CI_TOPLEVEL_DIR/out"
CI_BUILD_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.build"
CI_INSTALL_DIR="$CI_OUT_DIR/ci_verify_configure.$CI_TARGET_SYSTEM.$CI_TARGET_ARCH.install"
function ci_init_build {
# Ensure that the mandatory variables are initialized.
CI_MAKE="${CI_MAKE:-make}"
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] || {
# For native builds, set CI_CC to "cc" by default if the cc command is available.
# The configure script defaults CC to "gcc", which is not always a good idea.
[[ -x $(command -v cc) ]] && CI_CC="${CI_CC:-cc}"
}
# Ensure that the CI_ variables that cannot be customized reliably are not initialized.
[[ ! $CI_CONFIGURE_VARS ]] || {
ci_err "unsupported: \$CI_CONFIGURE_VARS='$CI_CONFIGURE_VARS'"
}
[[ ! $CI_MAKE_VARS ]] || {
ci_err "unsupported: \$CI_MAKE_VARS='$CI_MAKE_VARS'"
}
}
function ci_trace_build {
ci_info "## START OF CONFIGURATION ##"
ci_info "build arch: $CI_BUILD_ARCH"
ci_info "build system: $CI_BUILD_SYSTEM"
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
ci_info "target arch: $CI_TARGET_ARCH"
ci_info "target system: $CI_TARGET_SYSTEM"
}
ci_info "source directory: $CI_SRC_DIR"
ci_info "build directory: $CI_BUILD_DIR"
ci_info "install directory: $CI_INSTALL_DIR"
ci_info "environment option: \$CI_CONFIGURE_FLAGS: '$CI_CONFIGURE_FLAGS'"
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
ci_info "environment option: \$CI_CC: '$CI_CC'"
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
ci_info "environment option: \$CI_AR: '$CI_AR'"
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
ci_info "environment option: \$CI_LD: '$CI_LD'"
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
[[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
}
[[ $CI_CPP ]] && {
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
}
[[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
}
[[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
}
[[ $CI_LD ]] && {
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
}
ci_info "## END OF CONFIGURATION ##"
}
function ci_cleanup_old_build {
ci_info "## START OF PRE-BUILD CLEANUP ##"
[[ ! -e $CI_BUILD_DIR && ! -e $CI_INSTALL_DIR ]] || {
ci_spawn rm -fr "$CI_BUILD_DIR"
ci_spawn rm -fr "$CI_INSTALL_DIR"
}
[[ ! -e "$CI_SRC_DIR/config.status" ]] || {
ci_warn "unexpected build configuration file: '$CI_SRC_DIR/config.status'"
if ci_expr $((CI_FORCE))
then
# Delete the old config and (possibly) the old build.
ci_info "note: forcing an in-tree build cleanup"
if [[ -f $CI_SRC_DIR/Makefile ]]
then
ci_spawn make -C "$CI_SRC_DIR" distclean
else
ci_spawn rm -fr "$CI_SRC_DIR"/config.{log,status}
fi
else
# Alert the user, but do not delete their files.
ci_warn "the configure script might fail"
ci_info "hint: consider using the option \$CI_FORCE=1"
fi
}
ci_info "## END OF PRE-BUILD CLEANUP ##"
}
function ci_build {
ci_info "## START OF BUILD ##"
# Export the configure build environment.
[[ $CI_CC ]] && ci_spawn export CC="$CI_CC"
[[ $CI_CC_FLAGS ]] && ci_spawn export CFLAGS="$CI_CC_FLAGS"
[[ $CI_CPP ]] && ci_spawn export CPP="$CI_CPP"
[[ $CI_CPP_FLAGS ]] && ci_spawn export CPPFLAGS="$CI_CPP_FLAGS"
[[ $CI_AR ]] && ci_spawn export AR="$CI_AR"
[[ $CI_RANLIB ]] && ci_spawn export RANLIB="$CI_RANLIB"
[[ $CI_LD ]] && ci_spawn export LD="$CI_LD"
[[ $CI_LD_FLAGS ]] && ci_spawn export LDFLAGS="$CI_LD_FLAGS"
[[ $CI_SANITIZERS ]] && {
ci_spawn export CFLAGS="${CFLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
ci_spawn export LDFLAGS="${LDFLAGS}${LDFLAGS:+" "}-fsanitize=$CI_SANITIZERS"
}
# Spawn "autogen.sh" if the configure script is not available.
[[ -x "$CI_SRC_DIR/configure" ]] || {
ci_spawn "$CI_SRC_DIR/autogen.sh" --maintainer
}
# And... build!
ci_spawn mkdir -p "$CI_BUILD_DIR"
ci_spawn cd "$CI_BUILD_DIR"
# Spawn "configure".
ci_spawn "$CI_SRC_DIR/configure" --prefix="$CI_INSTALL_DIR" $CI_CONFIGURE_FLAGS
ci_expr $((CI_NO_BUILD)) || {
# Spawn "make".
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS
}
ci_expr $((CI_NO_TEST)) || {
# Spawn "make test" if testing is not disabled.
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS test
}
ci_expr $((CI_NO_INSTALL)) || {
# Spawn "make install" if installation is not disabled.
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS install
}
ci_expr $((CI_NO_CLEAN)) || {
# Spawn "make clean" and "make distclean" if cleaning is not disabled.
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS clean
ci_spawn "$CI_MAKE" $CI_MAKE_FLAGS distclean
}
ci_info "## END OF BUILD ##"
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
# And... go!
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
echo >&2 "error: unexpected argument: '$1'"
echo >&2 "note: this program accepts environment options only"
usage 2
}
ci_cleanup_old_build
ci_build
}
main "$@"

200
ci/ci_verify_makefiles.sh Executable file
View File

@ -0,0 +1,200 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
CI_SRC_DIR="$CI_TOPLEVEL_DIR"
function ci_init_build {
# Ensure that the mandatory variables are initialized.
CI_MAKE="${CI_MAKE:-make}"
case "$CI_CC" in
( *clang* )
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.clang"}" ;;
( *gcc* )
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.gcc"}" ;;
( * )
CI_MAKEFILES="${CI_MAKEFILES:-"scripts/makefile.std"}" ;;
esac
}
function ci_trace_build {
ci_info "## START OF CONFIGURATION ##"
ci_info "build arch: $CI_BUILD_ARCH"
ci_info "build system: $CI_BUILD_SYSTEM"
[[ "$CI_TARGET_SYSTEM.$CI_TARGET_ARCH" != "$CI_BUILD_SYSTEM.$CI_BUILD_ARCH" ]] && {
ci_info "target arch: $CI_TARGET_ARCH"
ci_info "target system: $CI_TARGET_SYSTEM"
}
ci_info "source directory: $CI_SRC_DIR"
ci_info "environment option: \$CI_MAKEFILES: '$CI_MAKEFILES'"
ci_info "environment option: \$CI_MAKE: '$CI_MAKE'"
ci_info "environment option: \$CI_MAKE_FLAGS: '$CI_MAKE_FLAGS'"
ci_info "environment option: \$CI_MAKE_VARS: '$CI_MAKE_VARS'"
ci_info "environment option: \$CI_CC: '$CI_CC'"
ci_info "environment option: \$CI_CC_FLAGS: '$CI_CC_FLAGS'"
ci_info "environment option: \$CI_CPP: '$CI_CPP'"
ci_info "environment option: \$CI_CPP_FLAGS: '$CI_CPP_FLAGS'"
ci_info "environment option: \$CI_AR: '$CI_AR'"
ci_info "environment option: \$CI_RANLIB: '$CI_RANLIB'"
ci_info "environment option: \$CI_LD: '$CI_LD'"
ci_info "environment option: \$CI_LD_FLAGS: '$CI_LD_FLAGS'"
ci_info "environment option: \$CI_LIBS: '$CI_LIBS'"
ci_info "environment option: \$CI_SANITIZERS: '$CI_SANITIZERS'"
ci_info "environment option: \$CI_FORCE: '$CI_FORCE'"
ci_info "environment option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
ci_info "environment option: \$CI_NO_TEST: '$CI_NO_TEST'"
ci_info "environment option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
ci_info "executable: \$CI_MAKE: $(command -V "$CI_MAKE")"
[[ $CI_CC ]] && {
ci_info "executable: \$CI_CC: $(command -V "$CI_CC")"
}
[[ $CI_CPP ]] && {
ci_info "executable: \$CI_CPP: $(command -V "$CI_CPP")"
}
[[ $CI_AR ]] && {
ci_info "executable: \$CI_AR: $(command -V "$CI_AR")"
}
[[ $CI_RANLIB ]] && {
ci_info "executable: \$CI_RANLIB: $(command -V "$CI_RANLIB")"
}
[[ $CI_LD ]] && {
ci_info "executable: \$CI_LD: $(command -V "$CI_LD")"
}
ci_info "## END OF CONFIGURATION ##"
}
function ci_cleanup_old_build {
# Any old makefile-based build will most likely leave a mess
# of object files behind if interrupted, e.g., via Ctrl+C.
# There may be other files behind, depending on what makefile
# had been used. We cannot easily enumerate all of those.
# Fortunately, for a clean makefiles-based build, it should be
# sufficient to remove the old object files only.
ci_info "## START OF PRE-BUILD CLEANUP ##"
local find_args=(-maxdepth 1 \( -iname "*.o" -o -iname "*.obj" \))
[[ ! $(find "$CI_SRC_DIR" "${find_args[@]}" | head -n1) ]] || {
ci_warn "unexpected build found in '$CI_SRC_DIR'"
if ci_expr $((CI_FORCE))
then
# Delete the old build.
local my_file
find "$CI_SRC_DIR" "${find_args[@]}" |
while IFS="" read -r my_file
do
ci_spawn rm -fr "$my_file"
done
ci_info "## END OF PRE-BUILD CLEANUP ##"
else
# Alert the user, but do not delete their existing files,
# and do not mess up their existing build.
ci_info "hint: consider using the option \$CI_FORCE=1"
ci_err "unable to continue"
fi
}
}
function ci_build {
ci_info "## START OF BUILD ##"
# Initialize and populate the local arrays.
local all_make_flags=()
local all_make_vars=()
[[ $CI_MAKE_FLAGS ]] && {
all_make_flags+=($CI_MAKE_FLAGS)
}
[[ $CI_CC ]] && {
all_make_vars+=("CC=$CI_CC")
}
[[ $CI_CC_FLAGS || $CI_SANITIZERS ]] && {
[[ $CI_SANITIZERS ]] && CI_CC_FLAGS="${CI_CC_FLAGS:-"-O2"} -fsanitize=$CI_SANITIZERS"
all_make_vars+=("CFLAGS=$CI_CC_FLAGS")
}
[[ $CI_CPP ]] && {
all_make_vars+=("CPP=$CI_CPP")
}
[[ $CI_CPP_FLAGS ]] && {
all_make_vars+=("CPPFLAGS=$CI_CPP_FLAGS")
}
[[ $CI_AR ]] && {
all_make_vars+=("AR=$CI_AR")
}
[[ $CI_RANLIB ]] && {
all_make_vars+=("RANLIB=$CI_RANLIB")
}
[[ $CI_LD ]] && {
all_make_vars+=("LD=$CI_LD")
}
[[ $CI_LD_FLAGS || $CI_SANITIZERS ]] && {
[[ $CI_SANITIZERS ]] && CI_LD_FLAGS+="${CI_LD_FLAGS:+" "}-fsanitize=$CI_SANITIZERS"
all_make_vars+=("LDFLAGS=$CI_LD_FLAGS")
}
[[ $CI_LIBS ]] && {
all_make_vars+=("LIBS=$CI_LIBS")
}
all_make_vars+=($CI_MAKE_VARS)
# And... build!
local my_makefile
for my_makefile in $CI_MAKEFILES
do
ci_info "using makefile: $my_makefile"
ci_expr $((CI_NO_BUILD)) || {
# Spawn "make".
ci_spawn "$CI_MAKE" -f "$my_makefile" \
"${all_make_flags[@]}" \
"${all_make_vars[@]}"
}
ci_expr $((CI_NO_TEST)) || {
# Spawn "make test" if testing is not disabled.
ci_spawn "$CI_MAKE" -f "$my_makefile" \
"${all_make_flags[@]}" \
"${all_make_vars[@]}" \
test
}
ci_expr $((CI_NO_CLEAN)) || {
# Spawn "make clean" if cleaning is not disabled.
ci_spawn "$CI_MAKE" -f "$my_makefile" \
"${all_make_flags[@]}" \
"${all_make_vars[@]}" \
clean
}
done
ci_info "## END OF BUILD ##"
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
# And... go!
ci_init_build
ci_trace_build
[[ $# -eq 0 ]] || {
echo >&2 "error: unexpected argument: '$1'"
echo >&2 "note: this program accepts environment options only"
usage 2
}
ci_cleanup_old_build
ci_build
}
main "$@"

191
ci/ci_verify_version.sh Executable file
View File

@ -0,0 +1,191 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/lib/ci.lib.sh"
cd "$CI_TOPLEVEL_DIR"
# Declare the global environments collected from various sources.
declare CI_ENV_LIBPNG_VER # collected from png.h
declare CI_ENV_AUTOCONF_VER # collected from configure.ac
declare CI_ENV_CMAKE_VER # collected from CMakeLists.txt
declare CI_ENV_LIBPNGCONFIG_VER # collected from scripts/libpng-config-head.in
function ci_run_shellify {
local my_script my_result
my_script="$CI_SCRIPT_DIR/libexec/ci_shellify_${1#--}.sh"
shift 1
[[ -f $my_script ]] || {
ci_err_internal "missing script: '$my_script'"
}
ci_info "shellifying:" "$@"
"$BASH" "$my_script" "$@"
echo "$my_result" | "$BASH" --posix || ci_err "bad shellify output"
echo "$my_result"
}
function ci_init_version_verification {
ci_info "## START OF VERIFICATION ##"
CI_ENV_LIBPNG_VER="$(ci_run_shellify --c png.h)"
echo "$CI_ENV_LIBPNG_VER"
CI_ENV_AUTOCONF_VER="$(ci_run_shellify --autoconf configure.ac)"
echo "$CI_ENV_AUTOCONF_VER"
CI_ENV_CMAKE_VER="$(ci_run_shellify --cmake CMakeLists.txt)"
echo "$CI_ENV_CMAKE_VER"
CI_ENV_LIBPNGCONFIG_VER="$(ci_run_shellify --shell scripts/libpng-config-head.in)"
echo "$CI_ENV_LIBPNGCONFIG_VER"
}
# shellcheck disable=SC2154
function ci_do_version_verification {
local my_expect
ci_info "## VERIFYING: version definitions in 'png.h' ##"
eval "$CI_ENV_LIBPNG_VER"
my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect"* ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_STRING == $my_expect*"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_STRING != $my_expect*"
fi
my_expect=$((PNG_LIBPNG_VER_MAJOR*10000 + PNG_LIBPNG_VER_MINOR*100 + PNG_LIBPNG_VER_RELEASE))
if [[ "$PNG_LIBPNG_VER" == "$my_expect" ]]
then
ci_info "matched: \$PNG_LIBPNG_VER == $my_expect"
else
ci_err "mismatched: \$PNG_LIBPNG_VER != $my_expect"
fi
my_expect=$((PNG_LIBPNG_VER_MAJOR*10 + PNG_LIBPNG_VER_MINOR))
if [[ "$PNG_LIBPNG_VER_SHAREDLIB" == "$my_expect" ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_SHAREDLIB == $my_expect"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_SHAREDLIB != $my_expect"
fi
if [[ "$PNG_LIBPNG_VER_SONUM" == "$my_expect" ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_SONUM == $my_expect"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_SONUM != $my_expect"
fi
if [[ "$PNG_LIBPNG_VER_DLLNUM" == "$my_expect" ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_DLLNUM == $my_expect"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_DLLNUM != $my_expect"
fi
if [[ "$PNG_LIBPNG_VER_BUILD" == [01] ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_BUILD == [01]"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD != [01]"
fi
ci_info "## VERIFYING: build definitions in 'png.h' ##"
my_expect="${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}"
if [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect" ]]
then
if [[ $PNG_LIBPNG_VER_BUILD -eq 0 ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_BUILD -eq 0"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -ne 0"
fi
if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -eq $PNG_LIBPNG_BUILD_STABLE ]]
then
ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE"
else
ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE"
fi
elif [[ "$PNG_LIBPNG_VER_STRING" == "$my_expect".git ]]
then
if [[ $PNG_LIBPNG_VER_BUILD -ne 0 ]]
then
ci_info "matched: \$PNG_LIBPNG_VER_BUILD -ne 0"
else
ci_err "mismatched: \$PNG_LIBPNG_VER_BUILD -eq 0"
fi
if [[ $PNG_LIBPNG_BUILD_BASE_TYPE -ne $PNG_LIBPNG_BUILD_STABLE ]]
then
ci_info "matched: \$PNG_LIBPNG_BUILD_BASE_TYPE -ne \$PNG_LIBPNG_BUILD_STABLE"
else
ci_err "mismatched: \$PNG_LIBPNG_BUILD_BASE_TYPE -eq \$PNG_LIBPNG_BUILD_STABLE"
fi
else
ci_err "unexpected: \$PNG_LIBPNG_VER_STRING == '$PNG_LIBPNG_VER_STRING'"
fi
ci_info "## VERIFYING: type definitions in 'png.h' ##"
my_expect="$(echo "png_libpng_version_${PNG_LIBPNG_VER_STRING}" | tr . _)"
ci_spawn grep -w -e "$my_expect" png.h
ci_info "## VERIFYING: version definitions in 'configure.ac' ##"
eval "$CI_ENV_AUTOCONF_VER"
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" ]]
then
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
else
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
fi
ci_info "## VERIFYING: version definitions in 'CMakeLists.txt' ##"
eval "$CI_ENV_CMAKE_VER"
if [[ "$PNGLIB_VERSION" == "$PNG_LIBPNG_VER_STRING" && "$PNGLIB_SUBREVISION" == 0 ]]
then
ci_info "matched: \$PNGLIB_VERSION == \$PNG_LIBPNG_VER_STRING"
ci_info "matched: \$PNGLIB_SUBREVISION == 0"
elif [[ "$PNGLIB_VERSION.$PNGLIB_SUBREVISION" == "$PNG_LIBPNG_VER_STRING" ]]
then
ci_info "matched: \$PNGLIB_VERSION.\$PNGLIB_SUBREVISION == \$PNG_LIBPNG_VER_STRING"
else
ci_err "mismatched: \$PNGLIB_VERSION != \$PNG_LIBPNG_VER_STRING"
fi
ci_info "## VERIFYING: version definitions in 'scripts/libpng-config-head.in' ##"
eval "$CI_ENV_LIBPNGCONFIG_VER"
if [[ "$version" == "$PNG_LIBPNG_VER_STRING" ]]
then
ci_info "matched: \$version == \$PNG_LIBPNG_VER_STRING"
else
ci_err "mismatched: \$version != \$PNG_LIBPNG_VER_STRING"
fi
}
function ci_finish_version_verification {
ci_info "## END OF VERIFICATION ##"
# Relying on "set -o errexit" to not reach here in case of error.
ci_info "## SUCCESS ##"
}
function ci_verify_version {
ci_init_version_verification
ci_do_version_verification
ci_finish_version_verification
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>]"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] || {
echo >&2 "error: unexpected argument: '$1'"
usage 2
}
# And... go!
ci_verify_version
}
main "$@"

111
ci/lib/ci.lib.sh Normal file
View File

@ -0,0 +1,111 @@
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
test -f "$BASH_SOURCE" || {
echo >&2 "warning: this module requires Bash version 3 or newer"
}
test "${#BASH_SOURCE[@]}" -gt 1 || {
echo >&2 "warning: this module should be sourced from a Bash script"
}
# Reset the locale to avoid surprises from locale-dependent commands.
export LC_ALL=C
export LANG=C
export LANGUAGE=C
# Reset CDPATH to avoid surprises from the "cd" command.
export CDPATH=""
# Initialize the global constants CI_SCRIPT_{NAME,DIR} and CI_TOPLEVEL_DIR.
CI_SCRIPT_NAME="$(basename -- "$0")"
CI_SCRIPT_DIR="$(cd "$(dirname -- "$0")" && pwd)"
CI_TOPLEVEL_DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
# Initialize the global constants CI_BUILD_{...} for the host build platform.
CI_BUILD_ARCH="${CI_BUILD_ARCH:-"$(uname -m | tr 'A-Z/\.-' 'a-z____')"}"
CI_BUILD_SYSTEM="${CI_BUILD_SYSTEM:-"$(uname -s | tr 'A-Z/\.-' 'a-z____')"}"
# Initialize the global constants CI_TARGET_{...} for the target platform.
CI_TARGET_ARCH="${CI_TARGET_ARCH:-"$CI_BUILD_ARCH"}"
CI_TARGET_SYSTEM="${CI_TARGET_SYSTEM:-"$CI_BUILD_SYSTEM"}"
function ci_info {
printf >&2 "%s: %s\\n" "$CI_SCRIPT_NAME" "$*"
}
function ci_warn {
printf >&2 "%s: warning: %s\\n" "$CI_SCRIPT_NAME" "$*"
}
function ci_err {
printf >&2 "%s: error: %s\\n" "$CI_SCRIPT_NAME" "$*"
exit 2
}
function ci_err_internal {
printf >&2 "%s: internal error: %s\\n" "$CI_SCRIPT_NAME" "$*"
printf >&2 "ABORTED\\n"
# Exit with the conventional SIGABRT code.
exit 134
}
function ci_expr {
if [[ ${*:-0} == [0-9] ]]
then
# This is the same as in the else-branch below, albeit much faster
# for our intended use cases.
return $((!$1))
else
# The funny-looking compound command "... && return $? || return $?"
# allows the execution to continue uninterrupted under "set -e".
expr >/dev/null "$@" && return $? || return $?
fi
}
function ci_spawn {
printf >&2 "%s: executing:" "$CI_SCRIPT_NAME"
printf >&2 " %q" "$@"
printf >&2 "\\n"
"$@"
}
# Ensure that the internal initialization is correct.
[[ $CI_TOPLEVEL_DIR/ci/lib/ci.lib.sh -ef ${BASH_SOURCE[0]} ]] || {
ci_err_internal "bad or missing \$CI_TOPLEVEL_DIR"
}
[[ $CI_SCRIPT_DIR/$CI_SCRIPT_NAME -ef $0 ]] || {
ci_err_internal "bad or missing \$CI_SCRIPT_DIR/\$CI_SCRIPT_NAME"
}
[[ $CI_BUILD_ARCH && $CI_BUILD_SYSTEM ]] || {
ci_err_internal "missing \$CI_BUILD_ARCH or \$CI_BUILD_SYSTEM"
}
[[ $CI_TARGET_ARCH && $CI_TARGET_SYSTEM ]] || {
ci_err_internal "missing \$CI_TARGET_ARCH or \$CI_TARGET_SYSTEM"
}
# Ensure that the user initialization is correct.
[[ ${CI_FORCE:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_FORCE: '$CI_FORCE'"
}
[[ ${CI_NO_BUILD:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_BUILD: '$CI_NO_BUILD'"
}
[[ ${CI_NO_TEST:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_TEST: '$CI_NO_TEST'"
}
[[ ${CI_NO_INSTALL:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_INSTALL: '$CI_NO_INSTALL'"
}
[[ ${CI_NO_CLEAN:-0} == [01] ]] || {
ci_err "bad boolean option: \$CI_NO_CLEAN: '$CI_NO_CLEAN'"
}
if ci_expr $((CI_NO_BUILD))
then
ci_expr $((CI_NO_TEST && CI_NO_INSTALL)) || {
ci_err "\$CI_NO_BUILD requires \$CI_NO_TEST and \$CI_NO_INSTALL"
}
fi

View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/../lib/ci.lib.sh"
function ci_shellify_autoconf {
# Convert autoconf (M4) text, specifically originating
# from configure.ac, to shell scripting text.
# Select only the easy-to-parse definitions of PNGLIB_*.
sed -n -e '/^ *PNGLIB_[^ ]*=[$"0-9A-Za-z_]/ p' |
sed -e 's/^ *PNG\([0-9A-Za-z_]*\)=\([^# ]*\).*$/PNG\1=\2/' \
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>] configure.ac"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] && usage 2
[[ $# -eq 1 ]] || ci_err "too many operands"
# And... go!
test -e "$1" || ci_err "no such file: '$1'"
[[ $(basename -- "$1") == configure.ac ]] || {
ci_err "incorrect operand: '$1' (expecting: 'configure.ac')"
}
ci_shellify_autoconf <"$1"
}
main "$@"

49
ci/libexec/ci_shellify_c.sh Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/../lib/ci.lib.sh"
function ci_shellify_c {
# Convert C preprocessor text, specifically originating
# from png.h, to shell scripting text.
# Select only the easy-to-parse definitions of PNG_LIBPNG_*.
sed -n -e '/^\# *define * PNG_LIBPNG_[^ ]* * ["0-9A-Za-z_]/ p' |
sed -e 's/^\# *define * PNG\([^ ]*\) * \([^ ]*\)/PNG\1=\2/' \
-e 's/=PNG\([0-9A-Za-z_]*\)/=\${PNG\1}/' \
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>] png.h"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] && usage 2
[[ $# -eq 1 ]] || ci_err "too many operands"
# And... go!
test -e "$1" || ci_err "no such file: '$1'"
[[ $(basename -- "$1") == png.h ]] || {
ci_err "incorrect operand: '$1' (expecting: 'png.h')"
}
ci_shellify_c <"$1"
}
main "$@"

49
ci/libexec/ci_shellify_cmake.sh Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/../lib/ci.lib.sh"
function ci_shellify_cmake {
# Convert CMake lists text, specifically originating
# from CMakeLists.txt, to shell scripting text.
# Select only the easy-to-parse definitions of PNGLIB_*.
sed -n -e '/^ *set *(PNGLIB_[^ ]* * [$"0-9A-Za-z_].*)/ p' |
sed -e 's/^ *set *(PNG\([^ ]*\) * \([^() ]*\)).*$/PNG\1=\2/' \
-e 's/^\([^ ]*=[^ ]*\).*$/export \1;/'
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>] CMakeLists.txt"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] && usage 2
[[ $# -eq 1 ]] || ci_err "too many operands"
# And... go!
test -e "$1" || ci_err "no such file: '$1'"
filename="$(basename -- "$1")"
[[ $filename == [Cc][Mm]ake[Ll]ists.txt ]] || {
ci_err "incorrect operand: '$1' (expecting: 'CMakeLists.txt')"
}
ci_shellify_cmake <"$1"
}
main "$@"

46
ci/libexec/ci_shellify_shell.sh Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -o errexit -o pipefail -o posix
# Copyright (c) 2019-2025 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
# shellcheck source=ci/lib/ci.lib.sh
source "$(dirname "$0")/../lib/ci.lib.sh"
function ci_shellify_shell {
# Convert shell scripting text to shell scripting text.
# Select only the easy-to-parse version definitions.
sed -n -e '/^ *[A-Za-z_][0-9A-Za-z_]*=[0-9][^ #]* *$/ p' |
sed -e 's/^ *\([^ ]*=[^ ]*\) *$/export \1;/'
}
function usage {
echo "usage: $CI_SCRIPT_NAME [<options>] libpng-config-head.in"
echo "options: -?|-h|--help"
exit "${@:-0}"
}
function main {
local opt
while getopts ":" opt
do
# This ain't a while-loop. It only pretends to be.
[[ $1 == -[?h]* || $1 == --help || $1 == --help=* ]] && usage 0
ci_err "unknown option: '$1'"
done
shift $((OPTIND - 1))
[[ $# -eq 0 ]] && usage 2
[[ $# -eq 1 ]] || ci_err "too many operands"
# And... go!
test -e "$1" || ci_err "no such file: '$1'"
[[ $(basename -- "$1") == libpng-config-head.in ]] || {
ci_err "incorrect operand: '$1' (expecting: 'libpng-config-head.in')"
}
ci_shellify_shell <"$1"
}
main "$@"

View File

@ -0,0 +1,16 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=aarch64
export CI_TARGET_ARCHVER=aarch64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=android
export CI_TARGET_ABIVER=android29
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"

View File

@ -0,0 +1,16 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=arm
export CI_TARGET_ARCHVER=armv7a
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=androideabi
export CI_TARGET_ABIVER=androideabi29
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"

View File

@ -0,0 +1,16 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_ARCHVER=i686
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=android
export CI_TARGET_ABIVER=android29
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"

View File

@ -0,0 +1,16 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_ARCHVER=x86_64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=android
export CI_TARGET_ABIVER=android29
export CI_CC="$CI_TARGET_ARCHVER-$CI_TARGET_SYSTEM-$CI_TARGET_ABIVER-clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_SYSTEM=cygwin
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
export CI_AR="$CI_CC-ar"
export CI_RANLIB="$CI_CC-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=CYGWIN
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=cygwin
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
export CI_AR="$CI_CC-ar"
export CI_RANLIB="$CI_CC-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=CYGWIN
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,15 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=arm64
export CI_TARGET_SYSTEM=darwin
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Darwin
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
-DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,15 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=darwin
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Darwin
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
-DCMAKE_OSX_ARCHITECTURES=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,14 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=aarch64
export CI_TARGET_SYSTEM=freebsd
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=FreeBSD
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,14 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_SYSTEM=freebsd
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=FreeBSD
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,14 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=riscv64
export CI_TARGET_SYSTEM=freebsd
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=FreeBSD
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,14 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=freebsd
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=FreeBSD
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=aarch64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=arm
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnueabi
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=arm
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnueabihf
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mips
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mips64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnuabi64
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mips64el
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnuabi64
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mipsel
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mipsisa32r6
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mipsisa32r6el
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mipsisa64r6
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnuabi64
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=mipsisa64r6el
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnuabi64
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=powerpc
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=powerpc64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=powerpc64le
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=riscv64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=linux
export CI_TARGET_ABI=gnu
export CI_GCC="${CI_GCC-gcc}"
export CI_CC="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-$CI_GCC"
export CI_AR="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ar"
export CI_RANLIB="$CI_TARGET_ARCH-$CI_TARGET_SYSTEM-$CI_TARGET_ABI-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i386
export CI_TARGET_SYSTEM=msdoswatcom
export CI_CC="wcl386"
# Open Watcom V2 CMake build
# https://github.com/open-watcom/open-watcom-v2/discussions/716
export CI_CMAKE_GENERATOR="Watcom WMake"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=DOS
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i586
export CI_TARGET_SYSTEM=msdosdjgpp
export CI_CC="$CI_TARGET_ARCH-pc-$CI_TARGET_SYSTEM-gcc"
export CI_AR="$CI_CC-ar"
export CI_RANLIB="$CI_CC-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Generic
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,19 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i86
export CI_TARGET_SYSTEM=msdoswatcom
export CI_CC="wcl"
# Open Watcom V2 CMake build
# https://github.com/open-watcom/open-watcom-v2/discussions/716
export CI_CMAKE_GENERATOR="Watcom WMake"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=DOS
-DCMAKE_SYSTEM_PROCESSOR=I86
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=aarch64
export CI_TARGET_SYSTEM=windows
export CI_CC="clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Windows
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_SYSTEM=mingw32
# The output of `uname -s` on MSYS2 is understandable, and so is
# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.)
# But aside from that, the Mingw-w64 nomenclature is rather messy.
export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc"
export CI_AR="$CI_CC-ar"
export CI_RANLIB="$CI_CC-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Windows
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=i686
export CI_TARGET_SYSTEM=windows
export CI_CC="clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Windows
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,21 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=mingw64
# The output of `uname -s` on MSYS2 is understandable, and so is
# CI_TARGET_SYSTEM above, in simplified form. (See also Cygwin.)
# But aside from that, the Mingw-w64 nomenclature is rather messy.
export CI_CC="$CI_TARGET_ARCH-w64-mingw32-gcc"
export CI_AR="$CI_CC-ar"
export CI_RANLIB="$CI_CC-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Windows
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

View File

@ -0,0 +1,18 @@
# Copyright (c) 2023-2024 Cosmin Truta.
#
# Use, modification and distribution are subject to the MIT License.
# Please see the accompanying file LICENSE_MIT.txt
#
# SPDX-License-Identifier: MIT
export CI_TARGET_ARCH=x86_64
export CI_TARGET_SYSTEM=windows
export CI_CC="clang"
export CI_AR="llvm-ar"
export CI_RANLIB="llvm-ranlib"
export CI_CMAKE_VARS="
-DCMAKE_SYSTEM_NAME=Windows
-DCMAKE_SYSTEM_PROCESSOR=$CI_TARGET_ARCH
"

364
compile Executable file
View File

@ -0,0 +1,364 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2025-06-18.21; # UTC
# Copyright (C) 1999-2025 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file unneeded_conversions
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no
# conversion will take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then
# MSYS2 environment.
file_conv=cygwin
else
# Original MinGW environment.
file_conv=mingw
fi
;;
MSYS*)
# Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell.
file_conv=cygwin
;;
CYGWIN*)
# Cygwin environment.
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
# This is the optimization mentioned above:
# If UNNEEDED_CONVERSIONS contains $file_conv, don't convert.
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -w "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.lo | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
GNU Automake home page: <https://www.gnu.org/software/automake/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
EOF
exit $?
;;
-v | --v*)
echo "compile (GNU Automake) $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%Y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

1815
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

138
config.h.in Normal file
View File

@ -0,0 +1,138 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the 'feenableexcept' function. */
#undef HAVE_FEENABLEEXCEPT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the 'm' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the 'z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the 'pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Turn on ARM Neon optimizations at run-time */
#undef PNG_ARM_NEON_API_SUPPORTED
/* Check for ARM Neon support at run-time */
#undef PNG_ARM_NEON_CHECK_SUPPORTED
/* Enable ARM Neon optimizations */
#undef PNG_ARM_NEON_OPT
/* Enable Intel SSE optimizations */
#undef PNG_INTEL_SSE_OPT
/* Enable LOONGARCH LSX optimizations */
#undef PNG_LOONGARCH_LSX_OPT
/* Turn on MIPS MMI optimizations at run-time */
#undef PNG_MIPS_MMI_API_SUPPORTED
/* Check for MIPS MMI support at run-time */
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
/* Enable MIPS MMI optimizations */
#undef PNG_MIPS_MMI_OPT
/* Turn on MIPS MSA optimizations at run-time */
#undef PNG_MIPS_MSA_API_SUPPORTED
/* Check for MIPS MSA support at run-time */
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
/* Enable MIPS MSA optimizations */
#undef PNG_MIPS_MSA_OPT
/* Turn on POWERPC VSX optimizations at run-time */
#undef PNG_POWERPC_VSX_API_SUPPORTED
/* Check for POWERPC VSX support at run-time */
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
/* Enable POWERPC VSX optimizations */
#undef PNG_POWERPC_VSX_OPT
/* Enable RISCV RVV optimizations */
#undef PNG_RISCV_RVV_OPT
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported only directly. */
#undef restrict
/* Work around a bug in older versions of Sun C++, which did not
#define __restrict__ or support _Restrict or __restrict__
even though the corresponding Sun C compiler ended up with
"#define restrict _Restrict" or "#define restrict __restrict__"
in the previous line. This workaround can be removed once
we assume Oracle Developer Studio 12.5 (2016) or later. */
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif

2354
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

18185
configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,12 @@
# configure.ac # configure.ac
# Copyright (c) 2018-2024 Cosmin Truta
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl dnl
dnl Minor upgrades (compatible ABI): increment the package version dnl Minor upgrades (compatible ABI): increment the package version
@ -18,17 +25,19 @@ AC_PREREQ([2.68])
dnl Version number stuff here: dnl Version number stuff here:
AC_INIT([libpng],[1.6.0beta33],[png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng],[1.6.51.git],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts]) AC_CONFIG_MACRO_DIR([scripts/autoconf])
# libpng does not follow GNU file name conventions (hence 'foreign') # libpng does not follow GNU file name conventions (hence 'foreign')
# color-tests requires automake 1.11 or later # color-tests requires automake 1.11 or later
# silent-rules requires automake 1.11 or later # silent-rules requires automake 1.11 or later
# dist-xz requires automake 1.11 or later # dist-xz requires automake 1.11 or later
# 1.12.2 fixes a security issue in 1.11.2 and 1.12.1 # 1.12.2 fixes a security issue in 1.11.2 and 1.12.1
AM_INIT_AUTOMAKE([1.12.2 foreign dist-xz dist-bzip2 color-tests silent-rules]) # 1.13 is required for parallel tests
# was: AM_INIT_AUTOMAKE([1.13 foreign dist-xz color-tests silent-rules subdir-objects])
# AM_INIT_AUTOMAKE # The following line causes --disable-maintainer-mode to be the default to
# configure. This is necessary because libpng distributions cannot rely on the
# time stamps of the autotools generated files being correct
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later dnl configure.ac and Makefile.am expect automake 1.11.2 or a compatible later
@ -37,62 +46,75 @@ dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2]) dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake dnl stop configure from automagically running automake
PNGLIB_VERSION=1.6.0beta33 PNGLIB_VERSION=1.6.51.git
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=6 PNGLIB_MINOR=6
PNGLIB_RELEASE=0 PNGLIB_RELEASE=51
dnl End of version number stuff dnl End of version number stuff
AC_CONFIG_SRCDIR([pngget.c]) AC_CONFIG_SRCDIR([pngget.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
# Checks for programs. # Check the basic programs.
AC_LANG([C]) AC_LANG([C])
AC_PROG_CC AC_PROG_CC
AM_PROG_AS AM_PROG_AS
LT_PATH_LD LT_PATH_LD
AC_PROG_CPP AC_PROG_CPP
AC_CHECK_TOOL(SED, sed, :) AC_PROG_AWK
AC_CHECK_TOOL(AWK, awk, :)
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
dnl libtool/libtoolize; version 2.4.2 is the tested version, this or any dnl libtool/libtoolize; version 2.4.2 is the tested version. This or any
dnl compatible later version may be used dnl compatible later version may be used
LT_INIT([win32-dll]) LT_INIT([win32-dll])
LT_PREREQ([2.4.2]) LT_PREREQ([2.4.2])
# On Solaris 10 and 12 CPP gets set to cc -E, however this still dnl Declare the AWK variable.
# does some input parsing. We need strict ANSI-C style tokenization, AC_ARG_VAR(AWK, [AWK language processor])
# check this:
AC_REQUIRE_CPP # Some awk implementations crash when confronted with pnglibconf.dfa.
AC_MSG_CHECKING([for a C preprocessor that does not parse its input]) # Run a test now, to make sure this doesn't happen.
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])], AC_MSG_CHECKING([if awk ($AWK) works])
[DFNCPP="$CPP"], if ${AWK} -f ${srcdir}/scripts/options.awk out="/dev/null" version=search\
[ DFNCPP="" ${srcdir}/pngconf.h ${srcdir}/scripts/pnglibconf.dfa\
sav_CPP="$CPP" ${srcdir}/pngusr.dfa 1>&2
for CPP in "${CC-cc} -E" "${CC-cc} -E -traditional-cpp" "/lib/cpp" "cpp" then
do AC_MSG_RESULT([yes])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[1.1.1 16BIT]])],
[DFNCPP="$CPP"]
[break],,)
done
CPP="$sav_CPP"
])
if test -n "$DFNCPP"; then
AC_MSG_RESULT([$DFNCPP])
AC_SUBST(DFNCPP)
else else
AC_MSG_FAILURE([not found], 1) AC_MSG_FAILURE([no], 1)
fi fi
# -Werror cannot be passed to GCC in CFLAGS because configure will fail (it # This is a remnant of the old cc -E validation, where it may have been
# checks the compiler with a program that generates a warning), add the # necessary to use a different preprocessor for .dfn files
# following option to deal with this DFNCPP="$CPP"
AC_SUBST(DFNCPP)
AC_ARG_ENABLE([tests],
AS_HELP_STRING([--disable-tests],
[do not build the test programs (default is to build)]),
[enable_tests="$enableval"],
[enable_tests=yes])
AM_CONDITIONAL([ENABLE_TESTS],
[test "$enable_tests" != "no"])
AC_ARG_ENABLE([tools],
AS_HELP_STRING([--disable-tools],
[do not build the auxiliary tools (default is to build)]),
[enable_tools="$enableval"],
[enable_tools=yes])
AM_CONDITIONAL([ENABLE_TOOLS],
[test "$enable_tools" != "no"])
# -Werror cannot be passed to GCC in CFLAGS because configure will fail
# (it checks the compiler with a program that generates a warning).
# Add the following option to deal with this:
AC_ARG_VAR(PNG_COPTS, AC_ARG_VAR(PNG_COPTS,
[additional flags for the C compiler, use this for options that would] [additional flags for the C compiler, to be used for options that would]
[cause configure itself to fail]) [cause configure itself to fail])
AC_ARG_ENABLE(werror, AC_ARG_ENABLE(werror,
AS_HELP_STRING([[[--enable-werror[=OPT]]]], AS_HELP_STRING([[[--enable-werror[=OPT]]]],
@ -113,27 +135,46 @@ AC_ARG_ENABLE(werror,
CFLAGS="$sav_CFLAGS" CFLAGS="$sav_CFLAGS"
fi],) fi],)
# Checks for header files. # For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89.
AC_HEADER_STDC # In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining
AC_CHECK_HEADERS([malloc.h stdlib.h string.h strings.h]) # _POSIX_SOURCE to 1. This is incompatible with the new default mode, so
# we test for that and force the "-std=c89" compiler option:
AC_MSG_CHECKING([if we need to force back C standard to C89])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
[#define _POSIX_SOURCE 1]
[#include <stdio.h>]
])],
AC_MSG_RESULT(no),[
if test "x$GCC" != "xyes"; then
AC_MSG_ERROR(
[Forcing back to C89 is required but the flags are only known for GCC])
fi
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -std=c89"
])
# Checks for typedefs, structures, and compiler characteristics. # Checks for structures and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM AC_STRUCT_TM
AC_C_RESTRICT AC_C_RESTRICT
# Checks for library functions. # Checks for library functions.
AC_FUNC_STRTOD AC_CHECK_FUNCS([pow], ,
AC_CHECK_FUNCS([memset], , AC_MSG_ERROR(memset not found in libc)) [AC_CHECK_LIB([m], [pow], , [AC_MSG_ERROR([cannot find pow])])])
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_MSG_ERROR(cannot find pow)) )
# Some later POSIX 1003.1 functions are required for test programs, failure
# here is soft (the corresponding test program is not built).
AC_CHECK_FUNC([clock_gettime], , [AC_MSG_WARN([not building timepng])])
AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "$ac_cv_func_clock_gettime" = "yes"])
AC_ARG_WITH(zlib-prefix, AC_ARG_WITH(zlib-prefix,
AS_HELP_STRING([[[--with-zlib-prefix]]], AS_HELP_STRING([[[--with-zlib-prefix]]],
[prefix that may have been used in installed zlib]), [prefix that may have been used in installed zlib]),
[ZPREFIX=${withval}], [ZPREFIX=${withval}],
[ZPREFIX='z_']) [ZPREFIX='z_'])
AC_CHECK_LIB(z, zlibVersion, , AC_CHECK_LIB([z], [zlibVersion], ,
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, , AC_MSG_ERROR(zlib not installed))) [AC_CHECK_LIB([z], [${ZPREFIX}zlibVersion], ,
[AC_MSG_ERROR([zlib not installed])])])
# The following is for pngvalid, to ensure it catches FP errors even on # The following is for pngvalid, to ensure it catches FP errors even on
# platforms that don't enable FP exceptions, the function appears in the math # platforms that don't enable FP exceptions, the function appears in the math
@ -185,9 +226,9 @@ AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
if test "$have_ld_version_script" = "yes"; then if test "$have_ld_version_script" = "yes"; then
AC_MSG_CHECKING([for symbol prefix]) AC_MSG_CHECKING([for symbol prefix])
SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \
| ${CPP-${CC-gcc} -E} - 2>&1 \ | ${CPP:-${CC:-gcc} -E} - 2>&1 \
| ${EGREP-grep} "^PREFIX=" \ | ${EGREP:-grep} "^PREFIX=" \
| ${SED-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"` | ${SED:-sed} -e "s:^PREFIX=::" -e "s:__USER_LABEL_PREFIX__::"`
AC_SUBST(SYMBOL_PREFIX) AC_SUBST(SYMBOL_PREFIX)
AC_MSG_RESULT($SYMBOL_PREFIX) AC_MSG_RESULT($SYMBOL_PREFIX)
fi fi
@ -233,18 +274,470 @@ AC_ARG_WITH(libpng-prefix,
fi]) fi])
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"]) AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
# Because GCC by default assembles code with an executable stack, even though it # Control over what links are made for installed files. Versioned files are
# compiles C code with a non-executable stack, it is necessary to do a fixup # always installed, when the following options are turned on corresponding
# here (this may by GCC specific) # unversioned links are also created (normally as symbolic links):
AC_SUBST([AM_CCASFLAGS], [-Wa,--noexecstack]) AC_ARG_ENABLE([unversioned-links],
AS_HELP_STRING([[[--enable-unversioned-links]]],
[Installed libpng header files are placed in a versioned subdirectory]
[and installed libpng library (including DLL) files are versioned.]
[If this option is enabled unversioned links will be created pointing to]
[the corresponding installed files. If you use libpng.pc or]
[libpng-config for all builds you do not need these links, but if you]
[compile programs directly they will typically #include <png.h> and]
[link with -lpng; in that case you need the links.]
[The links can be installed manually using 'make install-header-links']
[and 'make install-library-links' and can be removed using the]
[corresponding uninstall- targets. If you do enable this option every]
[libpng 'make install' will recreate the links to point to the just]
[installed version of libpng. The default is to create the links;]
[use --disable-unversioned-links to change this]))
# The AM_CONDITIONAL test is written so that the default is enabled;
# --disable-unversioned-links must be given to turn the option off.
AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
AC_ARG_ENABLE([unversioned-libpng-pc],
AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
[Install the configuration file 'libpng.pc' as a link to the versioned]
[version. This is done by default - use --disable-unversioned-libpng-pc]
[to change this.]))
AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
[test "$enable_unversioned_libpng_pc" != "no"])
AC_ARG_ENABLE([unversioned-libpng-config],
AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
[Install the configuration file 'libpng-config' as a link to the]
[versioned version. This is done by default - use]
[--disable-unversioned-libpng-config to change this.]))
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
[test "$enable_unversioned_libpng_config" != "no"])
# HOST-SPECIFIC OPTIONS
# =====================
#
# DEFAULT
# =======
#
AC_ARG_ENABLE([hardware-optimizations],
AS_HELP_STRING([[[--enable-hardware-optimizations]]],
[Enable hardware optimizations: =no/off, yes/on.]),
[case "$enableval" in
no|off)
# disable hardware optimization on all systems:
enable_arm_neon=no
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
[Disable ARM_NEON optimizations])
enable_mips_msa=no
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
[Disable MIPS_MSA optimizations])
enable_mips_mmi=no
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
[Disable MIPS_MMI optimizations])
enable_powerpc_vsx=no
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
[Disable POWERPC VSX optimizations])
enable_intel_sse=no
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
[Disable INTEL_SSE optimizations])
enable_loongarch_lsx=no
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
[Disable LOONGARCH_LSX optimizations])
enable_riscv_rvv=no
AC_DEFINE([PNG_RISCV_RVV_OPT], [0],
[Disable RISC-V Vector optimizations])
;;
*)
# allow enabling hardware optimization on any system:
case "$host_cpu" in
arm*|aarch64*)
enable_arm_neon=yes
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM_NEON optimizations])
;;
mipsel*|mips64el*)
enable_mips_mmi=yes
enable_mips_msa=yes
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
[Enable MIPS_MMI optimizations])
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
[Enable MIPS_MSA optimizations])
;;
i?86|x86_64)
enable_intel_sse=yes
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
[Enable Intel SSE optimizations])
;;
powerpc*|ppc64*)
enable_powerpc_vsx=yes
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
[Enable POWERPC VSX optimizations])
;;
loongarch*)
enable_loongarch_lsx=yes
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
[Enable LOONGARCH_LSX optimizations])
;;
riscv64)
enable_riscv_rvv=yes
AC_DEFINE([PNG_RISCV_RVV_OPT], [2],
[Enable RISC-V Vector optimizations])
;;
esac
;;
esac])
# ARM NEON
# ========
AC_ARG_ENABLE([arm-neon], AC_ARG_ENABLE([arm-neon],
AS_HELP_STRING([[[--enable-arm-neon]]], [Enable ARM NEON optimizations]), AS_HELP_STRING([[[--enable-arm-neon]]],
[if test "${enableval}" = "yes"; then [Enable ARM NEON optimizations: =no/off, check, api, yes/on.]
AC_DEFINE([PNG_ARM_NEON], [1], [Enable ARM NEON optimizations]) [no/off: disable the optimizations;]
AC_DEFINE([PNG_ALIGNED_MEMORY_SUPPORTED], [1], [Align row buffers]) [check: use internal checking code (deprecated and poorly supported);]
fi]) [api: disable by default, enable by a call to png_set_option;]
AM_CONDITIONAL([PNG_ARM_NEON], [test "${enable_arm_neon:-no}" = yes]) [yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __ARM_NEON__ systems:
AC_DEFINE([PNG_ARM_NEON_OPT], [0],
[Disable ARM Neon optimizations])
# Prevent inclusion of the assembler files below:
enable_arm_neon=no ;;
check)
AC_DEFINE([PNG_ARM_NEON_CHECK_SUPPORTED], [],
[Check for ARM Neon support at run-time]);;
api)
AC_DEFINE([PNG_ARM_NEON_API_SUPPORTED], [],
[Turn on ARM Neon optimizations at run-time]);;
yes|on)
AC_DEFINE([PNG_ARM_NEON_OPT], [2],
[Enable ARM Neon optimizations])
AC_MSG_WARN([--enable-arm-neon: please specify 'check' or 'api';]
[if you want the optimizations unconditionally,]
[pass '-mfpu=neon' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-arm-neon=${enable_arm_neon}:]
[invalid argument])
esac])
# Add ARM-specific files to all builds where $host_cpu is arm ('arm*') or
# where ARM optimizations were explicitly requested. (This allows a fallback
# if a future host CPU does not match 'arm*'.)
AM_CONDITIONAL([PNG_ARM_NEON],
[test "$enable_arm_neon" != 'no' &&
case "$host_cpu" in
arm*|aarch64*) : ;;
*) test "$enable_arm_neon" != '' ;;
esac])
# MIPS MSA
# ========
AC_ARG_ENABLE([mips-msa],
AS_HELP_STRING([[[--enable-mips-msa]]],
[Enable MIPS MSA optimizations: =no/off, check, api, yes/on.]
[no/off: disable the optimizations;]
[check: use internal checking code (deprecated and poorly supported);]
[api: disable by default, enable by a call to png_set_option;]
[yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __mips_msa systems:
AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
[Disable MIPS MSA optimizations])
# Prevent inclusion of the assembler files below:
enable_mips_msa=no ;;
check)
AC_DEFINE([PNG_MIPS_MSA_CHECK_SUPPORTED], [],
[Check for MIPS MSA support at run-time]);;
api)
AC_DEFINE([PNG_MIPS_MSA_API_SUPPORTED], [],
[Turn on MIPS MSA optimizations at run-time]);;
yes|on)
AC_DEFINE([PNG_MIPS_MSA_OPT], [2],
[Enable MIPS MSA optimizations])
AC_MSG_WARN([--enable-mips-msa: please specify 'check' or 'api';]
[if you want the optimizations unconditionally,]
[pass '-mmsa -mfp64' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-mips-msa=${enable_mips_msa}:]
[invalid argument])
esac])
# Add MIPS-specific files to all builds where $host_cpu is mips ('mips*') or
# where MIPS optimizations were explicitly requested. (This allows a fallback
# if a future host CPU does not match 'mips*'.)
AM_CONDITIONAL([PNG_MIPS_MSA],
[test "$enable_mips_msa" != 'no' &&
case "$host_cpu" in
mipsel*|mips64el*) : ;;
esac])
# MIPS MMI
# ========
AC_ARG_ENABLE([mips-mmi],
AS_HELP_STRING([[[--enable-mips-mmi]]],
[Enable MIPS MMI optimizations: =no/off, check, api, yes/on.]
[no/off: disable the optimizations;]
[check: use internal checking code (deprecated and poorly supported);]
[api: disable by default, enable by a call to png_set_option;]
[yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __mips_mmi systems:
AC_DEFINE([PNG_MIPS_MMI_OPT], [0],
[Disable MIPS MMI optimizations])
# Prevent inclusion of the assembler files below:
enable_mips_mmi=no;;
check)
AC_DEFINE([PNG_MIPS_MMI_CHECK_SUPPORTED], [],
[Check for MIPS MMI support at run-time]);;
api)
AC_DEFINE([PNG_MIPS_MMI_API_SUPPORTED], [],
[Turn on MIPS MMI optimizations at run-time]);;
yes|on)
AC_DEFINE([PNG_MIPS_MMI_OPT], [1],
[Enable MIPS MMI optimizations])
AC_MSG_WARN([--enable-mips-mmi: please specify 'check' or 'api';]
[if you want the optimizations unconditionally]
[pass '-mloongson-mmi -march=loongson3a' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-mips-mmi=${enable_mips_mmi}:]
[invalid argument])
esac])
# Add MIPS specific files to all builds where the host_cpu is mips ('mips*') or
# where MIPS optimizations were explicitly requested. (This allows a fallback
# if a future host CPU does not match 'mips*'.)
AM_CONDITIONAL([PNG_MIPS_MMI],
[test "$enable_mips_mmi" != 'no' &&
case "$host_cpu" in
mipsel*|mips64el*) : ;;
esac])
# INTEL SSE
# =========
AC_ARG_ENABLE([intel-sse],
AS_HELP_STRING([[[--enable-intel-sse]]],
[Enable Intel SSE optimizations: =no/off, yes/on.]
[no/off: disable the optimizations;]
[yes/on: enable the optimizations.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling:
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
[Disable Intel SSE optimizations])
# Prevent inclusion of the assembler files below:
enable_intel_sse=no ;;
yes|on)
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
[Enable Intel SSE optimizations]);;
*)
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}:]
[invalid argument])
esac])
# Add Intel-specific files to all builds where $host_cpu is Intel ('x86*') or
# where Intel optimizations were explicitly requested. (This allows a fallback
# if a future host CPU does not match 'x86*'.)
AM_CONDITIONAL([PNG_INTEL_SSE],
[test "$enable_intel_sse" != 'no' &&
case "$host_cpu" in
i?86|x86_64) : ;;
*) test "$enable_intel_sse" != '' ;;
esac])
# POWERPC VSX
# ===========
AC_ARG_ENABLE([powerpc-vsx],
AS_HELP_STRING([[[--enable-powerpc-vsx]]],
[Enable POWERPC VSX optimizations: =no/off, check, api, yes/on.]
[no/off: disable the optimizations;]
[check: use internal checking code;]
[api: disable by default, enable by a call to png_set_option;]
[yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __ppc64__ systems:
AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
[Disable POWERPC VSX optimizations])
# Prevent inclusion of the platform-specific files below:
enable_powerpc_vsx=no ;;
check)
AC_DEFINE([PNG_POWERPC_VSX_CHECK_SUPPORTED], [],
[Check for POWERPC VSX support at run-time])
AC_MSG_WARN([--enable-powerpc-vsx: please see contrib/powerpc/README]
[for the list of supported systems.]);;
api)
AC_DEFINE([PNG_POWERPC_VSX_API_SUPPORTED], [],
[Turn on POWERPC VSX optimizations at run-time]);;
yes|on)
AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
[Enable POWERPC VSX optimizations])
AC_MSG_WARN([--enable-powerpc-vsx: please specify 'check' or 'api';]
[if you want the optimizations unconditionally,]
[pass '-maltivec -mvsx' or '-mcpu=power8' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-powerpc-vsx=${enable_powerpc_vsx}:]
[invalid argument])
esac])
# Add PowerPC-specific files to all builds where $host_cpu is powerpc
# ('powerpc*') or where PowerPC optimizations were explicitly requested.
# (This allows a fallback if a future host CPU does not match 'powerpc*'.)
AM_CONDITIONAL([PNG_POWERPC_VSX],
[test "$enable_powerpc_vsx" != 'no' &&
case "$host_cpu" in
powerpc*|ppc64*) : ;;
esac])
# LOONGARCH LSX
# =============
AC_ARG_ENABLE([loongarch-lsx],
AS_HELP_STRING([[[--enable-loongarch-lsx]]],
[Enable LOONGARCH LSX optimizations: =no/off, yes/on:]
[no/off: disable the optimizations;]
[yes/on: turn on unconditionally.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __loongarch_simd systems:
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [0],
[Disable LOONGARCH LSX optimizations])
# Prevent inclusion of the assembler files below:
enable_loongarch_lsx=no;;
yes|on)
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
[Enable LOONGARCH LSX optimizations])
;;
*)
AC_MSG_ERROR([--enable-loongarch-lsx=${enable_loongarch_lsx}:]
[invalid argument])
esac])
if test "$enable_loongarch_lsx" != "no" &&
case "$host_cpu" in
loongarch*) : ;;
*) test "$enable_loongarch_lsx" != '' ;;
esac
then
compiler_support_loongarch_lsx=no
AC_MSG_CHECKING(whether to use LoongArch LSX intrinsics)
save_CFLAGS="$CFLAGS"
LSX_CFLAGS="${LSX_CFLAGS:-"-mlsx"}"
CFLAGS="$CFLAGS $LSX_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <lsxintrin.h>
int main(){
__m128i a, b, c;
a = __lsx_vadd_w(b, c);
return 0;
}]])],compiler_support_loongarch_lsx=yes)
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($compiler_support_loongarch_lsx)
if test "$compiler_support_loongarch_lsx" = "yes"; then
AC_DEFINE([PNG_LOONGARCH_LSX_OPT], [1],
[Enable LOONGARCH LSX optimizations])
else
AC_MSG_WARN([Compiler does not support loongarch LSX.])
fi
fi
# Add LoongArch specific files to all builds where the host_cpu is loongarch
# ('loongarch*') or where LoongArch optimizations were explicitly requested.
# (This allows a fallback if a future host CPU does not match 'loongarch*'.)
AM_CONDITIONAL([PNG_LOONGARCH_LSX],
[test "$enable_loongarch_lsx" != "no" &&
test "$compiler_support_loongarch_lsx" = "yes" &&
case "$host_cpu" in
loongarch*) : ;;
*) test "$enable_loongarch_lsx" != '' ;;
esac])
# RISC-V
# ======
#
# RISC-V Vector support.
AC_ARG_ENABLE([riscv-rvv],
AS_HELP_STRING([[[--enable-riscv-rvv]]],
[Enable RISC-V Vector optimizations: =no/off, check, api, yes/on:]
[no/off: disable the optimizations; check: use internal checking code]
[api: disable by default, enable by a call to png_set_option]
[yes/on: turn on. If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling on __riscv systems:
AC_DEFINE([PNG_RISCV_RVV_OPT], [0],
[Disable RISC-V Vector optimizations])
# Prevent inclusion of the platform-specific files below:
enable_riscv_rvv=no ;;
yes|on)
AC_DEFINE([PNG_RISCV_RVV_OPT], [2],
[Enable RISC-V Vector optimizations])
AC_MSG_WARN([--enable-riscv-rvv:]
[if you want the optimizations pass e.g. '-march=rv64gv1p0' to the compiler.]);;
*)
AC_MSG_ERROR([--enable-riscv-rvv=${enable_riscv_rvv}: invalid value])
esac])
if test "$enable_riscv_rvv" != "no" &&
case "$host_cpu" in
riscv64) : ;;
*) test "$enable_riscv_rvv" != '' ;;
esac
then
compiler_support_riscv_rvv=no
AC_MSG_CHECKING(whether to use RISC-V RVV intrinsics)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <riscv_vector.h>
#include <asm/hwcap.h>
#ifndef COMPAT_HWCAP_ISA_V /* added in linux-6.5 */
#error "COMPAT_HWCAP_ISA_V is not available"
#endif
int main() {
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
uint64_t ptr[2] = {0x0908060504020100, 0xFFFFFFFF0E0D0C0A};
vuint8m1_t a = __riscv_vreinterpret_v_u64m1_u8m1(__riscv_vle64_v_u64m1(ptr, 2));
vfloat32m1_t val = __riscv_vle32_v_f32m1((const float*)(src), 4);
return (int)__riscv_vfmv_f_s_f32m1_f32(val);
}]])],compiler_support_riscv_rvv=yes)
AC_MSG_RESULT($compiler_support_riscv_rvv)
if test "$compiler_support_riscv_rvv" = "yes"; then
AC_DEFINE([PNG_RISCV_RVV_OPT], [1],
[Enable RISCV RVV optimizations])
else
AC_MSG_WARN([Compiler does not support riscv rvv.])
fi
fi
# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64')
# or where RISC-V optimizations were explicitly requested (this allows a fallback
# if a future host CPU does not match 'riscv64')
AM_CONDITIONAL([PNG_RISCV_RVV],
[test "$enable_riscv_rvv" != "no" &&
test "$compiler_support_riscv_rvv" = "yes" &&
case "$host_cpu" in
riscv64) : ;;
*) test "$compiler_support_riscv_rvv" != '' ;;
esac])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]]) AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])

9
contrib/.editorconfig Normal file
View File

@ -0,0 +1,9 @@
# https://editorconfig.org
root = false
[*.[ch]]
indent_size = unset
indent_style = unset
max_doc_length = unset
max_line_length = unset

View File

@ -1,4 +1,7 @@
External contributions to libpng
--------------------------------
This "contrib" directory contains contributions which are not necessarily under This "contrib" directory contains contributions which are not necessarily under
the libpng license, although all are open source. They are not part of the libpng license, although all are open source. They are not part of
libpng proper and are not used for building the library. libpng proper and are not used for building the library, although some are used
for testing the library via "make check".

83
contrib/arm-neon/README Normal file
View File

@ -0,0 +1,83 @@
OPERATING SYSTEM SPECIFIC ARM NEON DETECTION
--------------------------------------------
Detection of the ability to execute ARM NEON on an ARM processor requires
operating system support. (The information is not available in user mode.)
HOW TO USE THIS
---------------
This directory contains C code fragments that can be included in arm/arm_init.c
by setting the macro PNG_ARM_NEON_FILE to the file name in "" or <> at build
time. This setting is not recorded in pnglibconf.h and can be changed simply by
rebuilding arm/arm_init.o with the required macro definition.
For any of this code to be used the ARM NEON code must be enabled and run time
checks must be supported. I.e.:
#if PNG_ARM_NEON_OPT > 0
#ifdef PNG_ARM_NEON_CHECK_SUPPORTED
This is done in a 'configure' build by passing configure the argument:
--enable-arm-neon=check
Apart from the basic Linux implementation in contrib/arm-neon/linux.c this code
is unsupported. That means that it is not even compiled on a regular basis and
may be broken in any given minor release.
FILE FORMAT
-----------
Each file documents its testing status as of the last time it was tested (which
may have been a long time ago):
STATUS: one of:
SUPPORTED: This indicates that the file is included in the regularly
performed test builds and bugs are fixed when discovered.
COMPILED: This indicates that the code did compile at least once. See the
more detailed description for the extent to which the result was
successful.
TESTED: This means the code was fully compiled into the libpng test programs
and these were run at least once.
BUG REPORTS: an email address to which to send reports of problems
The file is a fragment of C code. It should not define any 'extern' symbols;
everything should be static. It must define the function:
static int png_have_neon(png_structp png_ptr);
That function must return 1 if ARM NEON instructions are supported, 0 if not.
It must not execute png_error unless it detects a bug. A png_error will prevent
the reading of the PNG and in the future, writing too.
BUG REPORTS
-----------
If you mail a bug report for any file that is not SUPPORTED there may only be
limited response. Consider fixing it and sending a patch to fix the problem -
this is more likely to result in action.
CONTRIBUTIONS
-------------
You may send contributions of new implementations to
png-mng-implement@sourceforge.net. Please write code in strict C90 C where
possible. Obviously OS dependencies are to be expected. If you submit code you
must have the authors permission and it must have a license that is acceptable
to the current maintainer; in particular that license must permit modification
and redistribution.
Please try to make the contribution a single file and give the file a clear and
unambiguous name that identifies the target OS. If multiple files really are
required put them all in a sub-directory.
You must also be prepared to handle bug reports from users of the code, either
by joining the png-mng-implement mailing list or by providing an email for the
"BUG REPORTS" entry or both. Please make sure that the header of the file
contains the STATUS and BUG REPORTS fields as above.
Please list the OS requirements as precisely as possible. Ideally you should
also list the environment in which the code has been tested and certainly list
any environments where you suspect it might not work.

View File

@ -0,0 +1,39 @@
/* contrib/arm-neon/android-ndk.c
*
* Copyright (c) 2014 Glenn Randers-Pehrson
* Written by John Bowler, 2014.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* SEE contrib/arm-neon/README before reporting bugs
*
* STATUS: COMPILED, UNTESTED
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_neon implemented for the Android NDK, see:
*
* Documentation:
* http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
* https://code.google.com/p/android/issues/detail?id=49065
*
* NOTE: this requires that libpng is built against the Android NDK and linked
* with an implementation of the Android ARM 'cpu-features' library. The code
* has been compiled only, not linked: no version of the library has been found,
* only the header files exist in the NDK.
*/
#include <cpu-features.h>
static int
png_have_neon(png_structp png_ptr)
{
/* This is a whole lot easier than the linux code, however it is probably
* implemented as below, therefore it is better to cache the result (these
* function calls may be slow!)
*/
PNG_UNUSED(png_ptr)
return android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
}

View File

@ -0,0 +1,120 @@
/* contrib/arm-neon/linux-auxv.c
*
* Copyright (c) 2014 Glenn Randers-Pehrson
* Written by Mans Rullgard, 2011.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* SEE contrib/arm-neon/README before reporting bugs
*
* STATUS: COMPILED, TESTED
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_neon implemented for Linux versions which allow access to
* /proc/self/auxv. This is probably faster, cleaner and safer than the code to
* read /proc/cpuinfo in contrib/arm-neon/linux, however it is yet another piece
* of potentially untested code and has more complex dependencies than the code
* to read cpuinfo.
*
* This generic __linux__ implementation requires reading /proc/self/auxv and
* looking at each element for one that records NEON capabilities.
*/
#include <unistd.h> /* for POSIX 1003.1 */
#include <errno.h> /* for EINTR */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <elf.h>
#include <asm/hwcap.h>
/* A read call may be interrupted, in which case it returns -1 and sets errno to
* EINTR if nothing was done, otherwise (if something was done) a partial read
* may result.
*/
static size_t
safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
{
size_t ntotal = 0;
char *buffer = png_voidcast(char*, buffer_in);
while (nbytes > 0)
{
unsigned int nread;
int iread;
/* Passing nread > INT_MAX to read is implementation defined in POSIX
* 1003.1, therefore despite the unsigned argument portable code must
* limit the value to INT_MAX!
*/
if (nbytes > INT_MAX)
nread = INT_MAX;
else
nread = (unsigned int)/*SAFE*/nbytes;
iread = read(fd, buffer, nread);
if (iread == -1)
{
/* This is the devil in the details, a read can terminate early with 0
* bytes read because of EINTR, yet it still returns -1 otherwise end
* of file cannot be distinguished.
*/
if (errno != EINTR)
{
png_warning(png_ptr, "/proc read failed");
return 0; /* I.e., a permanent failure */
}
}
else if (iread < 0)
{
/* Not a valid 'read' result: */
png_warning(png_ptr, "OS /proc read bug");
return 0;
}
else if (iread > 0)
{
/* Continue reading until a permanent failure, or EOF */
buffer += iread;
nbytes -= (unsigned int)/*SAFE*/iread;
ntotal += (unsigned int)/*SAFE*/iread;
}
else
return ntotal;
}
return ntotal; /* nbytes == 0 */
}
static int
png_have_neon(png_structp png_ptr)
{
int fd = open("/proc/self/auxv", O_RDONLY);
Elf32_auxv_t aux;
/* Failsafe: failure to open means no NEON */
if (fd == -1)
{
png_warning(png_ptr, "/proc/self/auxv open failed");
return 0;
}
while (safe_read(png_ptr, fd, &aux, sizeof aux) == sizeof aux)
{
if (aux.a_type == AT_HWCAP && (aux.a_un.a_val & HWCAP_NEON) != 0)
{
close(fd);
return 1;
}
}
close(fd);
return 0;
}

161
contrib/arm-neon/linux.c Normal file
View File

@ -0,0 +1,161 @@
/* contrib/arm-neon/linux.c
*
* Copyright (c) 2014, 2017 Glenn Randers-Pehrson
* Written by John Bowler, 2014, 2017.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*
* SEE contrib/arm-neon/README before reporting bugs
*
* STATUS: SUPPORTED
* BUG REPORTS: png-mng-implement@sourceforge.net
*
* png_have_neon implemented for Linux by reading the widely available
* pseudo-file /proc/cpuinfo.
*
* This code is strict ANSI-C and is probably moderately portable; it does
* however use <stdio.h> and it assumes that /proc/cpuinfo is never localized.
*/
#include <stdio.h>
static int
png_have_neon(png_structp png_ptr)
{
FILE *f = fopen("/proc/cpuinfo", "rb");
if (f != NULL)
{
/* This is a simple state machine which reads the input byte-by-byte until
* it gets a match on the 'neon' feature or reaches the end of the stream.
*/
static const char ch_feature[] = { 70, 69, 65, 84, 85, 82, 69, 83 };
static const char ch_neon[] = { 78, 69, 79, 78 };
enum
{
StartLine, Feature, Colon, StartTag, Neon, HaveNeon, SkipTag, SkipLine
} state;
int counter;
for (state=StartLine, counter=0;;)
{
int ch = fgetc(f);
if (ch == EOF)
{
/* EOF means error or end-of-file, return false; neon at EOF is
* assumed to be a mistake.
*/
fclose(f);
return 0;
}
switch (state)
{
case StartLine:
/* Match spaces at the start of line */
if (ch <= 32) /* skip control characters and space */
break;
counter=0;
state = Feature;
/* FALLTHROUGH */
case Feature:
/* Match 'FEATURE', ASCII case insensitive. */
if ((ch & ~0x20) == ch_feature[counter])
{
if (++counter == (sizeof ch_feature))
state = Colon;
break;
}
/* did not match 'feature' */
state = SkipLine;
/* FALLTHROUGH */
case SkipLine:
skipLine:
/* Skip everything until we see linefeed or carriage return */
if (ch != 10 && ch != 13)
break;
state = StartLine;
break;
case Colon:
/* Match any number of space or tab followed by ':' */
if (ch == 32 || ch == 9)
break;
if (ch == 58) /* i.e. ':' */
{
state = StartTag;
break;
}
/* Either a bad line format or a 'feature' prefix followed by
* other characters.
*/
state = SkipLine;
goto skipLine;
case StartTag:
/* Skip space characters before a tag */
if (ch == 32 || ch == 9)
break;
state = Neon;
counter = 0;
/* FALLTHROUGH */
case Neon:
/* Look for 'neon' tag */
if ((ch & ~0x20) == ch_neon[counter])
{
if (++counter == (sizeof ch_neon))
state = HaveNeon;
break;
}
state = SkipTag;
/* FALLTHROUGH */
case SkipTag:
/* Skip non-space characters */
if (ch == 10 || ch == 13)
state = StartLine;
else if (ch == 32 || ch == 9)
state = StartTag;
break;
case HaveNeon:
/* Have seen a 'neon' prefix, but there must be a space or new
* line character to terminate it.
*/
if (ch == 10 || ch == 13 || ch == 32 || ch == 9)
{
fclose(f);
return 1;
}
state = SkipTag;
break;
default:
png_error(png_ptr, "png_have_neon: internal error (bug)");
}
}
}
#ifdef PNG_WARNINGS_SUPPORTED
else
png_warning(png_ptr, "/proc/cpuinfo open failed");
#endif
return 0;
}

49
contrib/conftest/README Normal file
View File

@ -0,0 +1,49 @@
This directory contains test configuration files, currently always '.dfa' files
intended to be used in the build by setting the make macro DFA_XTRA to the name
of the file.
These files are used in release validation of the 'configure' builds of libpng
by building 'make check', or 'make all-am' for cross-builds, with each .dfa
file.
The files in this directory may change between minor releases, however
contributions describing specific builds of libpng are welcomed. There is no
guarantee that libpng will continue to build with such configurations; support
for given configurations can be, and has been, dropped between successive minor
releases. However if a .dfa file describing a configuration is not in this
directory it is very unlikely that it will be tested before a minor release!
You can use these .dfa files as the basis of new configurations. Files in this
directory should not have any use restrictions or restrictive licenses.
This directory is not included in the .zip and .7z distributions, which do
not contain 'configure' scripts.
DOCUMENTATION
=============
Examples:
${srcdir}/pngusr.dfa
${srcdir}/contrib/pngminim/*/pngusr.dfa
Documentation of the options:
${srcdir}/scripts/pnglibconf.dfa
Documentation of the file format:
${srcdir}/scripts/options.awk
FILE NAMING
===========
File names in this directory may NOT contain any of the five characters:
- , + * ?
Neither may they contain any space character.
While other characters may be used it is strongly suggested that file names be
limited to lower case Latiin alphabetic characters (a-z), digits (0-9) and, if
necessary the underscore (_) character. File names should be about 8 characters
long (excluding the .dfa extension). Submitted .dfa files should have names
between 7 and 16 characters long, shorter names (6 characters or less) are
reserved for standard tests.

133
contrib/conftest/basic.dfa Normal file
View File

@ -0,0 +1,133 @@
# basic.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2024
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with basic read and write support. This enables the lowest
# level libpng read and write APIs - the "row-by-row" ones.
#
# Support is enabled only for those transformations that are observed to be
# required by widely used apps or are in the v3 specification.
#
everything = off
# The sequential read code is enabled here; the progressive code can be used
# instead but there is no point enabling both.
option READ on
option SEQUENTIAL_READ on
option EASY_ACCESS on
option SET_USER_LIMITS on
option INFO_IMAGE on
option READ_16BIT on
# Errors: these can be disabled but then there won't be any error messages
# just failures and the error messages are really needed for apps:
option WARNINGS on
option ERROR_TEXT on
option BENIGN_READ_ERRORS on
# Required for many display programs such as web browsers:
option PROGRESSIVE_READ on
# Switch on the write code - this makes a minimalist encoder but with
# interlace support turned on; otherwise png_read_png..png_write_png will
# fail on an interlaced image.
option WRITE on
option WRITE_INTERLACING on
option WRITE_16BIT on
# Usages of the 'fixed' APIs are relatively rare but they do occur
# one or the other for both the API and the internal math.
#Fixed point:
option FIXED_POINT on
#Floating point:
option FLOATING_POINT on
option FLOATING_ARITHMETIC on
# Basic error handling, IO and user memory support. The latter allows the
# application program to provide its own implementations of 'malloc' and 'free'.
option SETJMP on
option STDIO on
option USER_MEM on
# Gamma handling: this needs to be on for the gamma handling
option READ_GAMMA on
# The supported chunks
chunk bKGD on
chunk cHRM on
chunk eXIf on
chunk gAMA on
chunk iCCP on
chunk iTXt on
chunk pHYs on
chunk sBIT on
chunk sRGB on
chunk tEXt on
chunk tIME on
chunk tRNS on
chunk zTXt on
# These don't seem to be used anywhere:
# chunk pCAL
# chunk sCAL
# chunk sPLT
# The rest of this is app dependent: none of these options are required for
# read/write of the full range of PNG files and the normal chunk handling on
# read.
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
option WRITE_CUSTOMIZE_COMPRESSION on
option READ_EXPAND on
option READ_FILLER on
option READ_GRAY_TO_RGB on
option READ_INVERT on
option READ_PACK on
option READ_RGB_TO_GRAY on
option READ_SCALE_16_TO_8 on
option READ_SHIFT on
option READ_STRIP_16_TO_8 on
option READ_STRIP_ALPHA on
option READ_SWAP on
option CONVERT_tIME on
# optipng
option IO_STATE on
option STORE_UNKNOWN_CHUNKS on
option HANDLE_AS_UNKNOWN on
# pngcrush
option READ_USER_TRANSFORM on
option WRITE_FLUSH on
# pnmtopng
chunk hIST on
# cairo
option WRITE_PACKSWAP on
option WRITE_USER_TRANSFORM on
# graphicsmagick
option READ_USER_CHUNKS on
# Qt5.15 qtgui (gentoo package split) Qt6.6 qtbase
option READ_BGR on
option WRITE_BGR on
option READ_SWAP_ALPHA on
option WRITE_SWAP_ALPHA on
chunk oFFs on
# ghostscript-gpl
option WRITE_INVERT_ALPHA on
option WRITE_INVERT on

View File

@ -0,0 +1,15 @@
# fixed.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Test the standard libpng configuration without floating point (the internal
# fixed point implementations are used instead).
#
option FLOATING_ARITHMETIC off
option FLOATING_POINT off

View File

@ -0,0 +1,14 @@
# fixed-float.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Test the standard libpng configuration with the fixed point internal
# implementation in place of the default floating point
#
option FLOATING_ARITHMETIC off

View File

@ -0,0 +1,21 @@
# nolimits.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
#
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng without any limits and without run-time settable limits. Turning
# USER_LIMITS off reduces libpng code size by allowing compile-time elimination
# of some checking code.
#
option USER_LIMITS off
@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
@# define PNG_USER_CHUNK_CACHE_MAX 0
@# define PNG_USER_CHUNK_MALLOC_MAX 0

View File

@ -0,0 +1,19 @@
# nolimits.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
#
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng without any limits. With these settigs run-time limits are still
# possible.
#
@# define PNG_USER_WIDTH_MAX PNG_UINT_31_MAX
@# define PNG_USER_HEIGHT_MAX PNG_UINT_31_MAX
@# define PNG_USER_CHUNK_CACHE_MAX 0
@# define PNG_USER_CHUNK_MALLOC_MAX 0

View File

@ -0,0 +1,57 @@
# pngcp.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2016
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with support for pngcp. This means just png_read_png,
# png_write_png and small number of configuration settings.
#
everything = off
# This option is specific to this configuration; it adds a #define to the
# generated pnglibconf.h which turns on the (not portable) timing option for
# pngcp. Note that any option is automatically preceded by PNG_; there is no
# way round this and this is deliberate.
option PNGCP_TIMING
# Because of the everything off above the option must also be turned on. This
# may not be done in one step because it is safer and avoids mis-spelled options
# in user .dfa files to error out if an unrecognized option is turned on.
option PNGCP_TIMING on
# Options to turn on png_read_png and png_write_png:
option INFO_IMAGE on
option SEQUENTIAL_READ on
option EASY_ACCESS on
option WRITE on
option WRITE_16BIT on
option WRITE_FILTER on
# pngcp needs this to preserve unknown chunks, switching all these on means that
# pngcp can work without explicit known chunk reading support
option UNKNOWN_CHUNKS on
option SET_UNKNOWN_CHUNKS on
option HANDLE_AS_UNKNOWN on
option SAVE_UNKNOWN_CHUNKS on
option WRITE_UNKNOWN_CHUNKS on
# pngcp needs this to handle palette files with invalid indices:
option CHECK_FOR_INVALID_INDEX on
option GET_PALETTE_MAX on
# Pre-libpng 1.7 pngcp has to stash text chunks manually, post 1.7 without this
# text chunks should be handled as unknown ok.
option TEXT on
# this is used to turn off limits:
option USER_LIMITS on
option SET_USER_LIMITS on
# these are just required for specific customizations
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION on
option WRITE_CUSTOMIZE_COMPRESSION on

View File

@ -0,0 +1,13 @@
# read-full.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with no write support and full read support.
#
option WRITE off

58
contrib/conftest/read.dfa Normal file
View File

@ -0,0 +1,58 @@
# read.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2013
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with basic read support. This enables the lowest level libpng
# read API - the one where the calling code has to use a loop to read each row.
# At present this is the API used by most programs.
#
# Support is enabled only for those chunks and transformations that are
# typically required - others can be added easily.
#
everything = off
# The sequential read code is enabled here; the progressive code can be used
# instead but there is no point enabling both.
option SEQUENTIAL_READ on
# Likewise it is pointless enabling both fixed and floating point APIs. Choose
# one or the other for both the API and the internal math.
#Fixed point:
#option FIXED_POINT on
#option FLOATING_ARITHMETIC off
#Floating point:
option FLOATING_POINT on
option FLOATING_ARITHMETIC on
# Basic error handling, IO and user memory support. The latter allows the
# application program to provide its own implementations of 'malloc' and 'free'.
option SETJMP on
option STDIO on
option USER_MEM on
# To read the full set of PNG images correctly interlace, transparency and
# 16-bit support is required. The application can implement interlace itself,
# but very few do and it's no longer possible to disable it when READ is
# enabled.
option READ_tRNS on
option READ_16BIT on
# Everything else is application dependent. This file assumes the app handles
# all the native PNG bit layouts, so it doesn't need any of layout change
# transforms, but needs libpng to perform gamma correction. It doesn't do any
# colorspace stuff and ignores the 'significant bit' information.
#
# If your app always expands the image to a limited set of bit layouts you
# probably want to consider using the simplified API instead of the low level
# one - see png.h and s_read.dfa.
option READ_GAMMA on

View File

@ -0,0 +1,35 @@
# s_read.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2013
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with simplified read support (only). This builds a minimal
# libpng able to read all PNG formats and convert them into a small number of
# well understood memory formats.
#
everything = off
option SIMPLIFIED_READ on
# It isn't necessary to chose fixed or floating point for the APIs because the
# simplified API doesn't need fixed or floating point numbers. It is necessary
# to chose an internal math implementation. The default (because of 'everything
# = off') is fixed point - turn the floating point implementation on if you have
# hardware floating point or prefer your software floating point implementation.
option FLOATING_ARITHMETIC on
# This is not strictly necessary, but without it the message strings in the API
# will not be filled in
option ERROR_TEXT on
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
# need this if you don't use them, they just allow the in-memory layout to be
# changed to match common hardware formats.
option SIMPLIFIED_READ_AFIRST on
option SIMPLIFIED_READ_BGR on

View File

@ -0,0 +1,33 @@
# s_write.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2013
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with (just) simplified write support
#
everything = off
option SIMPLIFIED_WRITE on
# It isn't necessary to chose fixed or floating point for the APIs because the
# simplified API doesn't need fixed or floating point numbers. It is necessary
# to chose an internal math implementation. The default (because of 'everything
# = off') is fixed point - turn the floating point implementation on if you have
# hardware floating point or prefer your software floating point implementation.
option FLOATING_ARITHMETIC on
# This is not strictly necessary, but without it the message strings in the API
# will not be filled in
option ERROR_TEXT on
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
# need this if you don't use them, they just allow the in-memory layout to be
# changed to match common hardware formats.
option SIMPLIFIED_WRITE_AFIRST on
option SIMPLIFIED_WRITE_BGR on

View File

@ -0,0 +1,36 @@
# simple.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2013
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with just the simplified APIs (read and write).
#
everything = off
option SIMPLIFIED_WRITE on
option SIMPLIFIED_READ on
# It isn't necessary to chose fixed or floating point for the APIs because the
# simplified API doesn't need fixed or floating point numbers. It is necessary
# to chose an internal math implementation. The default (because of 'everything
# = off') is fixed point - turn the floating point implementation on if you have
# hardware floating point or prefer your software floating point implementation.
option FLOATING_ARITHMETIC on
# This is not strictly necessary, but without it the message strings in the API
# will not be filled in
option ERROR_TEXT on
# Switching these options on enables the 'AFIRST' and 'BGR' formats - you don't
# need this if you don't use them, they just allow the in-memory layout to be
# changed to match common hardware formats.
option SIMPLIFIED_READ_AFIRST on
option SIMPLIFIED_READ_BGR on
option SIMPLIFIED_WRITE_AFIRST on
option SIMPLIFIED_WRITE_BGR on

View File

@ -0,0 +1,13 @@
# write-full.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2025
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with no read support and full write support.
#
option READ off

View File

@ -0,0 +1,45 @@
# write.dfa
# Build time configuration of libpng
#
# Author: John Bowler
# Copyright: (c) John Bowler, 2013
# Usage rights:
# To the extent possible under law, the author has waived all copyright and
# related or neighboring rights to this work. This work is published from:
# United States.
#
# Build libpng with no read support and minimal write support.
#
everything = off
# Switch on the write code - this makes a minimalist encoder
option WRITE on
# Choose fixed or floating point APIs and arithmetic. The choices are
# independent but normally they will match. It is typically better to use the
# floating point if you have floating point hardware. If you don't know, or
# (perhaps) to make libpng smaller used fixed point throughout.
#Fixed point:
#option FIXED_POINT on
#option FLOATING_ARITHMETIC off
#Floating point:
option FLOATING_POINT on
option FLOATING_ARITHMETIC on
# Basic error handling, IO and user memory support. The latter allows the
# application program to provide its own implementations of 'malloc' and 'free'.
option SETJMP on
option STDIO on
option USER_MEM on
# Everything else is optional. Unlike the read code in libpng the write code
# does not need to deal with arbitrary formats, so only add support for things
# you really do write! For example you might only write sRGB images, sometimes
# with transparency and never write 16 bit images, so:
option WRITE_sRGB on
option WRITE_tRNS on
#option WRITE_16BIT off (this is the default with 'everything = off')

Some files were not shown because too many files have changed in this diff Show More