mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
18 Commits
libpng-1.5
...
v1.5.27bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b78e99b1c9 | ||
|
|
14beb679d4 | ||
|
|
d92b1c6305 | ||
|
|
870fcc9b64 | ||
|
|
09779deaa9 | ||
|
|
55aea59737 | ||
|
|
1f2fe83987 | ||
|
|
1cef0c0eae | ||
|
|
73adedf0e4 | ||
|
|
7190c4f5af | ||
|
|
d189b54e30 | ||
|
|
c583ec1579 | ||
|
|
89a025317c | ||
|
|
7c32176ba0 | ||
|
|
684c68d6fb | ||
|
|
829cba63d3 | ||
|
|
b409572cec | ||
|
|
aff684567e |
61
ANNOUNCE
61
ANNOUNCE
@@ -1,34 +1,65 @@
|
||||
|
||||
Libpng 1.5.26 - December 17, 2015
|
||||
Libpng 1.5.27beta02 - May 11, 2016
|
||||
|
||||
This is a public release of libpng, intended for use in production codes.
|
||||
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:
|
||||
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
libpng-1.5.26.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.5.26.tar.gz
|
||||
1.5.27beta02.tar.xz (LZMA-compressed, recommended)
|
||||
1.5.27beta02.tar.gz
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lpng1526.7z (LZMA-compressed, recommended)
|
||||
lpng1526.zip
|
||||
lp1527b02.7z (LZMA-compressed, recommended)
|
||||
lp1527b02.zip
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.5.26-README.txt
|
||||
libpng-1.5.26-LICENSE.txt
|
||||
libpng-1.5.26-*.asc (armored detached GPG signatures)
|
||||
1.5.27beta02-README.txt
|
||||
1.5.27beta02-LICENSE.txt
|
||||
libpng-1.5.27beta02-*.asc (armored detached GPG signatures)
|
||||
|
||||
Changes since the last public release (1.5.25):
|
||||
Fixed an out-of-range read in png_check_keyword() (Bug report from
|
||||
Qixue Xiao, CVE-2015-8540).
|
||||
Corrected copyright dates in source files.
|
||||
Moved png_check_keyword() from pngwutil.c to pngset.c
|
||||
Added keyword checks to pngset.c (John Bowler).
|
||||
Changes since the last public release (1.5.26):
|
||||
|
||||
version 1.5.27beta01 [March 9, 2016]
|
||||
Removed LE/BE dependencies in pngvalid, to 'fix' the current problem
|
||||
in the BigEndian tests by not testing it, making the BE code the same
|
||||
as the LE version.
|
||||
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.
|
||||
Widened 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 changed the check to only operate in non-release builds
|
||||
(base build type not RC or RELEASE.)
|
||||
Fixed 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.
|
||||
In projects/vstudio, combined readme.txt and WARNING into README.txt
|
||||
Worked around a false-positive Coverity issue in pngvalid.c.
|
||||
Only use exit(77) from pngvalid.c in configure builds.
|
||||
Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
|
||||
and test.cmake.in (Roger Leigh).
|
||||
Added a common-law trademark notice and export control information
|
||||
to the LICENSE file, png.h, and the man page.
|
||||
Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
|
||||
(Robert C. Seacord).
|
||||
Fixed some misleading indentation in pngvalid.c (Krishnaraj Bhat).
|
||||
|
||||
version 1.5.27beta02 [May 11, 2016]
|
||||
Fixed typo (missing underscore) in #define PNG_READ_16_TO_8_SUPPORTED
|
||||
Bug report by (Y.Ohashik).
|
||||
Added PNG_FAST_FILTERS macro (defined as
|
||||
PNG_FILTER_NONE|PNG_FILTER_SUB|PNG_FILTER_UP).
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
||||
38
CHANGES
38
CHANGES
@@ -4256,7 +4256,8 @@ Version 1.5.19 [August 21, 2014]
|
||||
Version 1.5.20beta01 [November 6, 2014]
|
||||
Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa
|
||||
Only mark text chunks as written after successfully writing them.
|
||||
Avoid out-of-bounds memory access in png_user_version_check().
|
||||
Fixed an out-of-range read in png_user_version_check() (Bug report from
|
||||
Qixue Xiao, CVE-2015-8540).
|
||||
Simplified and future-proofed png_user_version_check().
|
||||
|
||||
Version 1.5.20beta02 [November 10, 2014]
|
||||
@@ -4454,6 +4455,41 @@ version 1.5.26rc01 [December 14, 2015]
|
||||
version 1.5.26 [December 17, 2015]
|
||||
No changes.
|
||||
|
||||
version 1.5.27beta01 [March 9, 2016]
|
||||
Removed LE/BE dependencies in pngvalid, to 'fix' the current problem
|
||||
in the BigEndian tests by not testing it, making the BE code the same
|
||||
as the LE version.
|
||||
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.
|
||||
Widened 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 changed the check to only operate in non-release builds
|
||||
(base build type not RC or RELEASE.)
|
||||
Fixed 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.
|
||||
In projects/vstudio, combined readme.txt and WARNING into README.txt
|
||||
Worked around a false-positive Coverity issue in pngvalid.c.
|
||||
Only use exit(77) from pngvalid.c in configure builds.
|
||||
Updated CMakeLists.txt, added supporting scripts/gen*.cmake.in
|
||||
and test.cmake.in (Roger Leigh).
|
||||
Added a common-law trademark notice and export control information
|
||||
to the LICENSE file, png.h, and the man page.
|
||||
Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
|
||||
(Robert C. Seacord).
|
||||
Fixed some misleading indentation in pngvalid.c (Krishnaraj Bhat).
|
||||
|
||||
version 1.5.27beta02 [May 11, 2016]
|
||||
Fixed typo (missing underscore) in #define PNG_READ_16_TO_8_SUPPORTED
|
||||
Bug report by (Y.Ohashik).
|
||||
Added PNG_FAST_FILTERS macro (defined as
|
||||
PNG_FILTER_NONE|PNG_FILTER_SUB|PNG_FILTER_UP).
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
||||
412
CMakeLists.txt
412
CMakeLists.txt
@@ -1,13 +1,32 @@
|
||||
# CMakeLists.txt
|
||||
|
||||
# Copyright (C) 2007-2015 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2007,2009-2016 Glenn Randers-Pehrson
|
||||
# Written by Christian Ehrlicher, 2007
|
||||
# Revised by Roger Lowman, 2009-2010
|
||||
# Revised by Clifford Yapp, 2011-2012
|
||||
# Revised by Roger Leigh, 2016
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
cmake_minimum_required(VERSION 2.4.4)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
cmake_policy(VERSION 2.8.3)
|
||||
|
||||
# Set MacOSX @rpath usage globally.
|
||||
if (POLICY CMP0020)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
endif(POLICY CMP0020)
|
||||
if (POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif(POLICY CMP0042)
|
||||
# Use new variable expansion policy.
|
||||
if (POLICY CMP0053)
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
endif(POLICY CMP0053)
|
||||
if (POLICY CMP0054)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
endif(POLICY CMP0054)
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")
|
||||
|
||||
@@ -16,7 +35,7 @@ enable_testing()
|
||||
|
||||
set(PNGLIB_MAJOR 1)
|
||||
set(PNGLIB_MINOR 5)
|
||||
set(PNGLIB_RELEASE 26)
|
||||
set(PNGLIB_RELEASE 27)
|
||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||
|
||||
@@ -47,32 +66,220 @@ option(PNG_FRAMEWORK "Build OS X framework" OFF)
|
||||
option(PNG_DEBUG "Build with debug output" OFF)
|
||||
option(PNGARG "Disable ANSI-C prototypes" OFF)
|
||||
|
||||
set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
|
||||
|
||||
# SET LIBNAME
|
||||
set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
|
||||
# to distinguish between debug and release lib
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
|
||||
# Use the prebuilt pnglibconf.h file from the scripts folder
|
||||
# TODO: fix this by building with awk; without this no cmake build can be
|
||||
# configured directly (to do so indirectly use your local awk to build a
|
||||
# pnglibconf.h in the build directory.)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
||||
include(CheckCSourceCompiles)
|
||||
option(ld-version-script "Enable linker version script" ON)
|
||||
if(ld-version-script AND NOT APPLE)
|
||||
# Check if LD supports linker scripts.
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
|
||||
global: sym;
|
||||
local: *;
|
||||
};
|
||||
|
||||
VERS_2 {
|
||||
global: sym2;
|
||||
main;
|
||||
} VERS_1;
|
||||
")
|
||||
set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
||||
check_c_source_compiles("void sym(void) {}
|
||||
void sym2(void) {}
|
||||
int main(void) {return 0;}
|
||||
" HAVE_LD_VERSION_SCRIPT)
|
||||
if(NOT HAVE_LD_VERSION_SCRIPT)
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE} "-Wl,-M -Wl,${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||
check_c_source_compiles("void sym(void) {}
|
||||
void sym2(void) {}
|
||||
int main(void) {return 0;}
|
||||
" HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
|
||||
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
|
||||
endif()
|
||||
|
||||
find_program(AWK NAMES gawk awk)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if(NOT AWK)
|
||||
# No awk available to generate sources; use pre-built pnglibconf.h
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
|
||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
|
||||
add_custom_target(genfiles) # Dummy
|
||||
else()
|
||||
include(CMakeParseArguments)
|
||||
# Generate .chk from .out with awk
|
||||
# generate_chk(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||
function(generate_chk)
|
||||
set(options)
|
||||
set(oneValueArgs INPUT OUTPUT)
|
||||
set(multiValueArgs DEPENDS)
|
||||
cmake_parse_arguments(_GC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if (NOT _GC_INPUT)
|
||||
message(FATAL_ERROR "Invalid arguments. generate_out requires input.")
|
||||
endif()
|
||||
if (NOT _GC_OUTPUT)
|
||||
message(FATAL_ERROR "Invalid arguments. generate_out requires output.")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT "${_GC_OUTPUT}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DINPUT=${_GC_INPUT}"
|
||||
"-DOUTPUT=${_GC_OUTPUT}"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake"
|
||||
DEPENDS "${_GC_INPUT}" ${_GC_DEPENDS}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endfunction()
|
||||
|
||||
# Generate .out from .c with awk
|
||||
# generate_out(INPUT inputfile OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||
function(generate_out)
|
||||
set(options)
|
||||
set(oneValueArgs INPUT OUTPUT)
|
||||
set(multiValueArgs DEPENDS)
|
||||
cmake_parse_arguments(_GO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if (NOT _GO_INPUT)
|
||||
message(FATAL_ERROR "Invalid arguments. generate_out requires input.")
|
||||
endif()
|
||||
if (NOT _GO_OUTPUT)
|
||||
message(FATAL_ERROR "Invalid arguments. generate_out requires output.")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT "${_GO_OUTPUT}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DINPUT=${_GO_INPUT}"
|
||||
"-DOUTPUT=${_GO_OUTPUT}"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake"
|
||||
DEPENDS "${_GO_INPUT}" ${_GO_DEPENDS}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endfunction()
|
||||
|
||||
# Generate specific source file with awk
|
||||
# generate_source(OUTPUT outputfile [DEPENDS dep1 [dep2...]])
|
||||
function(generate_source)
|
||||
set(options)
|
||||
set(oneValueArgs OUTPUT)
|
||||
set(multiValueArgs DEPENDS)
|
||||
cmake_parse_arguments(_GSO "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
if (NOT _GSO_OUTPUT)
|
||||
message(FATAL_ERROR "Invalid arguments. generate_source requires output.")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_GSO_OUTPUT}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DOUTPUT=${_GSO_OUTPUT}"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
|
||||
DEPENDS ${_GSO_DEPENDS}
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
endfunction()
|
||||
|
||||
# Copy file
|
||||
function(generate_copy source destination)
|
||||
add_custom_command(OUTPUT "${destination}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E remove "${destination}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${source}"
|
||||
"${destination}"
|
||||
DEPENDS "${source}")
|
||||
endfunction()
|
||||
|
||||
# Generate scripts/pnglibconf.h
|
||||
generate_source(OUTPUT "scripts/pnglibconf.c"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||
|
||||
# Generate pnglibconf.c
|
||||
generate_source(OUTPUT "pnglibconf.c"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.dfa"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/options.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out")
|
||||
|
||||
# Generate pnglibconf.h
|
||||
generate_source(OUTPUT "pnglibconf.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||
${PNGLIBCONF_H_EXTRA_DEPENDS})
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
||||
|
||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/vers.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||
|
||||
generate_chk(INPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/symbols.def")
|
||||
|
||||
add_custom_target(symbol-check DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk")
|
||||
|
||||
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||
generate_copy("${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||
|
||||
add_custom_target(genvers DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.vers")
|
||||
add_custom_target(gensym DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym")
|
||||
|
||||
add_custom_target("genprebuilt"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DOUTPUT=scripts/pnglibconf.h.prebuilt"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
# A single target handles generation of all generated files. If
|
||||
# they are dependend upon separately by multiple targets, this
|
||||
# confuses parallel make (it would require a separate top-level
|
||||
# target for each file to track the dependencies properly).
|
||||
add_custom_target(genfiles DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
||||
endif(NOT AWK)
|
||||
|
||||
# OUR SOURCES
|
||||
set(libpng_public_hdrs
|
||||
png.h
|
||||
pngconf.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||
)
|
||||
set(libpng_private_hdrs
|
||||
pngpriv.h
|
||||
pngdebug.h
|
||||
pnginfo.h
|
||||
pngstruct.h
|
||||
)
|
||||
set(libpng_sources
|
||||
${libpng_public_hdrs}
|
||||
pngdebug.h
|
||||
pnginfo.h
|
||||
pngpriv.h
|
||||
pngstruct.h
|
||||
${libpng_private_hdrs}
|
||||
png.c
|
||||
pngerror.c
|
||||
pngget.c
|
||||
@@ -95,7 +302,6 @@ set(pngtest_sources
|
||||
set(pngvalid_sources
|
||||
contrib/libtests/pngvalid.c
|
||||
)
|
||||
# SOME NEEDED DEFINITIONS
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
@@ -111,33 +317,59 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||
unset(PNG_LIB_TARGETS)
|
||||
|
||||
if(PNG_SHARED)
|
||||
add_library(${PNG_LIB_NAME} SHARED ${libpng_sources})
|
||||
set(PNG_LIB_TARGETS ${PNG_LIB_NAME})
|
||||
add_library(png SHARED ${libpng_sources})
|
||||
set(PNG_LIB_TARGETS png)
|
||||
set_target_properties(png PROPERTIES OUTPUT_NAME ${PNG_LIB_NAME})
|
||||
add_dependencies(png genfiles)
|
||||
if(MSVC)
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
|
||||
set_target_properties(png PROPERTIES PREFIX "lib")
|
||||
set_target_properties(png PROPERTIES IMPORT_PREFIX "lib")
|
||||
endif()
|
||||
target_link_libraries(png ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
|
||||
if(UNIX AND AWK)
|
||||
if(HAVE_LD_VERSION_SCRIPT)
|
||||
set_target_properties(png PROPERTIES LINK_FLAGS
|
||||
"-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
||||
set_target_properties(png PROPERTIES LINK_FLAGS
|
||||
"-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||
endif()
|
||||
endif()
|
||||
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(PNG_STATIC)
|
||||
# does not work without changing name
|
||||
set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static)
|
||||
add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources})
|
||||
list(APPEND PNG_LIB_TARGETS ${PNG_LIB_NAME_STATIC})
|
||||
set(PNG_LIB_NAME_STATIC png_static)
|
||||
add_library(png_static STATIC ${libpng_sources})
|
||||
add_dependencies(png_static genfiles)
|
||||
# MSVC doesn't use a different file extension for shared vs. static
|
||||
# libs. We are able to change OUTPUT_NAME to remove the _static
|
||||
# for all other platforms.
|
||||
if(NOT MSVC)
|
||||
set_target_properties(png_static PROPERTIES
|
||||
OUTPUT_NAME "${PNG_LIB_NAME}"
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
else()
|
||||
set_target_properties(png_static PROPERTIES
|
||||
OUTPUT_NAME "${PNG_LIB_NAME}_static"
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
list(APPEND PNG_LIB_TARGETS png_static)
|
||||
if(MSVC)
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
|
||||
set_target_properties(png_static PROPERTIES PREFIX "lib")
|
||||
endif()
|
||||
target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
target_link_libraries(png_static ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(PNG_FRAMEWORK)
|
||||
set(PNG_LIB_NAME_FRAMEWORK ${PNG_LIB_NAME}_framework)
|
||||
add_library(${PNG_LIB_NAME_FRAMEWORK} SHARED ${libpng_sources})
|
||||
list(APPEND PNG_LIB_TARGETS ${PNG_LIB_NAME_FRAMEWORK})
|
||||
set_target_properties(${PNG_LIB_NAME_FRAMEWORK} PROPERTIES
|
||||
set(PNG_LIB_NAME_FRAMEWORK png_framework)
|
||||
add_library(png_framework SHARED ${libpng_sources})
|
||||
add_dependencies(png_framework genfiles)
|
||||
list(APPEND PNG_LIB_TARGETS png_framework)
|
||||
set_target_properties(png_framework PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
FRAMEWORK_VERSION ${PNGLIB_VERSION}
|
||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PNGLIB_MAJOR}.${PNGLIB_MINOR}
|
||||
@@ -146,7 +378,7 @@ if(PNG_FRAMEWORK)
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
PUBLIC_HEADER "${libpng_public_hdrs}"
|
||||
OUTPUT_NAME png)
|
||||
target_link_libraries(${PNG_LIB_NAME_FRAMEWORK} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
target_link_libraries(png_framework ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(NOT PNG_LIB_TARGETS)
|
||||
@@ -157,18 +389,88 @@ if(NOT PNG_LIB_TARGETS)
|
||||
endif()
|
||||
|
||||
if(PNG_SHARED AND WIN32)
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||
set_target_properties(png PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||
endif()
|
||||
|
||||
function(png_add_test)
|
||||
set(options)
|
||||
set(oneValueArgs NAME COMMAND)
|
||||
set(multiValueArgs OPTIONS FILES)
|
||||
cmake_parse_arguments(_PAT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (NOT _PAT_NAME)
|
||||
message(FATAL_ERROR "Invalid arguments. png_add_test requires name.")
|
||||
endif()
|
||||
if (NOT _PAT_COMMAND)
|
||||
message(FATAL_ERROR "Invalid arguments. png_add_test requires command.")
|
||||
endif()
|
||||
|
||||
set(TEST_OPTIONS "${_PAT_OPTIONS}")
|
||||
set(TEST_FILES "${_PAT_FILES}")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/test.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake" @ONLY)
|
||||
if(CMAKE_MAJOR_VERSION GREATER 2) # have generator expressions
|
||||
add_test(NAME "${_PAT_NAME}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
"-DLIBPNG=$<TARGET_FILE:png>"
|
||||
"-DTEST_COMMAND=$<TARGET_FILE:${_PAT_COMMAND}>"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake")
|
||||
else() # old 2.x add_test; limited and won't work well on Windows
|
||||
# Note LIBPNG is a dummy value as there are no generator expressions
|
||||
add_test("${_PAT_NAME}" "${CMAKE_COMMAND}"
|
||||
"-DLIBPNG=${CMAKE_CURRENT_BINARY_DIR}/libpng.so"
|
||||
"-DTEST_COMMAND=./${_PAT_COMMAND}"
|
||||
-P "${CMAKE_CURRENT_BINARY_DIR}/tests/${_PAT_NAME}.cmake")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(PNG_TESTS AND PNG_SHARED)
|
||||
# does not work with msvc due to png_lib_ver issue
|
||||
# Find test PNG files by globbing, but sort lists to ensure
|
||||
# consistency between different filesystems.
|
||||
file(GLOB PNGSUITE_PNGS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/pngsuite/*.png")
|
||||
list(SORT PNGSUITE_PNGS)
|
||||
file(GLOB TEST_PNGS "${CMAKE_CURRENT_SOURCE_DIR}/contrib/testpngs/*.png")
|
||||
list(SORT TEST_PNGS)
|
||||
|
||||
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
|
||||
|
||||
add_executable(pngtest ${pngtest_sources})
|
||||
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
||||
add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
|
||||
#
|
||||
target_link_libraries(pngtest png)
|
||||
|
||||
png_add_test(NAME pngtest COMMAND pngtest FILES "${PNGTEST_PNG}")
|
||||
|
||||
add_executable(pngvalid ${pngvalid_sources})
|
||||
target_link_libraries(pngvalid ${PNG_LIB_NAME})
|
||||
add_test(pngvalid ./pngvalid)
|
||||
target_link_libraries(pngvalid png)
|
||||
|
||||
png_add_test(NAME pngvalid-gamma-16-to-8
|
||||
COMMAND pngvalid OPTIONS --gamma-16-to-8)
|
||||
png_add_test(NAME pngvalid-gamma-alpha-mode
|
||||
COMMAND pngvalid OPTIONS --gamma-alpha-mode)
|
||||
png_add_test(NAME pngvalid-gamma-background
|
||||
COMMAND pngvalid OPTIONS --gamma-background)
|
||||
png_add_test(NAME pngvalid-gamma-expand16-alpha-mode
|
||||
COMMAND pngvalid OPTIONS --gamma-alpha-mode --expand16)
|
||||
png_add_test(NAME pngvalid-gamma-expand16-background
|
||||
COMMAND pngvalid OPTIONS --gamma-background --expand16)
|
||||
png_add_test(NAME pngvalid-gamma-expand16-transform
|
||||
COMMAND pngvalid OPTIONS --gamma-transform --expand16)
|
||||
png_add_test(NAME pngvalid-gamma-sbit
|
||||
COMMAND pngvalid OPTIONS --gamma-sbit)
|
||||
png_add_test(NAME pngvalid-gamma-threshold
|
||||
COMMAND pngvalid OPTIONS --gamma-threshold)
|
||||
png_add_test(NAME pngvalid-gamma-transform
|
||||
COMMAND pngvalid OPTIONS --gamma-transform)
|
||||
png_add_test(NAME pngvalid-progressive-interlace-standard
|
||||
COMMAND pngvalid OPTIONS --standard --progressive-read --interlace)
|
||||
png_add_test(NAME pngvalid-progressive-size
|
||||
COMMAND pngvalid OPTIONS --size --progressive-read)
|
||||
png_add_test(NAME pngvalid-progressive-standard
|
||||
COMMAND pngvalid OPTIONS --standard --progressive-read)
|
||||
png_add_test(NAME pngvalid-standard
|
||||
COMMAND pngvalid OPTIONS --standard)
|
||||
png_add_test(NAME pngvalid-transform
|
||||
COMMAND pngvalid OPTIONS --transform)
|
||||
endif()
|
||||
|
||||
# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
|
||||
@@ -197,6 +499,15 @@ macro(CREATE_SYMLINK SRC_FILE DEST_FILE)
|
||||
endif(WIN32 AND NOT CYGWIN AND NOT MSYS)
|
||||
endmacro()
|
||||
|
||||
# Create source generation scripts.
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genchk.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genout.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/genout.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/gensrc.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/scripts/gensrc.cmake @ONLY)
|
||||
|
||||
|
||||
# libpng is a library so default to 'lib'
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR lib)
|
||||
@@ -223,22 +534,12 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
|
||||
# SET UP LINKS
|
||||
if(PNG_SHARED)
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 15.${PNGLIB_RELEASE}.1.5.26
|
||||
set_target_properties(png PROPERTIES
|
||||
# VERSION 15.${PNGLIB_RELEASE}.1.5.27beta02
|
||||
VERSION 15.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 15
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
if(PNG_STATIC)
|
||||
# MSVC doesn't use a different file extension for shared vs. static
|
||||
# libs. We are able to change OUTPUT_NAME to remove the _static
|
||||
# for all other platforms.
|
||||
if(NOT MSVC)
|
||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
||||
OUTPUT_NAME ${PNG_LIB_NAME}
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If CMake > 2.4.x, we set a variable used below to export
|
||||
# targets to an export file.
|
||||
@@ -261,14 +562,14 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
if(PNG_SHARED)
|
||||
# Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin
|
||||
if(CYGWIN OR MINGW)
|
||||
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
get_target_property(BUILD_TARGET_LOCATION png LOCATION_${CMAKE_BUILD_TYPE})
|
||||
CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif(CYGWIN OR MINGW)
|
||||
|
||||
if(NOT WIN32)
|
||||
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
get_target_property(BUILD_TARGET_LOCATION png LOCATION_${CMAKE_BUILD_TYPE})
|
||||
CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
@@ -277,7 +578,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
|
||||
if(PNG_STATIC)
|
||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE})
|
||||
get_target_property(BUILD_TARGET_LOCATION png_static LOCATION_${CMAKE_BUILD_TYPE})
|
||||
CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
@@ -297,6 +598,11 @@ if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
|
||||
endif(NOT WIN32 OR CYGWIN OR MINGW)
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_PROGRAMS AND NOT SKIP_INSTALL_ALL )
|
||||
install(TARGETS ${PNG_BIN_TARGETS}
|
||||
RUNTIME DESTINATION bin)
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
|
||||
# Install man pages
|
||||
if(NOT PNG_MAN_DIR)
|
||||
|
||||
27
LICENSE
27
LICENSE
@@ -10,8 +10,8 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.5.26, December 17, 2015, are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.5.27beta02, May 11, 2016, are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2016 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:
|
||||
@@ -94,18 +94,29 @@ appreciated.
|
||||
|
||||
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
||||
|
||||
A "png_get_copyright" function is available, for convenient use in "about"
|
||||
boxes and the like:
|
||||
TRADEMARK:
|
||||
|
||||
printf("%s", png_get_copyright(NULL));
|
||||
The name "libpng" has not been registered by the Copyright owner
|
||||
as a trademark in any jurisdiction. However, because libpng has
|
||||
been distributed and maintained world-wide, continually since 1995,
|
||||
the Copyright owner claims "common-law trademark protection" in any
|
||||
jurisdiction where common-law trademark is recognized.
|
||||
|
||||
Also, the PNG logo (in PNG format, of course) is supplied in the
|
||||
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
|
||||
OSI CERTIFICATION:
|
||||
|
||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
||||
a certification mark of the Open Source Initiative. OSI has not addressed
|
||||
the additional disclaimers inserted at version 1.0.7.
|
||||
|
||||
EXPORT CONTROL:
|
||||
|
||||
The Copyright owner believes that the Export Control Classification
|
||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
controls or International Traffic in Arms Regulations (ITAR) because
|
||||
it is open source, publicly available software, that does not contain
|
||||
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
734.7(b).
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
December 17, 2015
|
||||
May 11, 2016
|
||||
|
||||
2
README
2
README
@@ -1,4 +1,4 @@
|
||||
README for libpng version 1.5.26 - December 17, 2015 (shared library 15.0)
|
||||
README for libpng version 1.5.27beta02 - May 11, 2016 (shared library 15.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
24
configure
vendored
24
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for libpng 1.5.26.
|
||||
# Generated by GNU Autoconf 2.69 for libpng 1.5.27beta02.
|
||||
#
|
||||
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
|
||||
#
|
||||
@@ -590,8 +590,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='libpng'
|
||||
PACKAGE_TARNAME='libpng'
|
||||
PACKAGE_VERSION='1.5.26'
|
||||
PACKAGE_STRING='libpng 1.5.26'
|
||||
PACKAGE_VERSION='1.5.27beta02'
|
||||
PACKAGE_STRING='libpng 1.5.27beta02'
|
||||
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1354,7 +1354,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures libpng 1.5.26 to adapt to many kinds of systems.
|
||||
\`configure' configures libpng 1.5.27beta02 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1424,7 +1424,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of libpng 1.5.26:";;
|
||||
short | recursive ) echo "Configuration of libpng 1.5.27beta02:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1579,7 +1579,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
libpng configure 1.5.26
|
||||
libpng configure 1.5.27beta02
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2002,7 +2002,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by libpng $as_me 1.5.26, which was
|
||||
It was created by libpng $as_me 1.5.27beta02, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2865,7 +2865,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='libpng'
|
||||
VERSION='1.5.26'
|
||||
VERSION='1.5.27beta02'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -2982,10 +2982,10 @@ fi
|
||||
|
||||
|
||||
|
||||
PNGLIB_VERSION=1.5.26
|
||||
PNGLIB_VERSION=1.5.27beta02
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=5
|
||||
PNGLIB_RELEASE=26
|
||||
PNGLIB_RELEASE=27
|
||||
|
||||
|
||||
|
||||
@@ -14124,7 +14124,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by libpng $as_me 1.5.26, which was
|
||||
This file was extended by libpng $as_me 1.5.27beta02, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -14190,7 +14190,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
libpng config.status 1.5.26
|
||||
libpng config.status 1.5.27beta02
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.5.26], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.5.27beta02], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE([1.13 serial-tests subdir-objects])
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.5.26
|
||||
PNGLIB_VERSION=1.5.27beta02
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=5
|
||||
PNGLIB_RELEASE=26
|
||||
PNGLIB_RELEASE=27
|
||||
|
||||
dnl End of version number stuff
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngvalid.c - validate libpng by constructing then reading png files.
|
||||
*
|
||||
* Last changed in libpng 1.5.25 [December 17, 2015]
|
||||
* Copyright (c) 2014-2015 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.22 [(PENDING RELEASE)]
|
||||
* Copyright (c) 2014-2016 Glenn Randers-Pehrson
|
||||
* Written by John Cunningham Bowler
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
@@ -62,10 +62,10 @@
|
||||
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
|
||||
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
|
||||
*/
|
||||
#if PNG_LIBPNG_VER < 10601
|
||||
# define SKIP 0
|
||||
#else
|
||||
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
|
||||
# define SKIP 77
|
||||
#else
|
||||
# define SKIP 0
|
||||
#endif
|
||||
|
||||
/* pngvalid requires write support and one of the fixed or floating point APIs.
|
||||
@@ -116,6 +116,16 @@ typedef png_byte *png_const_bytep;
|
||||
# define png_const_structp png_structp
|
||||
#endif
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
/* RELEASE_BUILD is true for releases and release candidates: */
|
||||
# define RELEASE_BUILD (PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC)
|
||||
#endif
|
||||
#if RELEASE_BUILD
|
||||
# define debugonly(something)
|
||||
#else /* !RELEASE_BUILD */
|
||||
# define debugonly(something) something
|
||||
#endif /* !RELEASE_BUILD */
|
||||
|
||||
#include <float.h> /* For floating point constants */
|
||||
#include <stdlib.h> /* For malloc */
|
||||
#include <string.h> /* For memcpy, memset */
|
||||
@@ -276,7 +286,8 @@ make_four_random_bytes(png_uint_32* seed, png_bytep bytes)
|
||||
make_random_bytes(seed, bytes, 4);
|
||||
}
|
||||
|
||||
#if defined PNG_READ_SUPPORTED || defined PNG_WRITE_tRNS_SUPPORTED
|
||||
#if defined PNG_READ_SUPPORTED || defined PNG_WRITE_tRNS_SUPPORTED ||\
|
||||
defined PNG_WRITE_FILTER_SUPPORTED
|
||||
static void
|
||||
randomize(void *pv, size_t size)
|
||||
{
|
||||
@@ -284,19 +295,56 @@ randomize(void *pv, size_t size)
|
||||
make_random_bytes(random_seed, pv, size);
|
||||
}
|
||||
|
||||
#define RANDOMIZE(this) randomize(&(this), sizeof (this))
|
||||
#endif /* READ || WRITE_tRNS */
|
||||
#define R8(this) randomize(&(this), sizeof (this))
|
||||
|
||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||
static void r16(png_uint_16p p16, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i=0; i<count; ++i)
|
||||
{
|
||||
unsigned char b2[2];
|
||||
randomize(b2, sizeof b2);
|
||||
*p16++ = png_get_uint_16(b2);
|
||||
}
|
||||
}
|
||||
|
||||
#define R16(this) r16(&(this), (sizeof (this))/(sizeof (png_uint_16)))
|
||||
#define R16_1(this) r16(&(this), (size_t) 1U)
|
||||
|
||||
#if defined PNG_READ_RGB_TO_GRAY_SUPPORTED ||\
|
||||
defined PNG_READ_FILLER_SUPPORTED
|
||||
static void r32(png_uint_32p p32, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i=0; i<count; ++i)
|
||||
{
|
||||
unsigned char b4[4];
|
||||
randomize(b4, sizeof b4);
|
||||
*p32++ = png_get_uint_32(b4);
|
||||
}
|
||||
}
|
||||
|
||||
#define R32(this) r32(&(this), (sizeof (this))/(sizeof (png_uint_32)))
|
||||
#define R32_1(this) r32(&(this), (size_t) 1U)
|
||||
|
||||
#endif /* READ_FILLER || READ_RGB_TO_GRAY */
|
||||
|
||||
#endif /* READ || WRITE_tRNS || WRITE_FILTER */
|
||||
|
||||
#if defined PNG_READ_TRANSFORMS_SUPPORTED ||\
|
||||
defined PNG_WRITE_FILTER_SUPPORTED
|
||||
static unsigned int
|
||||
random_mod(unsigned int max)
|
||||
{
|
||||
unsigned int x;
|
||||
png_uint_16 x;
|
||||
|
||||
RANDOMIZE(x);
|
||||
R16_1(x);
|
||||
|
||||
return x % max; /* 0 .. max-1 */
|
||||
}
|
||||
#endif /* READ_TRANSFORMS || WRITE_FILTER */
|
||||
|
||||
#if (defined PNG_READ_RGB_TO_GRAY_SUPPORTED) ||\
|
||||
(defined PNG_READ_FILLER_SUPPORTED)
|
||||
@@ -305,12 +353,11 @@ random_choice(void)
|
||||
{
|
||||
unsigned char x;
|
||||
|
||||
RANDOMIZE(x);
|
||||
R8(x);
|
||||
|
||||
return x & 1;
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
#endif /* READ_RGB_TO_GRAY || READ_FILLER */
|
||||
|
||||
/* A numeric ID based on PNG file characteristics. The 'do_interlace' field
|
||||
* simply records whether pngvalid did the interlace itself or whether it
|
||||
@@ -1974,6 +2021,8 @@ typedef struct png_modifier
|
||||
* internal check on pngvalid to ensure that the calculated error limits are
|
||||
* not ridiculous; without this it is too easy to make a mistake in pngvalid
|
||||
* that allows any value through.
|
||||
*
|
||||
* NOTE: this is not checked in release builds.
|
||||
*/
|
||||
double limit; /* limit on error values, normally 4E-3 */
|
||||
|
||||
@@ -3258,10 +3307,10 @@ init_standard_palette(png_store *ps, png_structp pp, png_infop pi, int npalette,
|
||||
for (; i<256; ++i)
|
||||
tRNS[i] = 24;
|
||||
|
||||
# ifdef PNG_WRITE_tRNS_SUPPORTED
|
||||
if (j > 0)
|
||||
png_set_tRNS(pp, pi, tRNS, j, 0/*color*/);
|
||||
# endif
|
||||
#ifdef PNG_WRITE_tRNS_SUPPORTED
|
||||
if (j > 0)
|
||||
png_set_tRNS(pp, pi, tRNS, j, 0/*color*/);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3278,12 +3327,14 @@ set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
|
||||
png_color_16 tRNS;
|
||||
const png_uint_16 mask = (png_uint_16)((1U << bit_depth)-1);
|
||||
|
||||
RANDOMIZE(tRNS);
|
||||
R8(tRNS); /* makes unset fields random */
|
||||
|
||||
if (colour_type & 2/*RGB*/)
|
||||
{
|
||||
if (bit_depth == 8)
|
||||
{
|
||||
R16(tRNS.red);
|
||||
R16(tRNS.green);
|
||||
tRNS.blue = tRNS.red ^ tRNS.green;
|
||||
tRNS.red &= mask;
|
||||
tRNS.green &= mask;
|
||||
@@ -3292,13 +3343,17 @@ set_random_tRNS(png_structp pp, png_infop pi, const png_byte colour_type,
|
||||
|
||||
else /* bit_depth == 16 */
|
||||
{
|
||||
R16(tRNS.red);
|
||||
tRNS.green = (png_uint_16)(tRNS.red * 257);
|
||||
tRNS.blue = (png_uint_16)(tRNS.green * 17);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
R16(tRNS.gray);
|
||||
tRNS.gray &= mask;
|
||||
}
|
||||
|
||||
png_set_tRNS(pp, pi, NULL, 0, &tRNS);
|
||||
}
|
||||
@@ -3649,6 +3704,28 @@ deinterlace_row(png_bytep buffer, png_const_bytep row,
|
||||
* layout details. See make_size_images below for a way to make images
|
||||
* that test odd sizes along with the libpng interlace handling.
|
||||
*/
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
static void
|
||||
choose_random_filter(png_structp pp, int start)
|
||||
{
|
||||
/* Choose filters randomly except that on the very first row ensure that
|
||||
* there is at least one previous row filter.
|
||||
*/
|
||||
int filters = PNG_ALL_FILTERS & random_mod(256U);
|
||||
|
||||
/* There may be no filters; skip the setting. */
|
||||
if (filters != 0)
|
||||
{
|
||||
if (start && filters < PNG_FILTER_UP)
|
||||
filters |= PNG_FILTER_UP;
|
||||
|
||||
png_set_filter(pp, 0/*method*/, filters);
|
||||
}
|
||||
}
|
||||
#else /* !WRITE_FILTER */
|
||||
# define choose_random_filter(pp, start) ((void)0)
|
||||
#endif /* !WRITE_FILTER */
|
||||
|
||||
static void
|
||||
make_transform_image(png_store* const ps, png_byte const colour_type,
|
||||
png_byte const bit_depth, unsigned int palette_number,
|
||||
@@ -3767,6 +3844,7 @@ make_transform_image(png_store* const ps, png_byte const colour_type,
|
||||
}
|
||||
# endif /* do_own_interlace */
|
||||
|
||||
choose_random_filter(pp, pass == 0 && y == 0);
|
||||
png_write_row(pp, buffer);
|
||||
}
|
||||
}
|
||||
@@ -3943,9 +4021,6 @@ make_size_image(png_store* const ps, png_byte const colour_type,
|
||||
int npasses = npasses_from_interlace_type(pp, interlace_type);
|
||||
png_uint_32 y;
|
||||
int pass;
|
||||
# ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
int nfilter = PNG_FILTER_VALUE_LAST;
|
||||
# endif
|
||||
png_byte image[16][SIZE_ROWMAX];
|
||||
|
||||
/* To help consistent error detection make the parts of this buffer
|
||||
@@ -4008,15 +4083,19 @@ make_size_image(png_store* const ps, png_byte const colour_type,
|
||||
* does accept a filter number (per the spec) as well as a bit
|
||||
* mask.
|
||||
*
|
||||
* The apparent wackiness of decrementing nfilter rather than
|
||||
* incrementing is so that Paeth gets used in all images bigger
|
||||
* than 1 row - it's the tricky one.
|
||||
* The code now uses filters at random, except that on the first
|
||||
* row of an image it ensures that a previous row filter is in
|
||||
* the set so that libpng allocates the row buffer.
|
||||
*/
|
||||
png_set_filter(pp, 0/*method*/,
|
||||
nfilter >= PNG_FILTER_VALUE_LAST ? PNG_ALL_FILTERS : nfilter);
|
||||
{
|
||||
int filters = 8 << random_mod(PNG_FILTER_VALUE_LAST);
|
||||
|
||||
if (nfilter-- == 0)
|
||||
nfilter = PNG_FILTER_VALUE_LAST-1;
|
||||
if (pass == 0 && y == 0 &&
|
||||
(filters < PNG_FILTER_UP || w == 1U))
|
||||
filters |= PNG_FILTER_UP;
|
||||
|
||||
png_set_filter(pp, 0/*method*/, filters);
|
||||
}
|
||||
# endif
|
||||
|
||||
png_write_row(pp, row);
|
||||
@@ -4244,62 +4323,71 @@ make_error(png_store* const ps, png_byte const colour_type,
|
||||
#undef exception__env
|
||||
|
||||
/* And clear these flags */
|
||||
ps->expect_error = 0;
|
||||
ps->expect_warning = 0;
|
||||
|
||||
/* Now write the whole image, just to make sure that the detected, or
|
||||
* undetected, errro has not created problems inside libpng.
|
||||
*/
|
||||
if (png_get_rowbytes(pp, pi) !=
|
||||
transform_rowsize(pp, colour_type, bit_depth))
|
||||
png_error(pp, "row size incorrect");
|
||||
if (ps->expect_error)
|
||||
ps->expect_error = 0;
|
||||
|
||||
else
|
||||
{
|
||||
int npasses = set_write_interlace_handling(pp, interlace_type);
|
||||
int pass;
|
||||
/* Now write the whole image, just to make sure that the detected, or
|
||||
* undetected, errro has not created problems inside libpng. This
|
||||
* doesn't work if there was a png_error in png_write_info because that
|
||||
* can abort before PLTE was written.
|
||||
*/
|
||||
if (png_get_rowbytes(pp, pi) !=
|
||||
transform_rowsize(pp, colour_type, bit_depth))
|
||||
png_error(pp, "row size incorrect");
|
||||
|
||||
if (npasses != npasses_from_interlace_type(pp, interlace_type))
|
||||
png_error(pp, "write: png_set_interlace_handling failed");
|
||||
|
||||
for (pass=0; pass<npasses; ++pass)
|
||||
else
|
||||
{
|
||||
png_uint_32 y;
|
||||
int npasses = set_write_interlace_handling(pp, interlace_type);
|
||||
int pass;
|
||||
|
||||
for (y=0; y<h; ++y)
|
||||
if (npasses != npasses_from_interlace_type(pp, interlace_type))
|
||||
png_error(pp, "write: png_set_interlace_handling failed");
|
||||
|
||||
for (pass=0; pass<npasses; ++pass)
|
||||
{
|
||||
png_byte buffer[TRANSFORM_ROWMAX];
|
||||
png_uint_32 y;
|
||||
|
||||
transform_row(pp, buffer, colour_type, bit_depth, y);
|
||||
for (y=0; y<h; ++y)
|
||||
{
|
||||
png_byte buffer[TRANSFORM_ROWMAX];
|
||||
|
||||
# if do_own_interlace
|
||||
/* If do_own_interlace *and* the image is interlaced we need a
|
||||
* reduced interlace row; this may be reduced to empty.
|
||||
*/
|
||||
if (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
{
|
||||
/* The row must not be written if it doesn't exist, notice
|
||||
* that there are two conditions here, either the row isn't
|
||||
* ever in the pass or the row would be but isn't wide
|
||||
* enough to contribute any pixels. In fact the wPass test
|
||||
* can be used to skip the whole y loop in this case.
|
||||
transform_row(pp, buffer, colour_type, bit_depth, y);
|
||||
|
||||
# if do_own_interlace
|
||||
/* If do_own_interlace *and* the image is interlaced we
|
||||
* need a reduced interlace row; this may be reduced to
|
||||
* empty.
|
||||
*/
|
||||
if (PNG_ROW_IN_INTERLACE_PASS(y, pass) &&
|
||||
PNG_PASS_COLS(w, pass) > 0)
|
||||
interlace_row(buffer, buffer,
|
||||
bit_size(pp, colour_type, bit_depth), w, pass,
|
||||
0/*data always bigendian*/);
|
||||
else
|
||||
continue;
|
||||
}
|
||||
# endif /* do_own_interlace */
|
||||
if (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
{
|
||||
/* The row must not be written if it doesn't exist,
|
||||
* notice that there are two conditions here, either the
|
||||
* row isn't ever in the pass or the row would be but
|
||||
* isn't wide enough to contribute any pixels. In fact
|
||||
* the wPass test can be used to skip the whole y loop
|
||||
* in this case.
|
||||
*/
|
||||
if (PNG_ROW_IN_INTERLACE_PASS(y, pass) &&
|
||||
PNG_PASS_COLS(w, pass) > 0)
|
||||
interlace_row(buffer, buffer,
|
||||
bit_size(pp, colour_type, bit_depth), w, pass,
|
||||
0/*data always bigendian*/);
|
||||
else
|
||||
continue;
|
||||
}
|
||||
# endif /* do_own_interlace */
|
||||
|
||||
png_write_row(pp, buffer);
|
||||
png_write_row(pp, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* image writing */
|
||||
|
||||
png_write_end(pp, pi);
|
||||
png_write_end(pp, pi);
|
||||
}
|
||||
|
||||
/* The following deletes the file that was just written. */
|
||||
store_write_reset(ps);
|
||||
@@ -6257,7 +6345,7 @@ transform_range_check(png_const_structp pp, unsigned int r, unsigned int g,
|
||||
unsigned int max = (1U<<sample_depth)-1;
|
||||
double in_min = ceil((in-err)*max - digitization_error);
|
||||
double in_max = floor((in+err)*max + digitization_error);
|
||||
if (err > limit || !(out >= in_min && out <= in_max))
|
||||
if (debugonly(err > limit ||) !(out >= in_min && out <= in_max))
|
||||
{
|
||||
char message[256];
|
||||
size_t pos;
|
||||
@@ -6283,6 +6371,8 @@ transform_range_check(png_const_structp pp, unsigned int r, unsigned int g,
|
||||
|
||||
png_error(pp, message);
|
||||
}
|
||||
|
||||
UNUSED(limit)
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -7213,7 +7303,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
|
||||
png_uint_32 ru;
|
||||
double total;
|
||||
|
||||
RANDOMIZE(ru);
|
||||
R32_1(ru);
|
||||
data.green_coefficient = total = (ru & 0xffff) / 65535.;
|
||||
ru >>= 16;
|
||||
data.red_coefficient = (1 - total) * (ru & 0xffff) / 65535.;
|
||||
@@ -7274,14 +7364,12 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
|
||||
* When DIGITIZE is set because a pre-1.7 version of libpng is being
|
||||
* tested allow a bigger slack.
|
||||
*
|
||||
* NOTE: this magic number was determined by experiment to be about
|
||||
* 1.263. There's no great merit to the value below, however it only
|
||||
* affects the limit used for checking for internal calculation errors,
|
||||
* not the actual limit imposed by pngvalid on the output errors.
|
||||
* NOTE: this number only affects the internal limit check in pngvalid,
|
||||
* it has no effect on the limits applied to the libpng values.
|
||||
*/
|
||||
that->pm->limit += pow(
|
||||
# if DIGITIZE
|
||||
1.3
|
||||
2.0
|
||||
# else
|
||||
1.0
|
||||
# endif
|
||||
@@ -7443,7 +7531,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
/* Image now has RGB channels... */
|
||||
# if DIGITIZE
|
||||
{
|
||||
const png_modifier *pm = display->pm;
|
||||
png_modifier *pm = display->pm;
|
||||
const unsigned int sample_depth = that->sample_depth;
|
||||
const unsigned int calc_depth = (pm->assume_16_bit_calculations ? 16 :
|
||||
sample_depth);
|
||||
@@ -7592,9 +7680,11 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
else
|
||||
{
|
||||
err = fabs(grayhi-gray);
|
||||
|
||||
if (fabs(gray - graylo) > err)
|
||||
err = fabs(graylo-gray);
|
||||
|
||||
#if !RELEASE_BUILD
|
||||
/* Check that this worked: */
|
||||
if (err > pm->limit)
|
||||
{
|
||||
@@ -7605,11 +7695,13 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
pos = safecatd(buffer, sizeof buffer, pos, err, 6);
|
||||
pos = safecat(buffer, sizeof buffer, pos, " exceeds limit ");
|
||||
pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6);
|
||||
png_error(pp, buffer);
|
||||
png_warning(pp, buffer);
|
||||
pm->limit = err;
|
||||
}
|
||||
#endif /* !RELEASE_BUILD */
|
||||
}
|
||||
}
|
||||
# else /* DIGITIZE */
|
||||
# else /* !DIGITIZE */
|
||||
{
|
||||
double r = that->redf;
|
||||
double re = that->rede;
|
||||
@@ -7668,7 +7760,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
* lookups in the calculation and each introduces a quantization
|
||||
* error defined by the table size.
|
||||
*/
|
||||
const png_modifier *pm = display->pm;
|
||||
png_modifier *pm = display->pm;
|
||||
double in_qe = (that->sample_depth > 8 ? .5/65535 : .5/255);
|
||||
double out_qe = (that->sample_depth > 8 ? .5/65535 :
|
||||
(pm->assume_16_bit_calculations ? .5/(1<<display->max_gamma_8) :
|
||||
@@ -7718,6 +7810,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
else
|
||||
err -= in_qe;
|
||||
|
||||
#if !RELEASE_BUILD
|
||||
/* Validate that the error is within limits (this has caused
|
||||
* problems before, it's much easier to detect them here.)
|
||||
*/
|
||||
@@ -7730,8 +7823,10 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
|
||||
pos = safecatd(buffer, sizeof buffer, pos, err, 6);
|
||||
pos = safecat(buffer, sizeof buffer, pos, " exceeds limit ");
|
||||
pos = safecatd(buffer, sizeof buffer, pos, pm->limit, 6);
|
||||
png_error(pp, buffer);
|
||||
png_warning(pp, buffer);
|
||||
pm->limit = err;
|
||||
}
|
||||
#endif /* !RELEASE_BUILD */
|
||||
}
|
||||
}
|
||||
# endif /* !DIGITIZE */
|
||||
@@ -7802,7 +7897,7 @@ image_transform_png_set_background_set(const image_transform *this,
|
||||
* so we need to know what that is! The background colour is stored in the
|
||||
* transform_display.
|
||||
*/
|
||||
RANDOMIZE(random_bytes);
|
||||
R8(random_bytes);
|
||||
|
||||
/* Read the random value, for colour type 3 the background colour is actually
|
||||
* expressed as a 24bit rgb, not an index.
|
||||
@@ -7830,7 +7925,7 @@ image_transform_png_set_background_set(const image_transform *this,
|
||||
/* Extract the background colour from this image_pixel, but make sure the
|
||||
* unused fields of 'back' are garbage.
|
||||
*/
|
||||
RANDOMIZE(back);
|
||||
R8(back);
|
||||
|
||||
if (colour_type & PNG_COLOR_MASK_COLOR)
|
||||
{
|
||||
@@ -7842,11 +7937,11 @@ image_transform_png_set_background_set(const image_transform *this,
|
||||
else
|
||||
back.gray = (png_uint_16)data.red;
|
||||
|
||||
# ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
|
||||
# else
|
||||
png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
|
||||
# endif
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
png_set_background(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
|
||||
#else
|
||||
png_set_background_fixed(pp, &back, PNG_BACKGROUND_GAMMA_FILE, expand, 0);
|
||||
#endif
|
||||
|
||||
this->next->set(this->next, that, pp, pi);
|
||||
}
|
||||
@@ -8136,7 +8231,7 @@ image_transform_png_set_filler_set(const image_transform *this,
|
||||
* filler. The 'filler' value has all 32 bits set, but only bit_depth
|
||||
* will be used. At this point we don't know bit_depth.
|
||||
*/
|
||||
RANDOMIZE(data.filler);
|
||||
R32(data.filler);
|
||||
data.flags = random_choice();
|
||||
|
||||
png_set_filler(pp, data.filler, data.flags);
|
||||
@@ -8209,7 +8304,7 @@ image_transform_png_set_add_alpha_set(const image_transform *this,
|
||||
* filler. The 'filler' value has all 32 bits set, but only bit_depth
|
||||
* will be used. At this point we don't know bit_depth.
|
||||
*/
|
||||
RANDOMIZE(data.filler);
|
||||
R32(data.filler);
|
||||
data.flags = random_choice();
|
||||
|
||||
png_set_add_alpha(pp, data.filler, data.flags);
|
||||
@@ -11296,6 +11391,9 @@ int main(int argc, char **argv)
|
||||
|
||||
else if (strcmp(*argv, "-w") == 0 ||
|
||||
strcmp(*argv, "--strict") == 0)
|
||||
pm.this.treat_warnings_as_errors = 1; /* NOTE: this is the default! */
|
||||
|
||||
else if (strcmp(*argv, "--nostrict") == 0)
|
||||
pm.this.treat_warnings_as_errors = 0;
|
||||
|
||||
else if (strcmp(*argv, "--speed") == 0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.5.26 - December 17, 2015
|
||||
libpng version 1.5.27beta02 - May 11, 2016
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||
@@ -11,7 +11,7 @@ Libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.5.26 - December 17, 2015
|
||||
libpng versions 0.97, January 1998, through 1.5.27beta02 - May 11, 2016
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||
|
||||
@@ -4127,7 +4127,8 @@ There are no substantial API changes between the non-deprecated parts of
|
||||
the 1.4.5 API and the 1.5.0 API; however, the ability to directly access
|
||||
members of the main libpng control structures, png_struct and png_info,
|
||||
deprecated in earlier versions of libpng, has been completely removed from
|
||||
libpng 1.5.
|
||||
libpng 1.5, and new private "pngstruct.h", "pnginfo.h", and "pngdebug.h"
|
||||
header files were created.
|
||||
|
||||
We no longer include zlib.h in png.h. The include statement has been moved
|
||||
to pngstruct.h, where it is not accessible by applications. Applications that
|
||||
@@ -4515,7 +4516,7 @@ Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.5.26 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.27beta02 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
|
||||
52
libpng.3
52
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "December 17, 2015"
|
||||
.TH LIBPNG 3 "May 11, 2016"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.26
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.27beta02
|
||||
.SH SYNOPSIS
|
||||
\fB
|
||||
#include <png.h>\fP
|
||||
@@ -496,7 +496,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
Libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.5.26 - December 17, 2015
|
||||
libpng version 1.5.27beta02 - May 11, 2016
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||
@@ -507,7 +507,7 @@ Libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.5.26 - December 17, 2015
|
||||
libpng versions 0.97, January 1998, through 1.5.27beta02 - May 11, 2016
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||
|
||||
@@ -4623,7 +4623,8 @@ There are no substantial API changes between the non-deprecated parts of
|
||||
the 1.4.5 API and the 1.5.0 API; however, the ability to directly access
|
||||
members of the main libpng control structures, png_struct and png_info,
|
||||
deprecated in earlier versions of libpng, has been completely removed from
|
||||
libpng 1.5.
|
||||
libpng 1.5, and new private "pngstruct.h", "pnginfo.h", and "pngdebug.h"
|
||||
header files were created.
|
||||
|
||||
We no longer include zlib.h in png.h. The include statement has been moved
|
||||
to pngstruct.h, where it is not accessible by applications. Applications that
|
||||
@@ -5011,7 +5012,7 @@ Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.5.26 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.27beta02 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
@@ -5108,9 +5109,9 @@ the first widely used release:
|
||||
...
|
||||
1.0.19 10 10019 10.so.0.19[.0]
|
||||
...
|
||||
1.2.53 13 10253 12.so.0.53[.0]
|
||||
1.2.56 13 10256 12.so.0.56[.0]
|
||||
...
|
||||
1.5.25 15 10525 15.so.15.25[.0]
|
||||
1.5.27 15 10527 15.so.15.27[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -5166,7 +5167,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.5.26 - December 17, 2015:
|
||||
Libpng version 1.5.27beta02 - May 11, 2016:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@@ -5191,8 +5192,8 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.5.26, December 17, 2015, are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.5.27beta02, May 11, 2016, are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2016 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:
|
||||
@@ -5275,6 +5276,29 @@ appreciated.
|
||||
|
||||
END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
||||
|
||||
TRADEMARK:
|
||||
|
||||
The name "libpng" has not been registered by the Copyright owner
|
||||
as a trademark in any jurisdiction. However, because libpng has
|
||||
been distributed and maintained world-wide, continually since 1995,
|
||||
the Copyright owner claims "common-law trademark protection" in any
|
||||
jurisdiction where common-law trademark is recognized.
|
||||
|
||||
OSI CERTIFICATION:
|
||||
|
||||
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
||||
a certification mark of the Open Source Initiative. OSI has not addressed
|
||||
the additional disclaimers inserted at version 1.0.7.
|
||||
|
||||
EXPORT CONTROL:
|
||||
|
||||
The Copyright owner believes that the Export Control Classification
|
||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
controls or International Traffic in Arms Regulations (ITAR) because
|
||||
it is open source, publicly available software, that does not contain
|
||||
any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
734.7(b).
|
||||
|
||||
A "png_get_copyright" function is available, for convenient use in "about"
|
||||
boxes and the like:
|
||||
|
||||
@@ -5283,13 +5307,9 @@ boxes and the like:
|
||||
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. OSI has not addressed
|
||||
the additional disclaimers inserted at version 1.0.7.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
December 17, 2015
|
||||
May 11, 2016
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "December 17, 2015"
|
||||
.TH LIBPNGPF 3 "May 11, 2016"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.26
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.27beta02
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include \fI"pngpriv.h"
|
||||
|
||||
2
png.5
2
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "December 17, 2015"
|
||||
.TH PNG 5 "May 11, 2016"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
||||
10
png.c
10
png.c
@@ -14,7 +14,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_5_26 Your_png_h_is_not_version_1_5_26;
|
||||
typedef png_libpng_version_1_5_27beta02 Your_png_h_is_not_version_1_5_27beta02;
|
||||
|
||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
||||
* of the PNG file signature. If the PNG data is embedded into another
|
||||
@@ -655,15 +655,15 @@ png_get_copyright(png_const_structp png_ptr)
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.5.26 - December 17, 2015" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson" \
|
||||
"libpng version 1.5.27beta02 - May 11, 2016" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \
|
||||
PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||
PNG_STRING_NEWLINE;
|
||||
# else
|
||||
return "libpng version 1.5.26 - December 17, 2015\
|
||||
Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson\
|
||||
return "libpng version 1.5.27beta02 - May 11, 2016\
|
||||
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||
# endif
|
||||
|
||||
99
png.h
99
png.h
@@ -1,9 +1,9 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.5.26, December 17, 2015
|
||||
* libpng version 1.5.27beta02, May 11, 2016
|
||||
*
|
||||
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@@ -12,7 +12,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.5.26, December 17, 2015:
|
||||
* libpng versions 0.97, January 1998, through 1.5.27beta02, May 11, 2016:
|
||||
* Glenn Randers-Pehrson.
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
@@ -25,8 +25,8 @@
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.5.26, December 17, 2015, are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, are
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.5.27beta02, May 11, 2016, are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2016 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:
|
||||
@@ -108,6 +108,29 @@
|
||||
* appreciated.
|
||||
*
|
||||
* END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE.
|
||||
*
|
||||
* TRADEMARK:
|
||||
*
|
||||
* The name "libpng" has not been registered by the Copyright owner
|
||||
* as a trademark in any jurisdiction. However, because libpng has
|
||||
* been distributed and maintained world-wide, continually since 1995,
|
||||
* the Copyright owner claims "common-law trademark protection" in any
|
||||
* jurisdiction where common-law trademark is recognized.
|
||||
*
|
||||
* OSI CERTIFICATION:
|
||||
*
|
||||
* Libpng is OSI Certified Open Source Software. OSI Certified Open Source is
|
||||
* a certification mark of the Open Source Initiative. OSI has not addressed
|
||||
* the additional disclaimers inserted at version 1.0.7.
|
||||
*
|
||||
* EXPORT CONTROL:
|
||||
*
|
||||
* The Copyright owner believes that the Export Control Classification
|
||||
* Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||
* controls or International Traffic in Arms Regulations (ITAR) because
|
||||
* it is open source, publicly available software, that does not contain
|
||||
* any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
||||
* 734.7(b).
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -120,12 +143,6 @@
|
||||
* 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. OSI has not addressed
|
||||
* the additional disclaimers inserted at version 1.0.7.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The contributing authors would like to thank all those who helped
|
||||
* with testing, bug fixes, and patience. This wouldn't have been
|
||||
@@ -181,9 +198,9 @@
|
||||
* ...
|
||||
* 1.0.19 10 10019 10.so.0.19[.0]
|
||||
* ...
|
||||
* 1.2.53 13 10253 12.so.0.53[.0]
|
||||
* 1.2.56 13 10256 12.so.0.56[.0]
|
||||
* ...
|
||||
* 1.5.25 15 10525 15.so.15.25[.0]
|
||||
* 1.5.27 15 10527 15.so.15.27[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@@ -211,13 +228,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* December 17, 2015
|
||||
* May 11, 2016
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.5.26 are Y2K compliant. It is my belief that
|
||||
* upward through 1.5.27beta02 are Y2K compliant. It is my belief that
|
||||
* earlier versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
@@ -278,9 +295,9 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.5.26"
|
||||
#define PNG_LIBPNG_VER_STRING "1.5.27beta02"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.5.26 - December 17, 2015\n"
|
||||
" libpng version 1.5.27beta02 - May 11, 2016\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 15
|
||||
#define PNG_LIBPNG_VER_DLLNUM 15
|
||||
@@ -288,13 +305,13 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 5
|
||||
#define PNG_LIBPNG_VER_RELEASE 26
|
||||
#define PNG_LIBPNG_VER_RELEASE 27
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
#define PNG_LIBPNG_VER_BUILD 02
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
@@ -311,7 +328,7 @@
|
||||
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
||||
PNG_LIBPNG_BUILD_PRIVATE */
|
||||
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
|
||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
@@ -319,7 +336,7 @@
|
||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10526 /* 1.5.26 */
|
||||
#define PNG_LIBPNG_VER 10527 /* 1.5.27 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
@@ -441,7 +458,7 @@ extern "C" {
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_5_26;
|
||||
typedef char* png_libpng_version_1_5_27beta02;
|
||||
|
||||
/* Three color definitions. The order of the red, green, and blue, (and the
|
||||
* exact size) is not important, although the size of the fields need to
|
||||
@@ -705,22 +722,22 @@ typedef png_info FAR * FAR * png_infopp;
|
||||
* data in the info_struct to be written into the output file. The values
|
||||
* of the PNG_INFO_<chunk> defines should NOT be changed.
|
||||
*/
|
||||
#define PNG_INFO_gAMA 0x0001
|
||||
#define PNG_INFO_sBIT 0x0002
|
||||
#define PNG_INFO_cHRM 0x0004
|
||||
#define PNG_INFO_PLTE 0x0008
|
||||
#define PNG_INFO_tRNS 0x0010
|
||||
#define PNG_INFO_bKGD 0x0020
|
||||
#define PNG_INFO_hIST 0x0040
|
||||
#define PNG_INFO_pHYs 0x0080
|
||||
#define PNG_INFO_oFFs 0x0100
|
||||
#define PNG_INFO_tIME 0x0200
|
||||
#define PNG_INFO_pCAL 0x0400
|
||||
#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */
|
||||
#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_gAMA 0x0001U
|
||||
#define PNG_INFO_sBIT 0x0002U
|
||||
#define PNG_INFO_cHRM 0x0004U
|
||||
#define PNG_INFO_PLTE 0x0008U
|
||||
#define PNG_INFO_tRNS 0x0010U
|
||||
#define PNG_INFO_bKGD 0x0020U
|
||||
#define PNG_INFO_hIST 0x0040U
|
||||
#define PNG_INFO_pHYs 0x0080U
|
||||
#define PNG_INFO_oFFs 0x0100U
|
||||
#define PNG_INFO_tIME 0x0200U
|
||||
#define PNG_INFO_pCAL 0x0400U
|
||||
#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */
|
||||
#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
|
||||
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
|
||||
|
||||
/* This is used for the transformation routines, as some of them
|
||||
* change these values for the row. It also should enable using
|
||||
@@ -1365,7 +1382,7 @@ PNG_EXPORT(229, void, png_set_scale_16, (png_structp png_ptr));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
||||
#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */
|
||||
#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */
|
||||
/* Strip the second byte of information from a 16-bit depth file. */
|
||||
PNG_EXPORT(48, void, png_set_strip_16, (png_structp png_ptr));
|
||||
#endif
|
||||
@@ -1517,8 +1534,8 @@ PNG_EXPORT(67, void, png_set_filter,
|
||||
#define PNG_FILTER_UP 0x20
|
||||
#define PNG_FILTER_AVG 0x40
|
||||
#define PNG_FILTER_PAETH 0x80
|
||||
#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \
|
||||
PNG_FILTER_AVG | PNG_FILTER_PAETH)
|
||||
#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP)
|
||||
#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH)
|
||||
|
||||
/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.
|
||||
* These defines should NOT be changed.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.5.26, December 17, 2015
|
||||
* libpng version 1.5.27beta02, May 11, 2016
|
||||
*
|
||||
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* Last changed in libpng 1.5.26 [December 17, 2015]
|
||||
* Last changed in libpng 1.5.26 [(PENDING RELEASE)]
|
||||
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.5.25 [December 17, 2015]
|
||||
* Last changed in libpng 1.5.25 [December 3, 2015]
|
||||
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* Last changed in libpng 1.5.25 [December 17, 2015]
|
||||
* Last changed in libpng 1.5.25 [December 3, 2015]
|
||||
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@@ -2070,4 +2070,4 @@ main(void)
|
||||
#endif
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_5_26 Your_png_h_is_not_version_1_5_26;
|
||||
typedef png_libpng_version_1_5_27beta02 Your_png_h_is_not_version_1_5_27beta02;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
VisualStudio instructions
|
||||
|
||||
libpng version 1.5.26 - December 17, 2015
|
||||
libpng version 1.5.27beta02 - May 11, 2016
|
||||
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
Copyright (c) 2010,2013,2016 Glenn Randers-Pehrson
|
||||
|
||||
This code is released under the libpng license.
|
||||
For conditions of distribution and use, see the disclaimer
|
||||
@@ -13,14 +13,6 @@ This directory contains support for building libpng under MicroSoft
|
||||
VisualStudio 2010. It may also work under later versions of VisualStudio.
|
||||
You should be familiar with VisualStudio before using this directory.
|
||||
|
||||
WARNING
|
||||
=======
|
||||
Libpng 1.5 erroneously uses /MD when building debug DLL versions of libpng.
|
||||
It should use /MDd - you can change this under properties\C/C++\Code
|
||||
Generation\Runtime Library if you need to use the debug runtime for debug
|
||||
builds. This will be changed in libpng 1.6 but is currently retained for
|
||||
compatibility with older libpng 1.5 releases.
|
||||
|
||||
Initial preparations
|
||||
====================
|
||||
You must enter some information in zlib.props before attempting to build
|
||||
@@ -41,21 +33,22 @@ optimization level (e.g. /Od.)
|
||||
Linking your application
|
||||
========================
|
||||
Normally you should link against the 'release' configuration. This builds a
|
||||
DLL for libpng 1.5 with the default runtime options used by Visual Studio
|
||||
2010. In particular the runtime library is the "MultiThreaded DLL" version.
|
||||
DLL for libpng with the default runtime options used by Visual Studio 2010.
|
||||
In particular the runtime library is the "MultiThreaded DLL" version.
|
||||
If you use Visual Studio defaults to build your application you will have no
|
||||
problems.
|
||||
|
||||
If you don't use the Visual Studio defaults your application must still be built
|
||||
with the default runtime option (/MD). If, for some reason, it is not then your
|
||||
application will crash inside libpng15.dll as soon as libpng tries to read
|
||||
from a file handle you pass in.
|
||||
If you don't use the Visual Studio defaults your application must still be
|
||||
built with the default runtime option (/MD). If, for some reason, it is not
|
||||
then your application will crash inside libpng15.dll as soon as libpng
|
||||
tries to read from a file handle you pass in.
|
||||
|
||||
If you do not want to use the DLL, for example for a very small application,
|
||||
the 'release library' configuration may be more appropriate. This is built
|
||||
with a non-standard runtime library - the "MultiThreaded" version. When you
|
||||
build your application it must be compiled with this option (/MT), otherwise
|
||||
it will not build (if you are lucky) or crash (if you are not.)
|
||||
it will not build (if you are lucky) or crash (if you are not.) See the
|
||||
WARNING file that is distributed along with this readme.txt.
|
||||
|
||||
Stop reading here
|
||||
=================
|
||||
@@ -66,7 +59,29 @@ Debug versions have limited support
|
||||
This solution includes limited support for debug versions of libpng. You
|
||||
do not need these unless your own solution itself uses debug builds (it is
|
||||
far more effective to debug on the release builds, there is no point building
|
||||
a special debug build.)
|
||||
a special debug build unless you have heap corruption problems that you can't
|
||||
track down.)
|
||||
|
||||
The debug build of libpng is minimally supported. Support for debug builds of
|
||||
zlib is also minimal. You really don't want to do this.
|
||||
|
||||
WARNING
|
||||
=======
|
||||
|
||||
Libpng 1.5.x erroneously uses /MD for Debug DLL builds; if you used the
|
||||
debug builds in your app and you changed your app to use /MD you will need
|
||||
to change it back to /MDd for libpng 1.6.0 and later.
|
||||
|
||||
The runtime library settings for each build are as follows:
|
||||
|
||||
Release Debug
|
||||
DLL /MD /MDd
|
||||
Library /MT /MTd
|
||||
|
||||
The Visual Studio 2010 defaults for a Win32 DLL or Static Library project are
|
||||
as follows:
|
||||
|
||||
Release Debug
|
||||
DLL /MD /MDd
|
||||
Static Library /MD /MDd
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
WARNING
|
||||
=======
|
||||
Libpng 1.5 erroneously uses /MD when building debug DLL versions of libpng.
|
||||
It should use /MDd - you can change this under properties\C/C++\Code
|
||||
Generation\Runtime Library if you need to use the debug runtime for debug
|
||||
builds. This will be changed in libpng 1.6 but is currently retained for
|
||||
compatibility with older libpng 1.5 releases.
|
||||
|
||||
The runtime library settings for each build are as follows:
|
||||
|
||||
Release Debug
|
||||
DLL /MD /MD
|
||||
Library /MT /MTd
|
||||
|
||||
The Visual Studio 2010 defaults for a Win32 DLL or Static Library project are
|
||||
as follows:
|
||||
|
||||
Release Debug
|
||||
DLL /MD /MDd
|
||||
Static Library /MD /MDd
|
||||
|
||||
Notice that by default static library builds use the DLL runtime, not the
|
||||
static library runtime.
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* zlib.props - location of zlib source
|
||||
*
|
||||
* libpng version 1.5.26 - December 17, 2015
|
||||
* libpng version 1.5.27beta02 - May 11, 2016
|
||||
*
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
Makefiles for libpng version 1.5.26 - December 17, 2015
|
||||
Makefiles for libpng version 1.5.27beta02 - May 11, 2016
|
||||
|
||||
pnglibconf.h.prebuilt => Stores configuration settings
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng15.so.15.1.5.26)
|
||||
(gcc, creates libpng15.so.15.1.5.27beta02)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@@ -34,12 +34,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
|
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng15.so.15.1.5.26)
|
||||
creates libpng15.so.15.1.5.27beta02)
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng15.so.15.1.5.26)
|
||||
creates libpng15.so.15.1.5.27beta02)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng15.so.15.1.5.26)
|
||||
creates libpng15.so.15.1.5.27beta02)
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
|
||||
@@ -21,7 +21,7 @@ PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
|
||||
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
|
||||
PNG_DFN ""
|
||||
PNG_DFN "EXPORTS"
|
||||
PNG_DFN ";Version 1.5.26"
|
||||
PNG_DFN ";Version 1.5.27beta02"
|
||||
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"
|
||||
|
||||
37
scripts/genchk.cmake.in
Normal file
37
scripts/genchk.cmake.in
Normal file
@@ -0,0 +1,37 @@
|
||||
# genchk.cmake.in
|
||||
# Generate .chk from .out with awk (generic), based upon the automake logic.
|
||||
|
||||
# Copyright (C) 2016 Glenn Randers-Pehrson
|
||||
# Written by Roger Leigh, 2016
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# Variables substituted from CMakeLists.txt
|
||||
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
|
||||
set(AWK "@AWK@")
|
||||
|
||||
get_filename_component(INPUTEXT "${INPUT}" EXT)
|
||||
get_filename_component(OUTPUTEXT "${OUTPUT}" EXT)
|
||||
get_filename_component(INPUTBASE "${INPUT}" NAME_WE)
|
||||
get_filename_component(OUTPUTBASE "${OUTPUT}" NAME_WE)
|
||||
get_filename_component(INPUTDIR "${INPUT}" PATH)
|
||||
get_filename_component(OUTPUTDIR "${OUTPUT}" PATH)
|
||||
|
||||
if("${INPUTEXT}" STREQUAL ".out" AND "${OUTPUTEXT}" STREQUAL ".chk")
|
||||
# Generate .chk from .out with awk (generic)
|
||||
file(REMOVE "${OUTPUT}" "${OUTPUTDIR}/${OUTPUTBASE}.new")
|
||||
execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/checksym.awk"
|
||||
"${SRCDIR}/scripts/${INPUTBASE}.def"
|
||||
"of=${OUTPUTDIR}/${OUTPUTBASE}.new"
|
||||
"${INPUT}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate ${OUTPUTDIR}/${OUTPUTBASE}.new")
|
||||
endif()
|
||||
file(RENAME "${OUTPUTDIR}/${OUTPUTBASE}.new" "${OUTPUT}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported conversion: ${INPUTEXT} to ${OUTPUTEXT}")
|
||||
endif()
|
||||
77
scripts/genout.cmake.in
Normal file
77
scripts/genout.cmake.in
Normal file
@@ -0,0 +1,77 @@
|
||||
# genout.cmake.in
|
||||
# Generate .out from .c with awk (generic), based upon the automake logic.
|
||||
|
||||
# Copyright (C) 2016 Glenn Randers-Pehrson
|
||||
# Written by Roger Leigh, 2016
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# Variables substituted from CMakeLists.txt
|
||||
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
|
||||
|
||||
set(AWK "@AWK@")
|
||||
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
|
||||
set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@")
|
||||
set(INCDIR "@CMAKE_CURRENT_BINARY_DIR@")
|
||||
set(PNG_PREFIX "@PNG_PREFIX@")
|
||||
set(PNGLIB_MAJOR "@PNGLIB_MAJOR@")
|
||||
set(PNGLIB_MINOR "@PNGLIB_MINOR@")
|
||||
set(PNGLIB_VERSION "@PNGLIB_VERSION@")
|
||||
set(ZLIBINCDIR "@ZLIB_INCLUDE_DIR@")
|
||||
|
||||
get_filename_component(INPUTEXT "${INPUT}" EXT)
|
||||
get_filename_component(OUTPUTEXT "${OUTPUT}" EXT)
|
||||
get_filename_component(INPUTBASE "${INPUT}" NAME_WE)
|
||||
get_filename_component(OUTPUTBASE "${OUTPUT}" NAME_WE)
|
||||
get_filename_component(INPUTDIR "${INPUT}" PATH)
|
||||
get_filename_component(OUTPUTDIR "${OUTPUT}" PATH)
|
||||
|
||||
if ("${INPUTEXT}" STREQUAL ".c" AND "${OUTPUTEXT}" STREQUAL ".out")
|
||||
get_filename_component(GENDIR "${OUTPUT}" PATH)
|
||||
file(MAKE_DIRECTORY "${GENDIR}")
|
||||
|
||||
file(REMOVE "${OUTPUT}.tf1" "${OUTPUT}.tf2")
|
||||
|
||||
set(INCLUDES "-I${INCDIR}")
|
||||
if(ZLIBINCDIR)
|
||||
list(APPEND INCLUDES "-I${ZLIBINCDIR}")
|
||||
endif()
|
||||
|
||||
if(PNG_PREFIX)
|
||||
set(PNG_PREFIX_DEF "-DPNG_PREFIX=${PNG_PREFIX}")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${CMAKE_C_COMPILER}" "-E"
|
||||
${CMAKE_C_FLAGS}
|
||||
"-I${SRCDIR}"
|
||||
"-I${BINDIR}"
|
||||
"-DPNGLIB_LIBNAME=PNG${PNGLIB_MAJOR}${PNGLIB_MINOR}_0"
|
||||
"-DPNGLIB_VERSION=${PNGLIB_VERSION}"
|
||||
"-DSYMBOL_PREFIX=${SYMBOL_PREFIX}"
|
||||
"-DPNG_NO_USE_READ_MACROS"
|
||||
"-DPNG_BUILDING_SYMBOL_TABLE"
|
||||
${PNG_PREFIX_DEF}
|
||||
"${INPUT}"
|
||||
OUTPUT_FILE "${OUTPUT}.tf1"
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE CPP_FAIL)
|
||||
if(CPP_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate ${OUTPUT}.tf1")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/dfn.awk"
|
||||
"out=${OUTPUT}.tf2" "${OUTPUT}.tf1"
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate ${OUTPUT}.tf2")
|
||||
endif()
|
||||
|
||||
file(REMOVE "${OUTPUT}.tf1")
|
||||
file(RENAME "${OUTPUT}.tf2" "${OUTPUT}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported conversion: ${INPUTEXT} to ${OUTPUTEXT}")
|
||||
endif()
|
||||
98
scripts/gensrc.cmake.in
Normal file
98
scripts/gensrc.cmake.in
Normal file
@@ -0,0 +1,98 @@
|
||||
# gensrc.cmake.in
|
||||
# Generate source files with awk, based upon the automake logic.
|
||||
|
||||
# Copyright (C) 2016 Glenn Randers-Pehrson
|
||||
# Written by Roger Leigh, 2016
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# Variables substituted from CMakeLists.txt
|
||||
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
|
||||
|
||||
set(AWK "@AWK@")
|
||||
set(DFA_XTRA "@DFA_XTRA@")
|
||||
set(PNG_PREFIX "@PNG_PREFIX@")
|
||||
set(PNGLIB_VERSION "@PNGLIB_VERSION@")
|
||||
|
||||
if("${OUTPUT}" STREQUAL "scripts/pnglibconf.c")
|
||||
# Generate scripts/pnglibconf.c
|
||||
|
||||
file(REMOVE "${BINDIR}/pnglibconf.tf6" "${BINDIR}/pnglibconf.tf7")
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "com ${PNGLIB_VERSION} STANDARD API DEFINITION"
|
||||
COMMAND "${AWK}" -f "${SRCDIR}/scripts/options.awk"
|
||||
"out=pnglibconf.tf6" "logunsupported=1" "version=search"
|
||||
"${SRCDIR}/pngconf.h" "-"
|
||||
"${SRCDIR}/scripts/pnglibconf.dfa"
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate pnglibconf.tf6")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/options.awk"
|
||||
"out=pnglibconf.tf7" "pnglibconf.tf6"
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate pnglibconf.tf7")
|
||||
endif()
|
||||
|
||||
file(REMOVE "pnglibconf.tf6")
|
||||
file(MAKE_DIRECTORY "${BINDIR}/scripts")
|
||||
file(RENAME "pnglibconf.tf7" "${BINDIR}/scripts/pnglibconf.c")
|
||||
|
||||
elseif ("${OUTPUT}" STREQUAL "pnglibconf.c")
|
||||
# Generate pnglibconf.c
|
||||
|
||||
file(REMOVE "${BINDIR}/pnglibconf.tf4" "${BINDIR}/pnglibconf.tf5")
|
||||
|
||||
execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/options.awk"
|
||||
out=pnglibconf.tf4 version=search
|
||||
${SRCDIR}/pngconf.h ${SRCDIR}/scripts/pnglibconf.dfa
|
||||
${SRCDIR}/pngusr.dfa ${DFA_XTRA}
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate pnglibconf.tf4")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${AWK}" -f "${SRCDIR}/scripts/options.awk"
|
||||
out=pnglibconf.tf5 pnglibconf.tf4
|
||||
WORKING_DIRECTORY "${BINDIR}"
|
||||
RESULT_VARIABLE AWK_FAIL)
|
||||
if(AWK_FAIL)
|
||||
message(FATAL_ERROR "Failed to generate pnglibconf.tf5")
|
||||
endif()
|
||||
|
||||
file(REMOVE "pnglibconf.tf4")
|
||||
file(MAKE_DIRECTORY "${BINDIR}/scripts")
|
||||
file(RENAME "pnglibconf.tf5" "${BINDIR}/pnglibconf.c")
|
||||
|
||||
elseif ("${OUTPUT}" STREQUAL "pnglibconf.h")
|
||||
# Generate pnglibconf.h
|
||||
|
||||
file(REMOVE "${BINDIR}/${OUTPUT}")
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${BINDIR}/pnglibconf.out"
|
||||
"${BINDIR}/${OUTPUT}"
|
||||
RESULT_VARIABLE COPY_FAIL)
|
||||
if(COPY_FAIL)
|
||||
message(FATAL_ERROR "Failed to create pnglibconf.h")
|
||||
endif()
|
||||
|
||||
elseif("${OUTPUT}" STREQUAL "scripts/pnglibconf.h.prebuilt")
|
||||
# Generate scripts/pnglibconf.h.prebuilt (fails build)
|
||||
|
||||
message(STATUS "Attempting to build scripts/pnglibconf.h.prebuilt")
|
||||
message(STATUS "This is a machine generated file, but if you want to make")
|
||||
message(STATUS "a new one simply build the 'genfiles' target, and copy")
|
||||
message(STATUS "scripts/pnglibconf.out to scripts/pnglibconf.h.prebuilt")
|
||||
message(STATUS "AND set PNG_ZLIB_VERNUM to 0 (you MUST do this)")
|
||||
message(FATAL_ERROR "Stopping build")
|
||||
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported output: ${OUTPUT}")
|
||||
endif()
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.5.26
|
||||
version=1.5.27beta02
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng15
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.5.26
|
||||
Version: 1.5.27beta02
|
||||
Libs: -L${libdir} -lpng15
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
VERMAJ = 1
|
||||
VERMIN = 5
|
||||
VERMIC = 26
|
||||
VERMIC = 27
|
||||
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
|
||||
NAME = libpng
|
||||
PACKAGE = $(NAME)-$(VER)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng15
|
||||
PNGMAJ = 15
|
||||
RELEASE = 26
|
||||
RELEASE = 27
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).so
|
||||
|
||||
@@ -18,7 +18,7 @@ exec_prefix=$(prefix)
|
||||
# Library name:
|
||||
LIBNAME = libpng15
|
||||
PNGMAJ = 15
|
||||
RELEASE = 26
|
||||
RELEASE = 27
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).dll
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15
|
||||
|
||||
LIB= png15
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.5.26
|
||||
SHLIB_MINOR= 1.5.27beta02
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 15
|
||||
SHLIB_MINOR= 1.5.26
|
||||
SHLIB_MINOR= 1.5.27beta02
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 15
|
||||
SHLIB_MINOR= 1.5.26
|
||||
SHLIB_MINOR= 1.5.27beta02
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# last changed in libpng version 1.5.7 - December 15, 2011
|
||||
#
|
||||
# Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
# Copyright (c) 2011 Glenn Randers-Pehrson
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
|
||||
@@ -8,7 +8,7 @@ com pnglibconf.h - library build configuration
|
||||
com
|
||||
version
|
||||
com
|
||||
com Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
com Copyright (c) 2011-2015 Glenn Randers-Pehrson
|
||||
com
|
||||
com This code is released under the libpng license.
|
||||
com For conditions of distribution and use, see the disclaimer
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* 1.5.26 STANDARD API DEFINITION */
|
||||
/* 1.5.27beta02 STANDARD API DEFINITION */
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.5.26 - December 17, 2015 */
|
||||
/* libpng version 1.5.27beta02 - May 11, 2016 */
|
||||
|
||||
/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
|
||||
/* Copyright (c) 2011-2015 Glenn Randers-Pehrson */
|
||||
|
||||
/* This code is released under the libpng license. */
|
||||
/* For conditions of distribution and use, see the disclaimer */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
;Version 1.5.26
|
||||
;Version 1.5.27beta02
|
||||
;--------------------------------------------------------------
|
||||
; LIBPNG symbol list as a Win32 DEF file
|
||||
; Contains all the symbols that can be exported from libpng
|
||||
|
||||
31
scripts/test.cmake.in
Normal file
31
scripts/test.cmake.in
Normal file
@@ -0,0 +1,31 @@
|
||||
# test.cmake.in
|
||||
|
||||
# Copyright (C) 2016 Glenn Randers-Pehrson
|
||||
# Written by Roger Leigh, 2016
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
set(TEST_OPTIONS "@TEST_OPTIONS@")
|
||||
set(TEST_FILES "@TEST_FILES@")
|
||||
|
||||
foreach(file ${TEST_FILES})
|
||||
file(TO_NATIVE_PATH "${file}" native_file)
|
||||
list(APPEND NATIVE_TEST_FILES "${native_file}")
|
||||
endforeach()
|
||||
|
||||
# Add the directory containing libpng to the PATH (Windows only)
|
||||
if(WIN32)
|
||||
get_filename_component(LIBPNG_DIR "${LIBPNG}" PATH)
|
||||
file(TO_NATIVE_PATH "${LIBPNG_DIR}" LIBPNG_DIR)
|
||||
set(ENV{PATH} "${LIBPNG_DIR};$ENV{PATH}")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E echo "Running ${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES})
|
||||
|
||||
execute_process(COMMAND "${TEST_COMMAND}" ${TEST_OPTIONS} ${NATIVE_TEST_FILES}
|
||||
RESULT_VARIABLE TEST_STATUS)
|
||||
if(TEST_STATUS)
|
||||
message(FATAL_ERROR "Returned failed status ${TEST_STATUS}!")
|
||||
endif()
|
||||
Reference in New Issue
Block a user