[libpng] Update: v1.6.47 -> v1.6.48

The APNG patch for v1.6.48 isn't out yet, but unlike v1.6.47, this
release doesn't have any major breaking changes.
This commit is contained in:
David Korth 2025-05-03 10:23:59 -04:00
parent e07a45be0e
commit c706f7ba9b
38 changed files with 479 additions and 329 deletions

94
extlib/libpng/.cmake-format.yaml vendored Normal file
View File

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

View File

@ -1,5 +1,5 @@
libpng 1.6.47 - February 18, 2025
=================================
libpng 1.6.48 - April 30, 2025
==============================
This is a public release of libpng, intended for use in production code.
@ -9,13 +9,13 @@ Files available for download
Source files with LF line endings (for Unix/Linux):
* libpng-1.6.47.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.47.tar.gz (deflate-compressed)
* libpng-1.6.48.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.48.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
* lpng1647.7z (LZMA-compressed, recommended)
* lpng1647.zip (deflate-compressed)
* lpng1648.7z (LZMA-compressed, recommended)
* lpng1648.zip (deflate-compressed)
Other information:
@ -25,19 +25,17 @@ Other information:
* TRADEMARK.md
Changes from version 1.6.46 to version 1.6.47
Changes from version 1.6.47 to version 1.6.48
---------------------------------------------
* Modified the behaviour of colorspace chunks in order to adhere
to the new precedence rules formulated in the latest draft of
the PNG Specification.
(Contributed by John Bowler)
* Fixed a latent bug in `png_write_iCCP`.
This would have been a read-beyond-end-of-malloc vulnerability,
introduced early in the libpng-1.6.0 development, yet (fortunately!)
it was inaccessible before the above-mentioned modification of the
colorspace precedence rules, due to pre-existing colorspace checks.
(Reported by Bob Friesenhahn; fixed by John Bowler)
* Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
(Reported by Mohit Bakshi; fixed by John Bowler)
* Added #error directives to discourage the inclusion of private
libpng implementation header files in PNG-supporting applications.
* Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
alternative to `DFA_XTRA`.
* Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.

10
extlib/libpng/CHANGES vendored
View File

@ -6251,6 +6251,16 @@ Version 1.6.47 [February 18, 2025]
colorspace precedence rules, due to pre-existing colorspace checks.
(Reported by Bob Friesenhahn; fixed by John Bowler)
Version 1.6.48 [April 30, 2025]
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
(Reported by Mohit Bakshi; fixed by John Bowler)
Added #error directives to discourage the inclusion of private
libpng implementation header files in PNG-supporting applications.
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
alternative to `DFA_XTRA`.
Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@ -1,4 +1,3 @@
# CMakeLists.txt - CMake lists for libpng
#
# Copyright (c) 2018-2025 Cosmin Truta
@ -16,13 +15,11 @@
# SPDX-License-Identifier: libpng-2.0
# rom-properties: Disabled; use the main project policies.
IF(0)
cmake_minimum_required(VERSION 3.14)
ENDIF(0) # rom-properties
#cmake_minimum_required(VERSION 3.14...4.0)
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
set(PNGLIB_REVISION 47)
set(PNGLIB_REVISION 48)
set(PNGLIB_SUBREVISION 0)
#set(PNGLIB_SUBREVISION "git")
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_REVISION})
@ -46,19 +43,39 @@ ENDIF(0) # rom-properties
# Allow the users to specify an application-specific API prefix for libpng
# vendoring purposes. A standard libpng build should have no such prefix.
set(PNG_PREFIX ""
set(PNG_PREFIX
""
CACHE STRING "Prefix to prepend to the API function names")
# Allow the users to override the postfix appended to debug library file names.
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
# not be cached, however, because doing so would affect all projects processed
# after libpng, in unexpected and undesirable ways.
set(PNG_DEBUG_POSTFIX "d"
set(PNG_DEBUG_POSTFIX
"d"
CACHE STRING "Postfix to append to library file names under the Debug configuration")
# Allow the users to import their own extra configuration settings.
set(DFA_XTRA ""
CACHE FILEPATH "File containing extra configuration settings")
# Those settings can be either passed via DFA_XTRA if they are in DFA form
# (such as "pngusr.dfa"), or via PNG_LIBCONF_HEADER if they are in prebuilt
# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both.
# For platforms such as Android or iOS, or in certain cross-platform build
# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory.
set(DFA_XTRA
""
CACHE FILEPATH "DFA file containing customized build configuration settings for libpng")
set(PNG_LIBCONF_HEADER
""
CACHE FILEPATH "C header file containing customized build configuration settings for libpng")
set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
if(ANDROID OR IOS)
set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
endif()
if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL ""))
message(SEND_ERROR "The options DFA_XTRA=\"${DFA_XTRA}\" "
"and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" "
"are mutually exclusive")
endif()
# rom-properties: Hard-coded values in extlib are used.
IF(0)
@ -67,6 +84,11 @@ option(PNG_SHARED "Build libpng as a shared library" ON)
option(PNG_STATIC "Build libpng as a static library" ON)
if(APPLE)
option(PNG_FRAMEWORK "Build libpng as a framework bundle" ON)
else()
option(PNG_FRAMEWORK "Build libpng as a framework bundle (not available on this platform)" OFF)
endif()
if(NOT APPLE AND PNG_FRAMEWORK)
message(SEND_ERROR "The option PNG_FRAMEWORK should not be set on this platform")
endif()
# Allow the users to switch on/off the auxiliary build and test artifacts.
@ -88,8 +110,8 @@ option(PNG_EXECUTABLES "[Deprecated; please use PNG_TOOLS]" ON)
if(NOT PNG_EXECUTABLES)
message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS")
if(PNG_TOOLS)
message(AUTHOR_WARNING
"Setting PNG_TOOLS to ${PNG_EXECUTABLES}, to stay compatible with PNG_EXECUTABLES")
message(AUTHOR_WARNING "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, "
"to stay compatible with PNG_EXECUTABLES")
set(PNG_TOOLS "${PNG_EXECUTABLES}")
endif()
endif()
@ -123,14 +145,15 @@ ENDIF(0) # rom-properties
if(PNG_BUILD_ZLIB)
if("x${ZLIB_ROOT}" STREQUAL "x")
#message(SEND_ERROR
message(DEPRECATION
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
"please use ZLIB_ROOT instead")
#message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
# "please use ZLIB_ROOT instead")
message(DEPRECATION "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
"please use ZLIB_ROOT instead")
else()
message(SEND_ERROR
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
#message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
# "using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
message(DEPRECATION "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
endif()
else()
find_package(ZLIB REQUIRED)
@ -155,15 +178,17 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)")
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|aarch64)")
set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
set(PNG_ARM_NEON "on"
set(PNG_ARM_NEON
"on"
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
else()
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
set(PNG_ARM_NEON "off"
set(PNG_ARM_NEON
"off"
CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
endif()
set_property(CACHE PNG_ARM_NEON
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
@ -185,10 +210,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for PowerPC.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)")
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
set(PNG_POWERPC_VSX "on"
set(PNG_POWERPC_VSX
"on"
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
set_property(CACHE PNG_POWERPC_VSX
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
@ -207,10 +233,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for Intel.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)")
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
set(PNG_INTEL_SSE "on"
set(PNG_INTEL_SSE
"on"
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
set_property(CACHE PNG_INTEL_SSE
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
@ -258,20 +285,22 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
# Set definitions and sources for MIPS.
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
set(PNG_MIPS_MSA "on"
set(PNG_MIPS_MSA
"on"
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
set_property(CACHE PNG_MIPS_MSA
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index_msa)
if(index_msa EQUAL -1)
message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
endif()
set(PNG_MIPS_MMI_POSSIBLE_VALUES on off)
set(PNG_MIPS_MMI "on"
set(PNG_MIPS_MMI
"on"
CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default")
set_property(CACHE PNG_MIPS_MMI
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi)
if(index_mmi EQUAL -1)
message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]")
@ -306,25 +335,25 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)")
include(CheckCCompilerFlag)
set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
set(PNG_LOONGARCH_LSX "on"
set(PNG_LOONGARCH_LSX
"on"
CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
set_property(CACHE PNG_LOONGARCH_LSX
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
if(index EQUAL -1)
message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX)
check_c_compiler_flag("-mlsx" COMPILER_SUPPORTS_LSX)
if(COMPILER_SUPPORTS_LSX)
set(libpng_loongarch_sources
loongarch/loongarch_lsx_init.c
loongarch/filter_lsx_intrinsics.c)
set_source_files_properties(${libpng_loongarch_sources}
PROPERTIES
COMPILE_FLAGS "-mlsx")
PROPERTIES COMPILE_FLAGS "-mlsx")
add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
else()
message(FATAL_ERROR "Compiler does not support -mlsx option")
message(FATAL_ERROR "This compiler does not support the -mlsx option")
endif()
else()
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
@ -373,7 +402,8 @@ VERS_2 { global: sym2; main; } VERS_1;
# Solaris, because of an incompatibility with the Solaris link editor.
list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()
list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
list(APPEND CMAKE_REQUIRED_FLAGS
"-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
check_c_source_compiles("
void sym1(void) {}
void sym2(void) {}
@ -397,26 +427,48 @@ int main(void) { return 0; }
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
endif()
# Find an AWK language processor.
# Start with specific AWK implementations like gawk and nawk, which are
# known to work with our scripts, then fall back to the system awk.
find_program(AWK NAMES gawk nawk awk)
if(AWK)
message(STATUS "Found AWK program: ${AWK}")
else()
message(STATUS "Could not find an AWK-compatible program")
if(PNG_LIBCONF_HEADER STREQUAL "")
# No custom configuration header file has been specified, so we build it
# from our DFA files and (optionally) out of the user-supplied DFA file.
# Find an AWK language processor.
# Start with specific AWK implementations like gawk and nawk, which are
# known to work with our scripts, then fall back to the system awk.
find_program(AWK NAMES gawk nawk awk)
if(AWK)
message(STATUS "Found AWK program: ${AWK}")
else()
message(STATUS "Could not find an AWK-compatible program")
endif()
endif()
if(NOT AWK OR (ANDROID OR IOS))
# 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)
# Include the internal module PNGCheckLibconf.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGCheckLibconf.cmake)
if(NOT PNG_LIBCONF_HEADER STREQUAL "")
# Configure libpng with the user-defined pnglibconf.h file.
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER}")
configure_file("${PNG_LIBCONF_HEADER}"
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
@ONLY)
add_custom_target(png_genfiles)
elseif(NOT AWK)
# No AWK program available to generate pnglibconf.h.
# Configure libpng with pnglibconf.h.prebuilt.
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
@ONLY)
add_custom_target(png_genfiles)
else()
png_check_libconf(DFA_XTRA "${DFA_XTRA}")
# Include the internal module PNGGenConfig.cmake
include(${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/PNGGenConfig.cmake)
# Copy the awk scripts, converting their line endings to Unix (LF)
# Work around a limitation of various Windows AWK programs that are
# unable to process CRLF-terminated AWK scripts.
# Copy these AWK scripts to a temporary location, converting their
# line endings from Windows (CRLF) to Unix (LF) at the destination.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/checksym.awk
${CMAKE_CURRENT_BINARY_DIR}/scripts/checksym.awk
@ONLY
@ -462,14 +514,16 @@ else()
# Generate pnglibconf.h
generate_source(OUTPUT "pnglibconf.h"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out
${PNGLIBCONF_H_EXTRA_DEPENDS})
add_custom_target(pnglibconf_h
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_intprefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
@ -477,7 +531,8 @@ else()
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out)
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out)
add_custom_target(png_scripts_prefix_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
@ -489,7 +544,8 @@ else()
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" pnglibconf_h)
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_sym_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
@ -505,7 +561,8 @@ else()
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" pnglibconf_h)
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h)
add_custom_target(png_scripts_vers_out
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
@ -538,20 +595,33 @@ else()
# A single target handles generation of all generated files.
add_custom_target(png_genfiles
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym" png_gensym
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers" png_genvers
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h" pngprefix_h
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out" png_scripts_intprefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" png_scripts_pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out" png_scripts_prefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out" png_scripts_sym_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" png_scripts_symbols_chk
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" png_scripts_symbols_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" png_scripts_vers_out)
endif(NOT AWK OR (ANDROID OR IOS))
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
png_gensym
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
png_genvers
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
pnglibconf_h
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
pnglibconf_out
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
pngprefix_h
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
png_scripts_intprefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
png_scripts_pnglibconf_c
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
png_scripts_prefix_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
png_scripts_sym_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
png_scripts_symbols_chk
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
png_scripts_symbols_out
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
png_scripts_vers_out)
endif()
# List the source code files.
set(libpng_public_hdrs
@ -565,7 +635,7 @@ set(libpng_private_hdrs
pnginfo.h
pngstruct.h
)
if(AWK AND NOT (ANDROID OR IOS))
if(AWK)
list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
endif()
set(libpng_sources
@ -663,11 +733,11 @@ if(PNG_SHARED)
add_library(png_shared SHARED ${libpng_sources})
add_dependencies(png_shared png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_shared)
set_target_properties(png_shared PROPERTIES
OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
VERSION "${PNGLIB_SHARED_VERSION}"
SOVERSION "${PNGLIB_ABI_VERSION}")
set_target_properties(png_shared
PROPERTIES OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
VERSION "${PNGLIB_SHARED_VERSION}"
SOVERSION "${PNGLIB_ABI_VERSION}")
# rom-properties: Split debug functionality; Windows subsystem.
DO_SPLIT_DEBUG(png_shared)
@ -675,20 +745,22 @@ if(PNG_SHARED)
if(UNIX AND AWK)
if(HAVE_LD_VERSION_SCRIPT)
set_target_properties(png_shared PROPERTIES
LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
set_target_properties(png_shared
PROPERTIES LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
set_target_properties(png_shared PROPERTIES
LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
set_target_properties(png_shared
PROPERTIES LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
endif()
endif()
if(APPLE)
# Avoid CMake's implicit compile definition "png_shared_EXPORTS".
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL "")
set_target_properties(png_shared
PROPERTIES DEFINE_SYMBOL "")
elseif(WIN32)
# rom-properties: Set PNG_USE_DLL to use dllimport.
# Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs.
#set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
#set_target_properties(png_shared
# PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
target_compile_definitions(png_shared
PRIVATE -DPNG_BUILD_DLL
INTERFACE -DPNG_USE_DLL
@ -698,10 +770,12 @@ if(PNG_SHARED)
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_shared
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(png_shared SYSTEM
target_include_directories(png_shared
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_shared PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
target_link_libraries(png_shared
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
endif()
if(PNG_STATIC)
@ -713,24 +787,25 @@ if(PNG_STATIC)
add_library(png_static STATIC ${libpng_sources})
add_dependencies(png_static png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_static)
set_target_properties(png_static PROPERTIES
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
set_target_properties(png_static
PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(png_static SYSTEM
target_include_directories(png_static
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_static PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
target_link_libraries(png_static
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
# rom-properties: Set the MSVC debug path.
SET_MSVC_DEBUG_PATH(png_static)
endif()
if(PNG_FRAMEWORK AND NOT APPLE)
message(AUTHOR_WARNING
"Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
message(AUTHOR_WARNING "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
set(PNG_FRAMEWORK OFF)
endif()
@ -738,26 +813,29 @@ if(PNG_FRAMEWORK)
add_library(png_framework SHARED ${libpng_sources})
add_dependencies(png_framework png_genfiles)
list(APPEND PNG_LIBRARY_TARGETS png_framework)
set_target_properties(png_framework PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
PUBLIC_HEADER "${libpng_public_hdrs}"
OUTPUT_NAME "png"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
set_target_properties(png_framework
PROPERTIES FRAMEWORK TRUE
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
PUBLIC_HEADER "${libpng_public_hdrs}"
OUTPUT_NAME "png"
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
set_target_properties(png_framework
PROPERTIES DEFINE_SYMBOL "")
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(png_framework
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(png_framework SYSTEM
target_include_directories(png_framework
SYSTEM
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
# rom-properties: ZLIB::ZLIB -> ${ZLIB_LIBRARY}
target_link_libraries(png_framework PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
target_link_libraries(png_framework
PUBLIC ${ZLIB_LIBRARY} ${M_LIBRARY})
endif()
if(NOT PNG_LIBRARY_TARGETS)
@ -784,7 +862,8 @@ if(PNG_TESTS AND PNG_SHARED)
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
add_executable(pngtest ${pngtest_sources})
target_link_libraries(pngtest PRIVATE png_shared)
target_link_libraries(pngtest
PRIVATE png_shared)
png_add_test(NAME pngtest
COMMAND pngtest
@ -795,7 +874,8 @@ if(PNG_TESTS AND PNG_SHARED)
FILES "${TEST_PNG3_PNGS}")
add_executable(pngvalid ${pngvalid_sources})
target_link_libraries(pngvalid PRIVATE png_shared)
target_link_libraries(pngvalid
PRIVATE png_shared)
png_add_test(NAME pngvalid-gamma-16-to-8
COMMAND pngvalid
@ -841,7 +921,8 @@ if(PNG_TESTS AND PNG_SHARED)
OPTIONS --transform)
add_executable(pngstest ${pngstest_sources})
target_link_libraries(pngstest PRIVATE png_shared)
target_link_libraries(pngstest
PRIVATE png_shared)
foreach(gamma_type 1.8 linear none sRGB)
foreach(alpha_type none alpha)
@ -896,7 +977,8 @@ if(PNG_TESTS AND PNG_SHARED)
endforeach()
add_executable(pngunknown ${pngunknown_sources})
target_link_libraries(pngunknown PRIVATE png_shared)
target_link_libraries(pngunknown
PRIVATE png_shared)
png_add_test(NAME pngunknown-discard
COMMAND pngunknown
@ -912,7 +994,8 @@ if(PNG_TESTS AND PNG_SHARED)
FILES "${PNGTEST_PNG}")
png_add_test(NAME pngunknown-sAPI
COMMAND pngunknown
OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
OPTIONS --strict
bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
FILES "${PNGTEST_PNG}")
png_add_test(NAME pngunknown-save
COMMAND pngunknown
@ -928,7 +1011,8 @@ if(PNG_TESTS AND PNG_SHARED)
FILES "${PNGTEST_PNG}")
add_executable(pngimage ${pngimage_sources})
target_link_libraries(pngimage PRIVATE png_shared)
target_link_libraries(pngimage
PRIVATE png_shared)
png_add_test(NAME pngimage-quick
COMMAND pngimage
@ -942,11 +1026,13 @@ endif()
if(PNG_SHARED AND PNG_TOOLS)
add_executable(pngfix ${pngfix_sources})
target_link_libraries(pngfix PRIVATE png_shared)
target_link_libraries(pngfix
PRIVATE png_shared)
set(PNG_BIN_TARGETS pngfix)
add_executable(png-fix-itxt ${png_fix_itxt_sources})
target_link_libraries(png-fix-itxt PRIVATE ZLIB::ZLIB ${M_LIBRARY})
target_link_libraries(png-fix-itxt
PRIVATE ZLIB::ZLIB ${M_LIBRARY})
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
endif()
@ -960,12 +1046,11 @@ function(create_symlink DEST_FILE)
# CMake version 3.13.
cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
if(NOT _SYM_FILE AND NOT _SYM_TARGET)
message(FATAL_ERROR "create_symlink: Missing FILE or TARGET argument")
message(FATAL_ERROR "create_symlink: Missing arguments: FILE or TARGET")
endif()
if(_SYM_FILE AND _SYM_TARGET)
message(FATAL_ERROR "create_symlink: "
"The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) "
"are mutually-exclusive")
message(FATAL_ERROR "create_symlink: Mutually-exlusive arguments:"
"FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET})")
endif()
if(_SYM_FILE)
@ -1027,11 +1112,11 @@ endif()
# Only do this on Windows for Cygwin - the files don't make much sense
# outside of a UNIX look-alike.
if(NOT WIN32 OR CYGWIN OR MINGW)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(LIBS "-lz -lm")
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
@ONLY)

View File

@ -1,4 +1,4 @@
README for libpng version 1.6.47
README for libpng version 1.6.48
================================
See the note about version numbers near the top of `png.h`.

View File

@ -1,9 +1,9 @@
This copy of libpng-1.6.47 is a modified version of the original.
This copy of libpng-1.6.48 is a modified version of the original.
commit 872555f4ba910252783af1507f9e7fe1653be252
Release libpng version 1.6.47
commit ea127968204cc5d10f3fc9250c306b9e8cbd9b80
Release libpng version 1.6.48
Tag: v1.6.47
Tag: v1.6.48
The following changes have been made to the original:
@ -14,5 +14,5 @@ The following changes have been made to the original:
- APNG support has been added via the APNG patch:
http://sourceforge.net/projects/libpng-apng/
To obtain the original libpng-1.6.47, visit:
To obtain the original libpng-1.6.48, visit:
http://www.libpng.org/pub/png/libpng.html

View File

@ -35,14 +35,14 @@
#ifndef PNG_ARM_NEON_FILE
# if defined(__aarch64__) || defined(_M_ARM64)
/* ARM Neon is expected to be unconditionally available on ARM64. */
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64"
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on ARM64
# elif defined(__ARM_NEON__) || defined(__ARM_NEON)
/* ARM Neon is expected to be available on the target CPU architecture. */
# error "PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch"
# error PNG_ARM_NEON_CHECK_SUPPORTED must not be defined on this CPU arch
# elif defined(__linux__)
# define PNG_ARM_NEON_FILE "contrib/arm-neon/linux.c"
# else
# error "No support for run-time ARM Neon checking; use compile-time options"
# error No support for run-time ARM Neon checking; use compile-time options
# endif
#endif
@ -53,7 +53,7 @@ static int png_have_neon(png_structp png_ptr);
#endif /* PNG_ARM_NEON_CHECK_SUPPORTED */
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
void

View File

@ -2,7 +2,7 @@
/* example.c - an example of using libpng
*
* Maintained 2018-2024 Cosmin Truta
* Maintained 2018-2025 Cosmin Truta
* Maintained 1998-2016 Glenn Randers-Pehrson
* Maintained 1996-1997 Andreas Dilger
* Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -179,11 +179,11 @@ int main(int argc, const char **argv)
* components.
*
* You do not have to read directly from a file. You can read from memory or,
* on systems that support it, from a <stdio.h> FILE*. This is controlled by
* the particular png_image_read_from_ function you call at the start.
* Likewise, on write, you can write to a FILE* if your system supports it.
* Check the macro PNG_STDIO_SUPPORTED to see if stdio support has been
* included in your libpng build.
* on systems that support <stdio.h>, from a FILE object. This is controlled
* by the particular png_image_begin_read_from_ function you call at the start.
* Likewise, on write, you can write to a FILE object if your system supports
* <stdio.h>. The macro PNG_STDIO_SUPPORTED indicates if stdio is available
* and accessible from your libpng build.
*
* If you read 16-bit (PNG_FORMAT_FLAG_LINEAR) data, you may need to write it
* in the 8-bit format for display. You do this by setting the convert_to_8bit

View File

@ -9,7 +9,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng version 1.6.36, December 2018, through 1.6.47 - February 2025
libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta
@ -4089,7 +4089,7 @@ READ APIs
is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image,
FILE* file)
FILE *file)
The PNG header is read from the stdio FILE object.
@ -4164,7 +4164,7 @@ be written:
int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap)
Write the image to the given (FILE*).
Write the image to the given FILE object.
With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "February 18, 2025"
.TH LIBPNG 3 "April 30, 2025"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.47
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
.SH SYNOPSIS
\fB#include <png.h>\fP
@ -223,7 +223,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.47
\fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP
\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE* \fIfile\fP\fB);\fP
\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE *\fIfile\fP\fB);\fP
\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, size_t \fIsize\fP\fB);\fP
@ -528,7 +528,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng version 1.6.36, December 2018, through 1.6.47 - February 2025
libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta
@ -4608,7 +4608,7 @@ READ APIs
is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image,
FILE* file)
FILE *file)
The PNG header is read from the stdio FILE object.
@ -4683,7 +4683,7 @@ be written:
int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap)
Write the image to the given (FILE*).
Write the image to the given FILE object.
With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be

View File

@ -1,24 +1,17 @@
.TH LIBPNGPF 3 "February 18, 2025"
.TH LIBPNGPF 3 "April 30, 2025"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.47
(private functions)
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.48
.SH SYNOPSIS
\fB#include \fI"pngpriv.h"
\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer
\fP\fImaintained\fP\fB, now that the private function prototypes are hidden in
\fP\fIpngpriv.h\fP\fB and not accessible to applications. Look in
\fP\fIpngpriv.h\fP\fB for the prototypes and a short description of each
function.
\fB#include "pngpriv.h"\fP
.SH DESCRIPTION
The functions previously listed here are used privately by libpng and are not
available for use by applications. They are not "exported" to applications
using shared libraries.
As of libpng version 1.5.1, this manual is no longer maintained. The private
function prototypes, declared in private header files, should not be accessed
by applications.
.SH "SEE ALSO"
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.BR "libpng"(3)
.SH AUTHORS
Cosmin Truta, Glenn Randers-Pehrson

View File

@ -48,7 +48,7 @@ static int png_have_msa(png_structp png_ptr);
#include PNG_MIPS_MSA_FILE
#else /* PNG_MIPS_MSA_FILE */
# error "PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks"
# error PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks
#endif /* PNG_MIPS_MSA_FILE */
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
@ -66,12 +66,12 @@ static int png_have_mmi();
#include PNG_MIPS_MMI_FILE
#else /* PNG_MIPS_MMI_FILE */
# error "PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks"
# error PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks
#endif /* PNG_MIPS_MMI_FILE */
#endif /* PNG_MIPS_MMI_CHECK_SUPPORTED*/
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
# error ALIGNED_MEMORY is required; please define PNG_ALIGNED_MEMORY_SUPPORTED
#endif
/* MIPS supports two optimizations: MMI and MSA. The appropriate

6
extlib/libpng/png.5 vendored
View File

@ -1,4 +1,4 @@
.TH PNG 5 "February 18, 2025"
.TH PNG 5 "April 30, 2025"
.SH NAME
png \- Portable Network Graphics (PNG) format
@ -20,10 +20,10 @@ matching on heterogeneous platforms.
.SH "SEE ALSO"
.BR "libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
.LP
PNG Specification (Third Edition) Candidate Recommendation Draft, January 2025:
PNG Specification (Third Edition) Candidate Recommendation, March 2025:
.IP
.br
https://www.w3.org/TR/2025/CRD-png-3-20250121/
https://www.w3.org/TR/2025/CR-png-3-20250313/
.LP
PNG Specification (Second Edition), November 2003:
.IP

12
extlib/libpng/png.c vendored
View File

@ -13,7 +13,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_47 Your_png_h_is_not_version_1_6_47;
typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
@ -700,7 +700,7 @@ png_get_io_ptr(png_const_structrp png_ptr)
* function of your own because "FILE *" isn't necessarily available.
*/
void PNGAPI
png_init_io(png_structrp png_ptr, png_FILE_p fp)
png_init_io(png_structrp png_ptr, FILE *fp)
{
png_debug(1, "in png_init_io");
@ -815,7 +815,7 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.47" PNG_STRING_NEWLINE \
"libpng version 1.6.48" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
@ -1491,7 +1491,7 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
}
#endif /* COLORSPACE */
#ifdef PNG_iCCP_SUPPORTED
#ifdef PNG_READ_iCCP_SUPPORTED
/* Error message generation */
static char
png_icc_tag_char(png_uint_32 byte)
@ -1567,9 +1567,7 @@ png_icc_profile_error(png_const_structrp png_ptr, png_const_charp name,
return 0;
}
#endif /* iCCP */
#ifdef PNG_READ_iCCP_SUPPORTED
/* Encoded value of D50 as an ICC XYZNumber. From the ICC 2010 spec the value
* is XYZ(0.9642,1.0,0.8249), which scales to:
*
@ -3969,7 +3967,7 @@ png_image_free_function(png_voidp argument)
# ifdef PNG_STDIO_SUPPORTED
if (cp->owned_file != 0)
{
FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr);
FILE *fp = png_voidcast(FILE *, cp->png_ptr->io_ptr);
cp->owned_file = 0;
/* Ignore errors here. */

20
extlib/libpng/png.h vendored
View File

@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.6.47
* libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@ -14,7 +14,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
* libpng versions 1.6.36, December 2018, through 1.6.47, February 2025:
* libpng versions 1.6.36, December 2018, through 1.6.48, April 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@ -238,7 +238,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
* 1.6.47 16 10647 16.so.16.47[.0]
* 1.6.48 16 10648 16.so.16.48[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@ -274,7 +274,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.47"
#define PNG_LIBPNG_VER_STRING "1.6.48"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@ -285,7 +285,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 47
#define PNG_LIBPNG_VER_RELEASE 48
/* This should be zero for a public release, or non-zero for a
* development version.
@ -316,7 +316,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10647 /* 1.6.47 */
#define PNG_LIBPNG_VER 10648 /* 1.6.48 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@ -441,7 +441,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_6_47;
typedef char* png_libpng_version_1_6_48;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@ -1589,7 +1589,7 @@ PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,
#ifdef PNG_STDIO_SUPPORTED
/* Initialize the input/output for the PNG file to the default functions. */
PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));
PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, FILE *fp));
#endif
/* Replace the (error and abort), and warning functions with user
@ -3107,7 +3107,7 @@ PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,
*/
PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
FILE* file));
FILE *file));
/* The PNG header is read from the stdio FILE object. */
#endif /* STDIO */
@ -3182,7 +3182,7 @@ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,
PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
int convert_to_8_bit, const void *buffer, png_int_32 row_stride,
const void *colormap));
/* Write the image to the given (FILE*). */
/* Write the image to the given FILE object. */
#endif /* SIMPLIFIED_WRITE_STDIO */
/* With all write APIs if image is in one of the linear formats with 16-bit

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine-configurable file for libpng
*
* libpng version 1.6.47
* libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
@ -219,25 +219,13 @@
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
# endif
# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
(defined(__BORLANDC__) && __BORLANDC__ < 0x500)
/* older Borland and MSC
* compilers used '__export' and required this to be after
* the type.
*/
# ifndef PNG_EXPORT_TYPE
# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
# endif
# define PNG_DLL_EXPORT __export
# else /* newer compiler */
# define PNG_DLL_EXPORT __declspec(dllexport)
# ifndef PNG_DLL_IMPORT
# define PNG_DLL_IMPORT __declspec(dllimport)
# endif
# endif /* compiler */
# define PNG_DLL_EXPORT __declspec(dllexport)
# ifndef PNG_DLL_IMPORT
# define PNG_DLL_IMPORT __declspec(dllimport)
# endif
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
@ -479,7 +467,7 @@
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
# error "libpng requires 8-bit bytes"
# error libpng requires 8-bit bytes
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
@ -487,7 +475,7 @@
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
# error "libpng requires a signed 16-bit type"
# error libpng requires a signed 16-bit integer type
#endif
#if UINT_MAX == 65535
@ -495,7 +483,7 @@
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
# error "libpng requires an unsigned 16-bit type"
# error libpng requires an unsigned 16-bit integer type
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
@ -503,7 +491,7 @@
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
# error "libpng requires a signed 32-bit (or more) type"
# error libpng requires a signed 32-bit (or longer) integer type
#endif
#if UINT_MAX > 4294967294U
@ -511,7 +499,7 @@
#elif ULONG_MAX > 4294967294U
typedef unsigned long int png_uint_32;
#else
# error "libpng requires an unsigned 32-bit (or more) type"
# error libpng requires an unsigned 32-bit (or longer) integer type
#endif
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
@ -592,10 +580,6 @@ typedef const png_fixed_point * png_const_fixed_point_p;
typedef size_t * png_size_tp;
typedef const size_t * png_const_size_tp;
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
#endif
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * png_doublep;
typedef const double * png_const_doublep;
@ -617,6 +601,15 @@ typedef double * * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char * * * png_charppp;
#ifdef PNG_STDIO_SUPPORTED
/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were
* not necessarily stdio FILE streams, to allow building Windows applications
* before Win32 and Windows CE applications before WinCE 3.0, but that kind
* of support has long been discontinued.
*/
typedef FILE * png_FILE_p; /* [Deprecated] */
#endif
#endif /* PNG_BUILDING_SYMBOL_TABLE */
#endif /* PNGCONF_H */

View File

@ -1,6 +1,6 @@
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
/* pngdebug.h - internal debugging macros for libpng
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -10,6 +10,10 @@
* and license in png.h
*/
#ifndef PNGPRIV_H
# error This file must not be included by applications; please include <png.h>
#endif
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout

View File

@ -1,6 +1,6 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -1,6 +1,6 @@
/* pngget.c - retrieval of values from info struct
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -1,6 +1,6 @@
/* pnginfo.h - header file for PNG reference library
/* pnginfo.h - internal structures for libpng
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -10,43 +10,20 @@
* and license in png.h
*/
/* png_info is a structure that holds the information in a PNG file so
* that the application can find out the characteristics of the image.
* If you are reading the file, this structure will tell you what is
* in the PNG file. If you are writing the file, fill in the information
* you want to put into the PNG file, using png_set_*() functions, then
* call png_write_info().
#ifndef PNGPRIV_H
# error This file must not be included by applications; please include <png.h>
#endif
/* INTERNAL, PRIVATE definition of a PNG.
*
* The names chosen should be very close to the PNG specification, so
* consult that document for information about the meaning of each field.
* png_info is a modifiable description of a PNG datastream. The fields inside
* this structure are accessed through png_get_<CHUNK>() functions and modified
* using png_set_<CHUNK>() functions.
*
* With libpng < 0.95, it was only possible to directly set and read the
* the values in the png_info_struct, which meant that the contents and
* order of the values had to remain fixed. With libpng 0.95 and later,
* however, there are now functions that abstract the contents of
* png_info_struct from the application, so this makes it easier to use
* libpng with dynamic libraries, and even makes it possible to use
* libraries that don't have all of the libpng ancillary chunk-handing
* functionality. In libpng-1.5.0 this was moved into a separate private
* file that is not visible to applications.
*
* The following members may have allocated storage attached that should be
* cleaned up before the structure is discarded: palette, trans, text,
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
* are automatically freed when the info structure is deallocated, if they were
* allocated internally by libpng. This behavior can be changed by means
* of the png_data_freer() function.
*
* More allocation details: all the chunk-reading functions that
* change these members go through the corresponding png_set_*
* functions. A function to clear these members is available: see
* png_free_data(). The png_set_* functions do not depend on being
* able to point info structure members to any of the storage they are
* passed (they make their own copies), EXCEPT that the png_set_text
* functions use the same storage passed to them in the text_ptr or
* itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
* functions do not make their own copies.
* Some functions in libpng do directly access members of png_info. However,
* this should be avoided. png_struct objects contain members which hold
* caches, sometimes optimised, of the values from png_info objects, and
* png_info is not passed to the functions which read and write image data.
*/
#ifndef PNGINFO_H
#define PNGINFO_H

View File

@ -1,6 +1,6 @@
/* pngmem.c - stub functions for memory allocation
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -1,6 +1,6 @@
/* pngpread.c - read a png file in push mode
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -1,6 +1,6 @@
/* pngpriv.h - private declarations for use inside libpng
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -19,8 +19,20 @@
* they should be well aware of the issues that may arise from doing so.
*/
/* pngpriv.h must be included first in each translation unit inside libpng.
* On the other hand, it must not be included at all, directly or indirectly,
* by any application code that uses the libpng API.
*/
#ifndef PNGPRIV_H
#define PNGPRIV_H
# define PNGPRIV_H
#else
# error Duplicate inclusion of pngpriv.h; please check the libpng source files
#endif
#if defined(PNG_H) || defined(PNGCONF_H) || defined(PNGLCONF_H)
# error This file must not be included by applications; please include <png.h>
#endif
/* Feature Test Macros. The following are defined here to ensure that correctly
* implemented libraries reveal the APIs libpng needs to build and hide those
@ -57,7 +69,6 @@
*/
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
# include <config.h>
/* Pick up the definition of 'restrict' from config.h if it was read: */
# define PNG_RESTRICT restrict
#endif
@ -67,9 +78,7 @@
* are not internal definitions may be required. This is handled below just
* before png.h is included, but load the configuration now if it is available.
*/
#ifndef PNGLCONF_H
# include "pnglibconf.h"
#endif
#include "pnglibconf.h"
/* Local renames may change non-exported API functions from png.h */
#if defined(PNG_PREFIX) && !defined(PNGPREFIX_H)
@ -974,17 +983,15 @@
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
"-I (include path) error: see the notes in pngpriv.h"
/* This means that when pnglibconf.h was built the copy of zlib.h that it
* used is not the same as the one being used here. Because the build of
* libpng makes decisions to use inflateInit2 and inflateReset2 based on the
* zlib version number and because this affects handling of certain broken
* PNG files the -I directives must match.
# error The include path of <zlib.h> is incorrect
/* When pnglibconf.h was built, the copy of zlib.h that it used was not the
* same as the one being used here. Considering how libpng makes decisions
* to use the zlib API based on the zlib version number, the -I options must
* match.
*
* The most likely explanation is that you passed a -I in CFLAGS. This will
* not work; all the preprocessor directives and in particular all the -I
* directives must be in CPPFLAGS.
* A possible cause of this mismatch is that you passed an -I option in
* CFLAGS, which is unlikely to work. All the preprocessor options, and all
* the -I options in particular, should be in CPPFLAGS.
*/
#endif
@ -2186,4 +2193,3 @@ PNG_INTERNAL_FUNCTION(int,
#endif
#endif /* PNG_VERSION_INFO_ONLY */
#endif /* PNGPRIV_H */

View File

@ -1408,7 +1408,7 @@ png_image_read_header(png_voidp argument)
#ifdef PNG_STDIO_SUPPORTED
int PNGAPI
png_image_begin_read_from_stdio(png_imagep image, FILE* file)
png_image_begin_read_from_stdio(png_imagep image, FILE *file)
{
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{

View File

@ -1,6 +1,6 @@
/* pngrio.c - functions for data input
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -56,7 +56,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
/* fread() returns 0 on error, so it is OK to store this in a size_t
* instead of an int, which is what fread() actually returns.
*/
check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
check = fread(data, 1, length, png_voidcast(FILE *, png_ptr->io_ptr));
if (check != length)
png_error(png_ptr, "Read Error");

View File

@ -1,6 +1,6 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -1,6 +1,6 @@
/* pngrutil.c - utilities to read a PNG file
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -4434,6 +4434,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
png_error(png_ptr, "Not enough image data");
}
#endif /* PNG_READ_APNG_SUPPORTED */
avail_in = png_ptr->IDAT_read_size;
if (avail_in > png_chunk_max(png_ptr))

View File

@ -300,17 +300,14 @@ png_set_mDCV(png_const_structrp png_ptr, png_inforp info_ptr,
double maxDL, double minDL)
{
png_set_mDCV_fixed(png_ptr, info_ptr,
/* The ITU approach is to scale by 50,000, not 100,000 so just divide
* the input values by 2 and use png_fixed:
*/
png_fixed(png_ptr, white_x / 2, "png_set_mDCV(white(x))"),
png_fixed(png_ptr, white_y / 2, "png_set_mDCV(white(y))"),
png_fixed(png_ptr, red_x / 2, "png_set_mDCV(red(x))"),
png_fixed(png_ptr, red_y / 2, "png_set_mDCV(red(y))"),
png_fixed(png_ptr, green_x / 2, "png_set_mDCV(green(x))"),
png_fixed(png_ptr, green_y / 2, "png_set_mDCV(green(y))"),
png_fixed(png_ptr, blue_x / 2, "png_set_mDCV(blue(x))"),
png_fixed(png_ptr, blue_y / 2, "png_set_mDCV(blue(y))"),
png_fixed(png_ptr, white_x, "png_set_mDCV(white(x))"),
png_fixed(png_ptr, white_y, "png_set_mDCV(white(y))"),
png_fixed(png_ptr, red_x, "png_set_mDCV(red(x))"),
png_fixed(png_ptr, red_y, "png_set_mDCV(red(y))"),
png_fixed(png_ptr, green_x, "png_set_mDCV(green(x))"),
png_fixed(png_ptr, green_y, "png_set_mDCV(green(y))"),
png_fixed(png_ptr, blue_x, "png_set_mDCV(blue(x))"),
png_fixed(png_ptr, blue_y, "png_set_mDCV(blue(y))"),
png_fixed_ITU(png_ptr, maxDL, "png_set_mDCV(maxDL)"),
png_fixed_ITU(png_ptr, minDL, "png_set_mDCV(minDL)"));
}

View File

@ -1,6 +1,6 @@
/* pngstruct.h - header file for PNG reference library
/* pngstruct.h - internal structures for libpng
*
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -10,11 +10,9 @@
* and license in png.h
*/
/* The structure that holds the information to read and write PNG files.
* The only people who need to care about what is inside of this are the
* people who will be modifying the library for their own special needs.
* It should NOT be accessed directly by an application.
*/
#ifndef PNGPRIV_H
# error This file must not be included by applications; please include <png.h>
#endif
#ifndef PNGSTRUCT_H
#define PNGSTRUCT_H

View File

@ -50,7 +50,7 @@
#define STDERR stdout
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_47 Your_png_h_is_not_version_1_6_47;
typedef png_libpng_version_1_6_48 Your_png_h_is_not_version_1_6_48;
/* Ensure that all version numbers in png.h are consistent with one another. */
#if (PNG_LIBPNG_VER != PNG_LIBPNG_VER_MAJOR * 10000 + \
@ -60,7 +60,7 @@ typedef png_libpng_version_1_6_47 Your_png_h_is_not_version_1_6_47;
PNG_LIBPNG_VER_MINOR) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_SONUM) || \
(PNG_LIBPNG_VER_SHAREDLIB != PNG_LIBPNG_VER_DLLNUM)
# error "Inconsistent version numbers in png.h"
# error Inconsistent version numbers in "png.h"
#endif
/* In version 1.6.1, we added support for the configure test harness, which
@ -103,10 +103,6 @@ typedef png_libpng_version_1_6_47 Your_png_h_is_not_version_1_6_47;
# define PNG_ZBUF_SIZE 8192
#endif
#ifndef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;
#endif
#ifndef PNG_DEBUG
# define PNG_DEBUG 0
#endif
@ -120,7 +116,7 @@ typedef FILE * png_FILE_p;
# define pngtest_debug1(m, p1) ((void)0)
# define pngtest_debug2(m, p1, p2) ((void)0)
#else /* PNG_DEBUG < 0 */
# error "Bad PNG_DEBUG value"
# error Bad PNG_DEBUG value
#endif
/* Turn on CPU timing
@ -403,7 +399,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, size_t length)
*/
io_ptr = png_get_io_ptr(png_ptr);
if (io_ptr != NULL)
check = fread(data, 1, length, (png_FILE_p)io_ptr);
check = fread(data, 1, length, (FILE *)io_ptr);
if (check != length)
png_error(png_ptr, "Read Error");
@ -437,7 +433,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, size_t length)
if (png_ptr == NULL)
png_error(png_ptr, "pngtest_write_data: bad png_ptr");
check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
check = fwrite(data, 1, length, (FILE *)png_get_io_ptr(png_ptr));
if (check != length)
png_error(png_ptr, "Write Error");
@ -858,8 +854,8 @@ pngtest_check_text_support(png_structp png_ptr, png_textp text_ptr,
static int
test_one_file(const char *inname, const char *outname)
{
static png_FILE_p fpin;
static png_FILE_p fpout; /* "static" prevents setjmp corruption */
static FILE *fpin;
static FILE *fpout; /* "static" prevents setjmp corruption */
pngtest_error_parameters error_parameters;
png_structp read_ptr;
png_infop read_info_ptr, end_info_ptr;

View File

@ -1,6 +1,6 @@
/* pngwio.c - functions for data output
*
* Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@ -54,7 +54,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, size_t length)
if (png_ptr == NULL)
return;
check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
check = fwrite(data, 1, length, (FILE *)png_ptr->io_ptr);
if (check != length)
png_error(png_ptr, "Write Error");
@ -77,12 +77,12 @@ png_flush(png_structrp png_ptr)
void PNGCBAPI
png_default_flush(png_structp png_ptr)
{
png_FILE_p io_ptr;
FILE *io_ptr;
if (png_ptr == NULL)
return;
io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr));
io_ptr = png_voidcast(FILE *, png_ptr->io_ptr);
fflush(io_ptr);
}
# endif

View File

@ -2380,7 +2380,7 @@ int PNGAPI
png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
const void *buffer, png_int_32 row_stride, const void *colormap)
{
/* Write the image to the given (FILE*). */
/* Write the image to the given FILE object. */
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
if (file != NULL && buffer != NULL)

View File

@ -1,6 +1,6 @@
/* pngwutil.c - utilities to write a PNG file
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.

View File

@ -23,7 +23,7 @@
#if PNG_POWERPC_VSX_OPT > 0
#ifndef __VSX__
# error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
# error This code requires VSX support (POWER7 and later); please compile with -mvsx
#endif
#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)

View File

@ -46,7 +46,7 @@ static int png_have_vsx(png_structp png_ptr);
#include PNG_POWERPC_VSX_FILE
#else /* PNG_POWERPC_VSX_FILE */
# error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
# error PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks
#endif /* PNG_POWERPC_VSX_FILE */
#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */

View File

@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.6.47
version=1.6.48
prefix=""
libdir=""
libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
Name: libpng
Description: Loads and saves PNG files
Version: 1.6.47
Version: 1.6.48
Libs: -L${libdir} -lpng16
Cflags: -I${includedir}

View File

@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
/* libpng version 1.6.47 */
/* libpng version 1.6.48 */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */