diff --git a/Source/LibTIFF4/CMakeLists.txt b/Source/LibTIFF4/CMakeLists.txt index 4b5047c..9c8024e 100644 --- a/Source/LibTIFF4/CMakeLists.txt +++ b/Source/LibTIFF4/CMakeLists.txt @@ -1,254 +1,270 @@ -# CMake build for libtiff -# -# Copyright © 2015 Open Microscopy Environment / University of Dundee -# Written by Roger Leigh -# -# Permission to use, copy, modify, distribute, and sell this software and -# its documentation for any purpose is hereby granted without fee, provided -# that (i) the above copyright notices and this permission notice appear in -# all copies of the software and related documentation, and (ii) the names of -# Sam Leffler and Silicon Graphics may not be used in any advertising or -# publicity relating to the software without the specific, prior written -# permission of Sam Leffler and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# -# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR -# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, -# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. - -# Generate headers -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h - @ONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h - @ONLY) - -set(tiff_public_HEADERS - tiff.h - tiffio.h - tiffvers.h - ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h) - -set(tiff_private_HEADERS - t4.h - tif_dir.h - tif_predict.h - tiffiop.h - uvcode.h - ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h) - - -add_library(tiff libtiff.def) -add_library(TIFF::TIFF ALIAS tiff) - -target_sources(tiff PRIVATE - ${tiff_public_HEADERS} - ${tiff_private_HEADERS} - tif_aux.c - tif_close.c - tif_codec.c - tif_color.c - tif_compress.c - tif_dir.c - tif_dirinfo.c - tif_dirread.c - tif_dirwrite.c - tif_dumpmode.c - tif_error.c - tif_extension.c - tif_fax3.c - tif_fax3sm.c - tif_flush.c - tif_getimage.c - tif_hash_set.c - tif_jbig.c - tif_jpeg.c - tif_jpeg_12.c - tif_lerc.c - tif_luv.c - tif_lzma.c - tif_lzw.c - tif_next.c - tif_ojpeg.c - tif_open.c - tif_packbits.c - tif_pixarlog.c - tif_predict.c - tif_print.c - tif_read.c - tif_strip.c - tif_swab.c - tif_thunder.c - tif_tile.c - tif_version.c - tif_warning.c - tif_webp.c - tif_write.c - tif_zip.c - tif_zstd.c) - -if(USE_WIN32_FILEIO) - target_sources(tiff PRIVATE tif_win32.c) -else() - target_sources(tiff PRIVATE tif_unix.c) -endif() - -target_include_directories(tiff - PUBLIC - $ - $ - PRIVATE - ${TIFF_INCLUDES} -) - -# MSVC specific resource preparation -if (WIN32 AND MSVC) - message(STATUS "Include resource version information for LibTIFF") - target_sources(tiff PRIVATE tif_win32_versioninfo.rc) - source_group("Resource Files" FILES tif_win32_versioninfo.rc) -endif () - - -set(tiff_libs_private_list "") # cmake list -set(tiff_requires_private "") # cmake string - -if(ZIP_SUPPORT) - target_link_libraries(tiff PRIVATE ZLIB::ZLIB) - string(APPEND tiff_requires_private " zlib") -endif() -if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) - target_link_libraries(tiff PRIVATE Deflate::Deflate) - list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") -endif() -if(JPEG_SUPPORT) - target_link_libraries(tiff PRIVATE JPEG::JPEG) - string(APPEND tiff_requires_private " libjpeg") - if(HAVE_JPEGTURBO_DUAL_MODE_8_12) - target_compile_definitions(tiff PRIVATE HAVE_JPEGTURBO_DUAL_MODE_8_12) - elseif(JPEG_DUAL_MODE_8_12) - target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR}) - target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES}) - endif() -endif() -if(JBIG_SUPPORT) - target_link_libraries(tiff PRIVATE JBIG::JBIG) - list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") -endif() -if(LERC_SUPPORT) - target_link_libraries(tiff PRIVATE LERC::LERC) - list(APPEND tiff_libs_private_list "${LERC_LIBRARY}") - if(NOT BUILD_SHARED_LIBS) - set_target_properties(tiff PROPERTIES COMPILE_DEFINITIONS LERC_STATIC) - endif() -endif() -if(LZMA_SUPPORT) - target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA) - string(APPEND tiff_requires_private " liblzma") -endif() -if(ZSTD_SUPPORT) - target_link_libraries(tiff PRIVATE ZSTD::ZSTD) - string(APPEND tiff_requires_private " libzstd") -endif() -if(WEBP_SUPPORT) - target_link_libraries(tiff PRIVATE WebP::WebP) - string(APPEND tiff_requires_private " libwebp") -endif() -if(CMath_LIBRARY) - target_link_libraries(tiff PRIVATE CMath::CMath) - list(APPEND tiff_libs_private_list "${CMath_LIBRARY}") -endif() - -set(tiff_libs_private_list "${tiff_libs_private_list}" PARENT_SCOPE) -set(tiff_requires_private "${tiff_requires_private}" PARENT_SCOPE) - -set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION}) -if(NOT CYGWIN) - # This property causes shared libraries on Linux to have the full version - # encoded into their final filename. We disable this on Cygwin because - # it causes cygz-${TIFF_FULL_VERSION}.dll to be created when cygz.dll - # seems to be the default. - set_target_properties(tiff PROPERTIES VERSION ${SO_VERSION}) -endif() -if(HAVE_LD_VERSION_SCRIPT) - set_target_properties(tiff PROPERTIES LINK_FLAGS - "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") -endif() - -if(tiff-install) - export(TARGETS tiff NAMESPACE TIFF:: FILE "${CMAKE_CURRENT_BINARY_DIR}/libtiffTargets.cmake") - install(TARGETS tiff EXPORT TiffTargets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - install(FILES ${tiff_public_HEADERS} - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") - - set(TIFF_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/tiff) - install(EXPORT TiffTargets - FILE TiffTargets.cmake - NAMESPACE TIFF:: - DESTINATION ${TIFF_CONFIGDIR} - ) -endif() - -if(CXX_SUPPORT) - set(tiffxx_HEADERS - tiffio.hxx) - - # No .def file for this library. - if (WIN32) - add_library(tiffxx STATIC ../placeholder.h) - else() - add_library(tiffxx ../placeholder.h) - endif() - - add_library(TIFF::CXX ALIAS tiffxx) - - target_sources(tiffxx PRIVATE - ${tiffxx_HEADERS} - tif_stream.cxx) - target_link_libraries(tiffxx tiff) - set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION}) - if(NOT CYGWIN) - # This property causes shared libraries on Linux to have the full version - # encoded into their final filename. We disable this on Cygwin because - # it causes cygz-${TIFF_FULL_VERSION}.dll to be created when cygz.dll - # seems to be the default. - set_target_properties(tiffxx PROPERTIES VERSION ${SO_VERSION}) - endif() - if(HAVE_LD_VERSION_SCRIPT) - set_target_properties(tiffxx PROPERTIES LINK_FLAGS - "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiffxx.map") - endif() - - if(tiff-install) - install(TARGETS tiffxx - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - install(FILES ${tiffxx_HEADERS} - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") - endif() - -endif() - -if(NOT CMAKE_CROSSCOMPILING) - add_executable(tiff_mkg3states ../placeholder.h) - target_sources(tiff_mkg3states PRIVATE mkg3states.c tif_fax3.h) - target_link_libraries(tiff_mkg3states tiff tiff_port) - - add_custom_target(tiff_faxtable - DEPENDS tiff_mkg3states - COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c" - COMMAND tiff_mkg3states -b -c const "tif_fax3sm.c" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") -endif() +# CMake build for libtiff +# +# Copyright © 2015 Open Microscopy Environment / University of Dundee +# Written by Roger Leigh +# +# Permission to use, copy, modify, distribute, and sell this software and +# its documentation for any purpose is hereby granted without fee, provided +# that (i) the above copyright notices and this permission notice appear in +# all copies of the software and related documentation, and (ii) the names of +# Sam Leffler and Silicon Graphics may not be used in any advertising or +# publicity relating to the software without the specific, prior written +# permission of Sam Leffler and Silicon Graphics. +# +# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +# +# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +# Generate headers +# and update configuration settings and package / version information. +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h + @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h + @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffvers.h.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/tiffvers.h + @ONLY) + +set(tiff_public_HEADERS + tiff.h + tiffio.h + ${CMAKE_CURRENT_BINARY_DIR}/tiffvers.h + ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h) + +set(tiff_private_HEADERS + t4.h + tif_dir.h + tif_predict.h + tiffiop.h + uvcode.h + ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h) + + +add_library(tiff libtiff.def) +add_library(TIFF::tiff ALIAS tiff) + +target_sources(tiff PRIVATE + ${tiff_public_HEADERS} + ${tiff_private_HEADERS} + tif_aux.c + tif_close.c + tif_codec.c + tif_color.c + tif_compress.c + tif_dir.c + tif_dirinfo.c + tif_dirread.c + tif_dirwrite.c + tif_dumpmode.c + tif_error.c + tif_extension.c + tif_fax3.c + tif_fax3sm.c + tif_flush.c + tif_getimage.c + tif_hash_set.c + tif_jbig.c + tif_jpeg.c + tif_jpeg_12.c + tif_lerc.c + tif_luv.c + tif_lzma.c + tif_lzw.c + tif_next.c + tif_ojpeg.c + tif_open.c + tif_packbits.c + tif_pixarlog.c + tif_predict.c + tif_print.c + tif_read.c + tif_strip.c + tif_swab.c + tif_thunder.c + tif_tile.c + tif_version.c + tif_warning.c + tif_webp.c + tif_write.c + tif_zip.c + tif_zstd.c) + +if(USE_WIN32_FILEIO) + target_sources(tiff PRIVATE tif_win32.c) +else() + target_sources(tiff PRIVATE tif_unix.c) +endif() + +target_include_directories(tiff + PUBLIC + $ + $ + $ + PRIVATE + ${TIFF_INCLUDES} +) + +# MSVC specific resource preparation +if (WIN32 AND MSVC) + message(STATUS "Include resource version information for LibTIFF") + target_sources(tiff PRIVATE tif_win32_versioninfo.rc) + source_group("Resource Files" FILES tif_win32_versioninfo.rc) +endif () + + +set(tiff_libs_private_list "") # cmake list +set(tiff_requires_private "") # cmake string + +if(ZIP_SUPPORT) + target_link_libraries(tiff PRIVATE ZLIB::ZLIB) + string(APPEND tiff_requires_private " zlib") +endif() +if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) + target_link_libraries(tiff PRIVATE Deflate::Deflate) + list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") +endif() +if(JPEG_SUPPORT) + target_link_libraries(tiff PRIVATE JPEG::JPEG) + string(APPEND tiff_requires_private " libjpeg") + if(HAVE_JPEGTURBO_DUAL_MODE_8_12) + target_compile_definitions(tiff PRIVATE HAVE_JPEGTURBO_DUAL_MODE_8_12) + elseif(JPEG_DUAL_MODE_8_12) + target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR}) + target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES}) + endif() +endif() +if(JBIG_SUPPORT) + target_link_libraries(tiff PRIVATE JBIG::JBIG) + list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") +endif() +if(LERC_SUPPORT) + target_link_libraries(tiff PRIVATE LERC::LERC) + list(APPEND tiff_libs_private_list "${LERC_LIBRARY}") + if(NOT BUILD_SHARED_LIBS) + set_target_properties(tiff PROPERTIES COMPILE_DEFINITIONS LERC_STATIC) + endif() +endif() +if(LZMA_SUPPORT) + target_link_libraries(tiff PRIVATE liblzma::liblzma) + string(APPEND tiff_requires_private " liblzma") +endif() +if(ZSTD_SUPPORT) + target_link_libraries(tiff PRIVATE ZSTD::ZSTD) + string(APPEND tiff_requires_private " libzstd") +endif() +if(WEBP_SUPPORT) + target_link_libraries(tiff PRIVATE WebP::webp) + string(APPEND tiff_requires_private " libwebp") +endif() +if(CMath_LIBRARY) + target_link_libraries(tiff PRIVATE CMath::CMath) + list(APPEND tiff_libs_private_list "${CMath_LIBRARY}") +endif() + +set(tiff_libs_private_list "${tiff_libs_private_list}" PARENT_SCOPE) +set(tiff_requires_private "${tiff_requires_private}" PARENT_SCOPE) + +set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION}) +if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version + # encoded into their final filename. We disable this on Cygwin because + # it causes cygz-${TIFF_FULL_VERSION}.dll to be created when cygz.dll + # seems to be the default. + set_target_properties(tiff PROPERTIES VERSION ${SO_VERSION}) +endif() +if(HAVE_LD_VERSION_SCRIPT) + set_target_properties(tiff PROPERTIES LINK_FLAGS + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiff.map") +endif() + +if(tiff-install) + export(TARGETS tiff NAMESPACE TIFF:: FILE "${CMAKE_CURRENT_BINARY_DIR}/libtiffTargets.cmake") + install(TARGETS tiff EXPORT TiffTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + install(FILES ${tiff_public_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + + set(TIFF_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/tiff) + install(EXPORT TiffTargets + FILE TiffTargets.cmake + NAMESPACE TIFF:: + DESTINATION ${TIFF_CONFIGDIR} + ) + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + TiffConfigVersion.cmake + VERSION ${LIBTIFF_VERSION} + COMPATIBILITY SameMajorVersion) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TiffConfigVersion.cmake DESTINATION ${TIFF_CONFIGDIR}) + + configure_file(${PROJECT_SOURCE_DIR}/cmake/TiffConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/TiffConfig.cmake @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TiffConfig.cmake DESTINATION ${TIFF_CONFIGDIR}) +endif() + +if(CXX_SUPPORT) + set(tiffxx_HEADERS + tiffio.hxx) + + # No .def file for this library. + if (WIN32) + add_library(tiffxx STATIC ../placeholder.h) + else() + add_library(tiffxx ../placeholder.h) + endif() + + add_library(TIFF::CXX ALIAS tiffxx) + + target_sources(tiffxx PRIVATE + ${tiffxx_HEADERS} + tif_stream.cxx) + target_link_libraries(tiffxx tiff) + set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION}) + if(NOT CYGWIN) + # This property causes shared libraries on Linux to have the full version + # encoded into their final filename. We disable this on Cygwin because + # it causes cygz-${TIFF_FULL_VERSION}.dll to be created when cygz.dll + # seems to be the default. + set_target_properties(tiffxx PROPERTIES VERSION ${SO_VERSION}) + endif() + if(HAVE_LD_VERSION_SCRIPT) + set_target_properties(tiffxx PROPERTIES LINK_FLAGS + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libtiffxx.map") + endif() + + if(tiff-install) + install(TARGETS tiffxx + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + + install(FILES ${tiffxx_HEADERS} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + endif() + +endif() + +if(NOT CMAKE_CROSSCOMPILING) + add_executable(tiff_mkg3states ../placeholder.h) + target_sources(tiff_mkg3states PRIVATE mkg3states.c tif_fax3.h) + target_link_libraries(tiff_mkg3states tiff tiff_port) + + add_custom_target(tiff_faxtable + DEPENDS tiff_mkg3states + COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c" + COMMAND tiff_mkg3states -b -c const "tif_fax3sm.c" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") +endif() diff --git a/Source/LibTIFF4/ChangeLog b/Source/LibTIFF4/ChangeLog index a6087db..a3c2261 100644 --- a/Source/LibTIFF4/ChangeLog +++ b/Source/LibTIFF4/ChangeLog @@ -1,3 +1,3836 @@ +2023-09-05 Even Rouault + + libtiff v4.6.0 released + +2023-09-05 Even Rouault + + Merge branch 'fix_600' into 'master' + CMake: fix build with -Dstrip-chopping=off (fixes #600) + + See merge request libtiff/libtiff!527 + +2023-09-05 Even Rouault + + Merge branch 'georgthegreat-master-patch-87447' into 'master' + Fix using __attribute__ libtiff with clang-for-windows + + See merge request libtiff/libtiff!525 + +2023-09-05 Yuriy Chernyshov + + Fix using __attribute__ libtiff with clang-for-windows. + +2023-09-05 Even Rouault + + Merge branch 'manpage_TIFFField_docu_update' into 'master' + manpages: TiffField functions documentation updated with return behaviour for... + + See merge request libtiff/libtiff!526 + +2023-09-05 Even Rouault + + CMake: fix build with -Dstrip-chopping=off (fixes #600) + +2023-09-03 Even Rouault + + Merge branch 'consistently_update_TIFF-version_from_configure-ac' into 'master' + Update CMake and autoconf scripts to consistently update LibTIFF version... + + See merge request libtiff/libtiff!456 + +2023-09-03 Su Laus + + Update CMake and autoconf scripts to consistently update LibTIFF version defines and references in various files when version definition in configure.ac has been changed. + - Move in tiffvers.h from .\libtiff source directory to .\libtiff build directory. + - Remove unused version information from tif_config.h + - With every CMake build the version defines (e.g. 4.5.1) within tiffvers.h are consistently updated from configure.ac. The version release-date is taken from file RELEASE-DATE. + - The files VERSION and RELEASE-DATE are only updated with a special CMake target build: cmake --build . --target tiff_release. + + - For autotools, version information is updated from configure.ac with ./autogen.sh. LIBTIFF_RELEASE_DATE is taken form file RELEASE-DATE. + - ./configure generates tiffvers.h with the cached version information and LIBTIFF_RELEASE_DATE. + - "make release" updates tiffvers.h and VERSION file with cached version info and RELEASE-DATE file and tiffves.h with the current date. + +2023-08-28 Su_Laus + + manpages: TiffField functions documentation updated with return behaviour for not defined tags and determination of write-/read-count size. + +2023-08-22 Even Rouault + + Merge branch 'change_long_to_int32_t_in_two_test_apps' into 'master' + Change "long" to "int32_t" in two test apps, because can be either int32_t or... + + See merge request libtiff/libtiff!524 + +2023-08-21 Su_Laus + + Change "long" to "int32_t" in two test apps, because can be either int32_t or int64_t, depending on compiler and system. + +2023-08-16 Even Rouault + + Merge branch 'CI_CMake_static_build' into 'master' + Add static build for CI/CD to run testcases which need private interface functions. + + See merge request libtiff/libtiff!521 + +2023-08-16 Even Rouault + + Merge branch 'fix_#597_tiffset_different_signedness' into 'master' + tiffset fix #597: warning: comparison of integer expressions of different signedness. + + Closes #597 + + See merge request libtiff/libtiff!523 + +2023-08-16 Even Rouault + + Merge branch 'tiffcp_remove_i_option' into 'master' + tiffcp: remove -i option (ignore errors) + + See merge request libtiff/libtiff!522 + +2023-08-16 Even Rouault + + Merge branch 'move_tools_to_unsupported_a_archive' into 'master' + Move most TIFF tools to archive and keep some as unsupported (see #580). + + See merge request libtiff/libtiff!520 + +2023-08-16 Su Laus + + Move most TIFF tools to archive and keep some as unsupported (see #580). + +2023-08-12 Su_Laus + + Add static build for CI/CD to run testcases which need private interface functions. + + tiffset fix #597: warning: comparison of integer expressions of different signedness. + + Remove -i option (ignore errors) from tiffcp, because almost all fuzzer issues were consequential errors from ignored errors because of the "-i" option. + +2023-08-11 Even Rouault + + Merge branch 'fix_585_test_write_read_tags_autoconf' into 'master' + Add missing test_write_read_tags.c and test_transferfunction_write_read.c in... + + Closes #585 + + See merge request libtiff/libtiff!519 + +2023-07-24 Even Rouault + + Fix copy paste error. + +2023-07-23 Su_Laus + + Add missing test_write_read_tags.c and test_transferfunction_write_read.c in tarball (fixes #585) and correct „long“ issue. + Don't use "long" because can be int32_t or int64_t, depending on compiler and system. + +2023-07-20 Even Rouault + + Merge branch 'clang-format-tools' into 'master' + Automatically format with clang-format + + See merge request libtiff/libtiff!518 + +2023-07-20 Timothy Lyanguzov + + Automatically format with clang-format. + +2023-07-20 Even Rouault + + Merge branch 'fix_589' into 'master' + TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and... + + Closes #589 + + See merge request libtiff/libtiff!514 + +2023-07-20 Even Rouault + + TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and... + +2023-07-19 Even Rouault + + Merge branch 'master-patch-6fc6' into 'master' + raw2tiff: fix integer overflow and bypass of the check (fixes #592) + + See merge request libtiff/libtiff!516 + +2023-07-19 Arie Haenel + + raw2tiff: fix integer overflow and bypass of the check (fixes #592) + +2023-07-19 Even Rouault + + Merge branch 'master-patch-05a4' into 'master' + tiffcp: fix memory corruption (overflow) on hostile images (fixes #591) + + See merge request libtiff/libtiff!515 + +2023-07-19 Arie Haenel + + tiffcp: fix memory corruption (overflow) on hostile images (fixes #591) + +2023-07-17 Even Rouault + + Merge branch 'fix-numtrunc' into 'master' + fix numtrunc at tiff_dirread.c + + See merge request libtiff/libtiff!512 + +2023-07-17 headshog + + TIFFReadDirectoryCheckOrder: avoid integer overflow. + When it occurs, it should be harmless in practice though + +2023-07-17 Even Rouault + + Merge branch 'webp_lossless_exact' into 'master' + WebP codec: turn exact mode when creating lossless files to avoid altering... + + See merge request libtiff/libtiff!511 + +2023-07-11 Even Rouault + + WebP codec: turn exact mode when creating lossless files to avoid altering R,G,B values in areas where alpha=0 + Fixes https://github.com/OSGeo/gdal/issues/8038 + +2023-07-05 Even Rouault + + Merge branch 'webp_reg_fix' into 'master' + WebP decoder: fix error when reading a 3-band blob in a RGBA image + + See merge request libtiff/libtiff!510 + +2023-07-05 Even Rouault + + WebP decoder: fix error when reading a 3-band blob in a RGBA image. + Fixes regression of 350ff161c8a61b6483a1e4689e09cd47dd0dd5f9 (master only) + +2023-06-26 Even Rouault + + Merge branch 'appveyor_fix' into 'master' + .appveyor.yml: workaround build error + + See merge request libtiff/libtiff!509 + +2023-06-26 Even Rouault + + .appveyor.yml: workaround build error. + +2023-06-26 Even Rouault + + Merge branch 'tif_webp_warning_fixes' into 'master' + tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit) + + See merge request libtiff/libtiff!508 + +2023-06-26 Even Rouault + + tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit) + +2023-06-26 Even Rouault + + Merge branch 'fix_TransferFunction_writing' into 'master' + Fix TransferFunction writing of only two transfer functions. + + See merge request libtiff/libtiff!502 + +2023-06-26 Even Rouault + + Merge branch 'fix_581_582' into 'master' + WebP decoder: validate WebP blob width, height, band count against TIFF parameters + + Closes #582 et #581 + + See merge request libtiff/libtiff!507 + +2023-06-19 Even Rouault + + Merge branch 'warning_cmake_config_file' into 'master' + v4.5.1 release note: add warning about CMake config file being preview + + See merge request libtiff/libtiff!506 + +2023-06-17 Even Rouault + + WebP decoder: validate WebP blob width, height, band count against TIFF parameters + to avoid use of uninitialized variable, or decoding corrupted content + without explicit error + + Fixes #581, fixes #582 + +2023-06-15 Even Rouault + + v4.5.1 release note: add warning about CMake config file being preview. + +2023-06-14 Even Rouault + + Merge branch 'HOWTO-RELEASE-gitlab-release' into 'master' + HOWTO-RELEASE: mention creating a gitlab release + + See merge request libtiff/libtiff!505 + +2023-06-14 Even Rouault + + HOWTO-RELEASE: mention creating a gitlab release. + +2023-06-10 Even Rouault + + Merge branch 'TIFFOpenWExt_O_RDWR' into 'master' + TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux + + See merge request libtiff/libtiff!504 + +2023-06-10 Even Rouault + + TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux + +2023-06-10 Even Rouault + + Merge branch 'fix_ossfuzz_59751' into 'master' + TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL + + See merge request libtiff/libtiff!503 + +2023-06-10 Even Rouault + + TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL. + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59751 + + In 738e0409 (refs #575), we disabled DNG / EP tags, but there was a + special proessing for TIFFTAG_EP_BATTERYLEVEL that must be disabled + since the tag is no longer defined. + +2023-06-09 Su_Laus + + Fix TransferFunction writing of only two transfer functions. The TIFFWriteDirectoryTagTransferfunction() function writes in some cases only two transfer functions, although only exactly one or exactly three transfer functions are allowed. This then leads to an error when reading. --> TIFFReadDirectory: Warning, Incorrect count for "TransferFunction"; tag ignored. + This MR corrects the behaviour of TIFFWriteDirectoryTagTransferfunction() accordingly. Furthermore, a possible buffer overflow is avoided. + +2023-06-09 Even Rouault + + Merge branch 'fix_win_build' into 'master' + Fix Windows build + + Closes #578 + + See merge request libtiff/libtiff!501 + +2023-06-09 Even Rouault + + cmake/PkgConfig.cmake: avoid CMake error when prefix or suffix is empty. + + Add tif_win32_versioninfo.rc and tif_tools_versioninfo.rc to EXTRA_DIST. + +2023-06-09 Even Rouault + + Merge branch 'fix_coverity_build' into 'master' + build/gitlab-ci: fix coverity_build() + + See merge request libtiff/libtiff!499 + +2023-06-09 Even Rouault + + build/gitlab-ci: fix coverity_build() + +2023-06-09 Even Rouault + + Merge branch 'v4.5.1rc1_preparation' into 'master' + Prepare release 4.5.1 + + See merge request libtiff/libtiff!498 + +2023-06-09 Even Rouault + + Prepare for v4.5.1 release. + + Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation' + +2023-06-09 Even Rouault + + Merge branch 'disable_dng_tags' into 'master' + tif_dirinfo.c: disable DNG 1.2->1.6 tags + + Closes #575 + + See merge request libtiff/libtiff!497 + +2023-06-09 Even Rouault + + Merge branch 'fix_577' into 'master' + CMake related fixes + + Closes #577 + + See merge request libtiff/libtiff!496 + +2023-06-09 Even Rouault + + libtiff v4.5.1 released + +2023-06-09 Even Rouault + + Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation' + +2023-06-09 Even Rouault + + Merge branch 'disable_dng_tags' into 'master' + tif_dirinfo.c: disable DNG 1.2->1.6 tags + + Closes #575 + + See merge request libtiff/libtiff!497 + +2023-06-09 Even Rouault + + Merge branch 'fix_577' into 'master' + CMake related fixes + + Closes #577 + + See merge request libtiff/libtiff!496 + +2023-06-07 Even Rouault + + tif_dirinfo.c: disable DNG 1.2->1.6 tags. + They were added per b90b20d36d7833f54a1f3014c324f6c21b988006 but it has + been found in https://gitlab.com/libtiff/libtiff/-/issues/575 that it + could cause compatibity issues with libtiff users, so this addition + should be defered for a feature release (likely 4.6.0) and not a patch one. + + Fixes #575 + +2023-06-06 Timothy Lyanguzov + + Apply 1 suggestion(s) to 1 file(s) + +2023-06-05 Even Rouault + + CI: add testing of find_package(Tiff CONFIG) + + CMake: export TiffConfig.cmake and TiffConfigVersion.cmake files. + + libtiff/CMakeLists.txt: fix export of INTERFACE_INCLUDE_DIRECTORIES. + + libtiff/CMakeLists.txt: correctly define TIFF::tiff alias (fixes #577) + +2023-06-05 Even Rouault + + Merge branch 'TIFFField_downgrade_errors_to_warnings' into 'master' + TIFFFieldWithName() and TIFFFieldWithTag() downgrade errors to warnings. + + See merge request libtiff/libtiff!495 + +2023-05-28 Su_Laus + + TIFFFieldWithName() and TIFFFieldWithTag() downgrade errors to warnings. see https://gitlab.com/libtiff/libtiff/-/issues/575#note_1407633888 + +2023-05-25 Even Rouault + + Merge branch 'bebuch-master-patch-58347' into 'master' + check if upstream lzma (xz) config was used and bind to it if so + + See merge request libtiff/libtiff!494 + +2023-05-25 Benjamin Buch + + check if upstream lzma (xz) config was used and bind to it if so. + +2023-05-25 Even Rouault + + Merge branch 'upstream-zstd-config' into 'master' + check if upstream zstd config was used and bind to it if so + + See merge request libtiff/libtiff!493 + +2023-05-25 Even Rouault + + Merge branch 'cmake_FindDeflate_bugs_see_526' into 'master' + CMake: FindDeflate several errors fixed (see #526) + + See merge request libtiff/libtiff!491 + +2023-05-24 Su_Laus + + CMake: FindDeflate several errors (see #526) + There are CMake issues if the library is not included in the environment path and only set with CMake -D option. + - For FindDeflate.cmake, FindJBIG.cmake, FindLERC.cmake, FindWebP.cmake, FindZSTD.cmake: + Set IMPORTED_LOCATION (without debug or release) if neither _LIBRARY_RELEASE nor _LIBRARY_DEBUG were set. + - FindDeflate.cmake: Correct code to retrieve library version information from libdeflate.h + - FindLERC.cmake version string return added. + +2023-05-24 Benjamin Buch + + prefer shared over static. + + check if upstream zstd config was used and bind to it if so. + +2023-05-24 Even Rouault + + Merge branch 'master' into 'master' + make WebP component name compatible with upstream ConfigWebP.cmake + + See merge request libtiff/libtiff!492 + +2023-05-24 Benjamin Buch + + CMake: make WebP component name compatible with upstream ConfigWebP.cmake + +2023-05-18 Su_Laus + + Prepare release 4.5.1 - Update till 18.05.23 after fix_559_DNG_1.6_passcount_error + + Prepare release 4.5.1. + +2023-05-18 Even Rouault + + Merge branch 'fix_559_DNG_1.6_passcount_error' into 'master' + Fix #559 DNG 1.6 passcount assertion + + Closes #574 et #559 + + See merge request libtiff/libtiff!489 + +2023-05-18 Even Rouault + + Merge branch 'fix_557_TagExtender_for_CustomDirectories_not_possible' into 'master' + manpage: TIFFSetTagExtender() cannot add tags to custom directories. Closes #557. + + Closes #557 + + See merge request libtiff/libtiff!490 + +2023-05-18 Even Rouault + + Merge branch 'fix_559_DNG_1.6_passcount_error' into 'master' + Fix #559 DNG 1.6 passcount assertion + + Closes #574 et #559 + + See merge request libtiff/libtiff!489 + +2023-05-18 Even Rouault + + Merge branch 'fix_557_TagExtender_for_CustomDirectories_not_possible' into 'master' + manpage: TIFFSetTagExtender() cannot add tags to custom directories. Closes #557. + + Closes #557 + + See merge request libtiff/libtiff!490 + +2023-05-17 Su_Laus + + Documentation update: TIFFSetTagExtender() cannot add tags to custom directories. + Closes #557. + +2023-05-16 Even Rouault + + Merge branch 'fix_558' into 'master' + Hardcode HOST_FILLORDER to FILLORDER_LSB2MSB, and make 'H' flag of TIFFOpen()... + + See merge request libtiff/libtiff!488 + +2023-05-16 Su_Laus + + Fix #559 DNG 1.6 passcount assertion. + Amend DNG tags definition introduced with MR 482: + - DNG 1.6 tags specified as UTF-8 strings are defined as variable TIFF_BYTE with passcount=TRUE. + - For all tags with TIFF_SETGET_C32_UINT8 the readcount and writecount were corrected to -3 (TIFF_VARIABLE2). + + Testprogram to write and read all tags defined within LibTIFF is introduced. + It also checks for valid passcount flag setting for the defined tags but some special tags are excluded from that check. + + Closes #559. + +2023-05-09 Even Rouault + + Hardcode HOST_FILLORDER to FILLORDER_LSB2MSB, and make 'H' flag of TIFFOpen() to warn and an alias of FILLORDER_MSB2LSB + + tif_lerc.c: use WORDS_BIGENDIAN instead of HOST_BIGENDIAN. + +2023-05-07 Even Rouault + + Merge branch 'fix_484_TIFFDirectory_32_64_bit' into 'master' + Fix 484 TIFFDirectory td_fieldsset uses unsigned long which can be 32 or 64 bits. + + Closes #484 + + See merge request libtiff/libtiff!471 + +2023-05-07 Even Rouault + + Merge branch 'DNG_1.6_EP_tags' into 'master' + Add DNG tags up to version 1.6.0.0 and some TIFF/EP tags and update documentation + + See merge request libtiff/libtiff!482 + +2023-05-07 Even Rouault + + Merge branch 'issue547' into 'master' + do not install libtiff-4.pc when tiff-install is reset + + Closes #547 + + See merge request libtiff/libtiff!481 + +2023-05-06 Even Rouault + + Merge branch 'fix_548' into 'master' + LZWDecode(): avoid crash when trying to read again from a strip whith a... + + Closes #548 + + See merge request libtiff/libtiff!484 + +2023-05-06 Even Rouault + + Merge branch 'tiffcrop_fix_553_multi-image-errors' into 'master' + tiffcrop: fix 553 by considering error return of writeSelections() + + Closes #553 + + See merge request libtiff/libtiff!485 + +2023-05-06 Even Rouault + + Merge branch 'tif_ojpeg_fix-554_FPE' into 'master' + tif_ojpeg.c fix 554 by checking for division by zero + + Closes #554 + + See merge request libtiff/libtiff!486 + +2023-05-06 Su Laus + + tif_ojpeg.c fix 554 by checking for division by zero. + +2023-05-05 Su_Laus + + Consider error return of writeSelections(). Fixes #553. + +2023-04-29 Even Rouault + + LZWDecode(): avoid crash when trying to read again from a strip whith a missing end-of-information marker (fixes #548) + +2023-04-25 Su_Laus + + Add DNG tags up to version 1.6.0.0 and some TIFF/EP tags and update documentation + Amend MR !337 'Add support for DNG tags up to version 1.6.0.0 and some TIFF/EP tags' from Sami Liedes: + - Set most tags to OkToChange=1. + - Define BATTERYLEVEL tag as ASCII and convert values of rational variant to ASCII. + - TIFF documentation updated for tags recognized by LibTiff (DNG 1.6 and others). + - TIFF/EP tags added, which are equivalent to EXIF tags. This addresses part of #418 as well. + - Definition of tags reformatted (clang-format off) for better readability of tag comments in tiff.h and tif_dirinfo.c + +2023-04-23 Roman + + do not install libtiff-4.pc when tiff-install is reset. + +2023-04-21 Even Rouault + + Merge branch 'mymaster1' into 'master' + fix runtime error: applying zero offset to null pointer + + See merge request libtiff/libtiff!479 + +2023-04-21 xiaoxiaoafeifei + + countInkNamesString(): fix `UndefinedBehaviorSanitizer`: applying zero offset to null pointer + +2023-03-26 Even Rouault + + Merge branch 'tif_ovrcache_TIFFSetSubDirectory' into 'master' + tif_ovrcache.c: check TIFFSetSubDirectory() return value (CID 1524573) + + See merge request libtiff/libtiff!478 + +2023-03-26 Even Rouault + + tif_ovrcache.c: check TIFFSetSubDirectory() return value (CID 1524573) + +2023-03-26 Even Rouault + + Merge branch 'even_faster_setdirectory_with_IFDlist' into 'master' + Even faster TIFFSetDirectory() using IFD list. + + See merge request libtiff/libtiff!477 + +2023-03-26 Su Laus + + Even faster TIFFSetDirectory() using IFD list. + +2023-03-12 Even Rouault + + Merge branch 'faster-setdirectory_newMR' into 'master' + Optimize relative seeking with TIFFSetDirectory + + See merge request libtiff/libtiff!474 + +2023-03-12 Su Laus + + Optimize relative seeking with TIFFSetDirectory. + +2023-03-11 Even Rouault + + Merge branch 'master' into 'master' + Fix memory leak in tiffcrop.c + + See merge request libtiff/libtiff!475 + +2023-03-08 zhailiangliang + + Fix memory leak in tiffcrop.c. + +2023-02-23 Even Rouault + + Merge branch 'skip-thumbnail-test' into 'master' + test: avoid running tool tests if not built + + Closes #421 + + See merge request libtiff/libtiff!334 + +2023-02-22 Sam James + + test (cmake): skip script tests if tools aren't built. + In Gentoo, we avoid building the tools for multilib (32-bit, x86) builds on + amd64/x86_64 because we only need the library to keep binary applications working. + + This causes a test failure in e.g. tiffcp-thumbnail.sh as the 'thumbnail' + binary isn't built. Skip it if unavailable. + + Fixes: https://gitlab.com/libtiff/libtiff/-/issues/421 + +2023-02-22 Sam James + + test (autotools): skip script tests if tools aren't built. + In Gentoo, we avoid building the tools for multilib (32-bit, x86) builds on + amd64/x86_64 because we only need the library to keep binary applications working. + + This causes a test failure in e.g. tiffcp-thumbnail.sh as the 'thumbnail' + binary isn't built. Skip it if unavailable. + + Fixes: https://gitlab.com/libtiff/libtiff/-/issues/421 + +2023-02-16 Even Rouault + + Merge branch 'fix_Unlink_first_directory_0' into 'master' + Fix TIFFUnlinkDirectory(0) case and unlink of first directory. + + See merge request libtiff/libtiff!460 + +2023-02-16 Even Rouault + + Merge branch 'tif_luv_check_NaN_fix_#530' into 'master' + tif_luv: Check and correct for NaN data in uv_encode(). + + Closes #530 + + See merge request libtiff/libtiff!473 + +2023-02-16 Su_Laus + + tif_luv: Check and correct for NaN data in uv_encode(). + Closes #530 + + See merge request !473 + +2023-02-14 Even Rouault + + Merge branch 'tiffcrop_dont_reuse_input_buffer_fix_527' into 'master' + tiffcrop: Do not reuse input buffer for subsequent images. Fix issue 527 + + Closes #527 + + See merge request libtiff/libtiff!472 + +2023-02-14 Su_Laus + + tiffcrop: Do not reuse input buffer for subsequent images. Fix issue 527 + Reuse of read_buff within loadImage() from previous image is quite unsafe, because other functions (like rotateImage() etc.) reallocate that buffer with different size without updating the local prev_readsize value. + + Closes #527 + +2023-02-08 Su_Laus + + Fix 484 TIFFDirectory td_fieldsset uses unsigned long which can be 32 or 64 bits. + Closes #484 + +2023-02-08 Even Rouault + + Merge branch 'test_ifd_loop_detection_fix_CoverityScan_ln_55' into 'master' + test_ifd_loop_detection: fix Coverity Scan issue CID 1520750: Null pointer... + + See merge request libtiff/libtiff!470 + +2023-02-08 Su_Laus + + test_ifd_loop_detection: fix Coverity Scan issue CID 1520750: Null pointer dereferences (NULL_RETURNS) line 55. + +2023-02-06 Even Rouault + + Merge branch 'tiffcrop_fix_CoverityScan_line_9676' into 'master' + Fix Coverity Scan issue CID 1520761: Integer handling issues... + + See merge request libtiff/libtiff!469 + +2023-02-06 Su_Laus + + Fix Coverity Scan issue CID 1520761: Integer handling issues (OVERFLOW_BEFORE_WIDEN) tiffcrop.c: 9676 in rotateImage() + +2023-02-05 Even Rouault + + Merge branch 'tiffcrop_R270_fix#492' into 'master' + tiffcrop: Amend rotateImage() not to toggle the input (main) image width and... + + Closes #519, #518, #499, #495, #494, #493 et #492 + + See merge request libtiff/libtiff!465 + +2023-02-05 Su_Laus + + tiffcrop: Amend rotateImage() not to toggle the input (main) image width and length parameters when only cropped image sections are rotated. Remove buffptr from region structure because never used. + Closes #492 #493 #494 #495 #499 #518 #519 + +2023-02-05 Even Rouault + + Merge branch 'tiffcrop_correctly_update_buffersize_after_rotate_fix#520' into 'master' + tiffcrop correctly update buffersize after rotateImage() fix#520 + + Closes #520 + + See merge request libtiff/libtiff!467 + +2023-02-05 Even Rouault + + Merge branch 'tiffcrop_composite_image_assumption_test_fix#496' into 'master' + tiffcrop: added check for assumption on composite images (fixes #496) + + Closes #501, #500, #498, #497 et #496 + + See merge request libtiff/libtiff!466 + +2023-02-05 Su Laus + + tiffcrop: added check for assumption on composite images (fixes #496) + tiffcrop: For composite images with more than one region, the combined_length or combined_width always needs to be equal, respectively. Otherwise, even the first section/region copy action might cause buffer overrun. This is now checked before the first copy action. + + Closes #496, #497, #498, #500, #501. + +2023-02-04 Su_Laus + + tiffcrop correctly update buffersize after rotateImage() fix#520 -- enlarge buffsize and check integer overflow within rotateImage(). + +2023-02-04 Even Rouault + + Merge branch 'test_subidf_loop' into 'master' + test_ifd_loop_detection: Added test to check loops in SubIFDs that are chained. + + See merge request libtiff/libtiff!464 + +2023-02-04 Su Laus + + test_ifd_loop_detection: Added test to check loops in SubIFDs that are chained. + +2023-02-04 Su_Laus + + Fix TIFFUnlinkDirectory(0) case and unlink of first directory. + If directory number 0 is unlinked, then the base offset variables within LibTiff are not updated. As a result, a subsequent TIFFSetDirectory() first goes to the unlinked former directory number 0. + + In addition, the error case for dirn=0 is handled. + + This MR fixes that by updating the base offset variables tif->tif_header.classic.tiff_diroff and tif->tif_header.big.tiff_diroff. + +2023-02-03 Even Rouault + + Merge branch 'TiffClose_NULL_ptr_dereferencing_fix_515' into 'master' + TIFFClose() avoid NULL pointer dereferencing. fix#515 + + Closes #515 + + See merge request libtiff/libtiff!468 + +2023-02-03 Su_Laus + + TIFFClose() avoid NULL pointer dereferencing. fix#515. + Closes #515 + + tiffcrop correctly update buffersize after rotateImage() fix#520 rotateImage() set up a new buffer and calculates its size individually. Therefore, seg_buffs[] size needs to be updated accordingly. Before this fix, the seg_buffs buffer size was calculated with a different formula than within rotateImage(). + Closes #520. + +2023-01-25 Even Rouault + + Merge branch 'add_windows_DLL_versioninfo' into 'master' + Add versioninfo resource files for DLL and tools compiled with Windows MSVC and MINGW. + + See merge request libtiff/libtiff!455 + +2023-01-25 Su Laus + + Add versioninfo resource files for DLL and tools compiled with Windows MSVC and MINGW. + +2023-01-22 Even Rouault + + Merge branch 'tif_hash_set_order_include' into 'master' + tif_hash_set.c: include tif_hash_set.h after tif_config.h to let a chance for... + + See merge request libtiff/libtiff!462 + +2023-01-22 Even Rouault + + tif_hash_set.c: include tif_hash_set.h after tif_config.h to let a chance for GDAL symbol renaming trick + +2023-01-22 Even Rouault + + Merge branch 'fix_513' into 'master' + Fax3: fix failure to decode some fax3 images (fixes #513) + + Closes #513 + + See merge request libtiff/libtiff!461 + +2023-01-21 Even Rouault + + Add test for Fax3 decoding issues (refs #513) + +2023-01-21 Even Rouault + + Merge branch 'tiffcrop_fix_#488' into 'master' + tiffcrop: Correct simple copy paste error. Fix #488. + + Closes #488 + + See merge request libtiff/libtiff!459 + +2023-01-21 Su Laus + + tiffcrop: Correct simple copy paste error. Fix #488. + +2023-01-21 Even Rouault + + Fax3: fix failure to decode some fax3 images (fixes #513) + Patch by @jsummers26 + +2023-01-12 Even Rouault + + Merge branch 'tiffmedian_fix_#477' into 'master' + tiffmedian: avoid zero num_colors, fixes #477 + + Closes #477 + + See merge request libtiff/libtiff!458 + +2023-01-12 Even Rouault + + Merge branch 'fax2ps_fixes_#475' into 'master' + fax2ps: fixes #475 buffer overflow in qsort function pcompar. + + Closes #475 + + See merge request libtiff/libtiff!457 + +2023-01-12 Su_Laus + + tiffmedian: avoid zero num_colors, fixes #477. + + fax2ps: fixes #475 buffer overflow in qsort function pcompar. + +2023-01-09 Even Rouault + + Merge branch 'fix_241_tiffset_file_size_limit' into 'master' + tiffset: get filesize to allocate only the required memory. Fixes issue #241 + + Closes #241 + + See merge request libtiff/libtiff!451 + +2023-01-09 Su Laus + + tiffset: get filesize to allocate only the required memory. Fixes issue #241 + +2023-01-09 Even Rouault + + Merge branch '_TIFFCleanupIFDOffsetAndNumberMaps' into 'master' + Add _TIFFCleanupIFDOffsetAndNumberMaps() and call it from TIFFUnlinkDirectory() + + See merge request libtiff/libtiff!454 + +2023-01-06 Even Rouault + + Remove use of tif_dirnumber. + + TIFFSetSubDirectory(): call _TIFFCleanupIFDOffsetAndNumberMaps() + + struct tiff: remove unused tif_dirlistoff. + + TIFFUnlinkDirectory(): reset tif_dirnumber. + + Add _TIFFCleanupIFDOffsetAndNumberMaps() and call it from TIFFUnlinkDirectory() + +2022-12-29 Even Rouault + + Merge branch 'cmake_in_files_formatting_sensitive' into 'master' + Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in... + + See merge request libtiff/libtiff!452 + +2022-12-28 Su_Laus + + Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in because sensitive for CMake scripts. - explanation added + +2022-12-26 Su_Laus + + Disable clang-formatting for tif_config.h.cmake.in and tiffconf.h.cmake.in because sensitive for CMake scripts. + +2022-12-19 Even Rouault + + Merge branch 'manpage_multi-page-TIFF' into 'master' + manpage: Add multi page TIFF and SubIFDs description and read / write example. + + See merge request libtiff/libtiff!450 + +2022-12-19 Su Laus + + manpage: Add multi page TIFF and SubIFDs description and read / write example. + +2022-12-18 Even Rouault + + Merge branch 'TIFFOpen_r+_windows_behaviour' into 'master' + Behavior of TIFFOpen() mode "r+" in the Windows implementation adjusted to that of Linux. + + See merge request libtiff/libtiff!449 + +2022-12-16 Su_Laus + + Behavior of TIFFOpen() mode "r+" in the Windows implementation adjusted to that of Linux. + +2022-12-15 Even Rouault + + Merge branch 'ossfuzz_54343' into 'master' + TIFFSetDirectory: avoid harmless unsigned-integer-overflow + + See merge request libtiff/libtiff!447 + +2022-12-15 Even Rouault + + TIFFSetDirectory: avoid harmless unsigned-integer-overflow. + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54343 + +2022-12-14 Even Rouault + + Merge branch 'ossfuzz_54311' into 'master' + TIFFWriteDirectorySec(): avoid harmless unsigned-integer-overflow + + See merge request libtiff/libtiff!446 + +2022-12-14 Even Rouault + + TIFFWriteDirectorySec(): avoid harmless unsigned-integer-overflow. + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54311 + +2022-12-14 Even Rouault + + libtiff v4.5.0rc2 preparation + +2022-12-14 Su_Laus + + tiffinfo: update curdir from uint16_t to tdir_t for more than 64k IFD handling. + +2022-12-13 Even Rouault + + Merge branch 'fix_502' into 'master' + Make TIFFSetDirectory(tiff, 65534) work again (fixes #502) + + Closes #502 + + See merge request libtiff/libtiff!436 + +2022-12-13 Even Rouault + + Add tests for IFD loop detection. + + Fix IFD loop detection. + + Use UINT_MAX. + + Make TIFF_MAX_DIR_COUNT a autoconf/CMake setting. + +2022-12-13 Even Rouault + + Merge branch 'build-shared-by-default' into 'master' + Restore shared libraries by default + + See merge request libtiff/libtiff!437 + +2022-12-13 shaun walbridge + + CMake: restore shared libraries by default for top-level build. + +2022-12-12 Even Rouault + + Add a TIFF_MAX_DIR_COUNT public #define. + + TIFFCurrentDirectory(), TIFFNumberOfDirectories(), TIFFSetDirectory(), TIFFUnlinkDirectory(): use tdir_t that is now a uint32_t, and raise limit of IFDs to 1048576 + + IFD loop checking: use hashmap to avoid quadratic performance. + + Add a hashset/hashmap implementation (ported from GDAL's CPLHashSet) + + Make TIFFSetDirectory(tiff, 65534) work again (fixes #502) + +2022-12-11 Even Rouault + + Merge branch 'do_not_format_tiffvers_h' into 'master' + Revert formatting of tiffvers.h and add TIFFLIB_MAJOR_VERSION, TIFFLIB_MINOR_VERSION, TIFFLIB_MICRO_VERSION defines + + See merge request libtiff/libtiff!434 + +2022-12-11 Even Rouault + + Merge branch 'tiffcrop_exclude_some_comment_from_clang-format' into 'master' + tiffcrop: Exclude some comments from clang-format + + See merge request libtiff/libtiff!435 + +2022-12-11 Su Laus + + tiffcrop: Exclude some comments from clang-format. + +2022-12-11 Even Rouault + + tiffvers.h.in: add clang-format off/on. + +2022-12-10 Even Rouault + + tiffvers.h: add TIFFLIB_MAJOR_VERSION, TIFFLIB_MINOR_VERSION, TIFFLIB_MICRO_VERSION defines + Also add a TIFFLIB_AT_LEAST() macro + + tiffvers.h: revert formatting. + + Exclude reformatting of tiffvers.h which breaks version detection for FindTIFF.cmake + +2022-12-09 Even Rouault + + Merge branch 'release_4_5_0' into 'master' + Prepare v4.5.0 release + + See merge request libtiff/libtiff!433 + +2022-12-09 Even Rouault + + libtiff v4.5.0rc1 preparation + +2022-12-08 Even Rouault + + Merge branch 'reformat' into 'master' + Whole code-base reformatting + + See merge request libtiff/libtiff!431 + +2022-12-08 Even Rouault + + Add .git-blame-ignore-revs. + + tiffcrop: remove version_id and rev_date. + +2022-12-08 pre-commit run by Even Rouault + + Reformatting in all other directories using 'pre-commit run' + + Reformatting in test/ using 'pre-commit run' + + Reformatting in tools/ using 'pre-commit run' + + Reformatting in libtiff/ using 'pre-commit run' + +2022-12-08 Even Rouault + + Add .clang-format, .pre-commit-config.yaml and CONTRIBUTING.md. + + Remove vim/emacs formatting footers. + +2022-11-29 Even Rouault + + Merge branch 'fix_489' into 'master' + TIFFWriteRawStrip(): restore capabilities to append data in the current strip (fixes #489) + + Closes #489 + + See merge request libtiff/libtiff!430 + +2022-11-29 Even Rouault + + Add test case for scenario of issue #489. + + TIFFWriteRawStrip(): restore capabilities to append data in the current strip (fixes #489) + This fixes a regression of libtiff 4.4.0 + +2022-11-29 Even Rouault + + Merge branch 'manpage_re-entrant_error_handler' into 'master' + manpage update for re-entrant error handler TIFFErrorExtR(), TIFFOpenExt() and... + + See merge request libtiff/libtiff!427 + +2022-11-29 Su Laus + + manpage update for re-entrant error handler TIFFErrorExtR(), TIFFOpenExt() and... + +2022-11-27 Even Rouault + + Merge branch 'tiffcrop_fix_#169' into 'master' + tiffcrop: Add check if (bps != 1) in writeSingleSection() for... + + Closes #169 + + See merge request libtiff/libtiff!429 + +2022-11-27 Su Laus + + tiffcrop: Add check if (bps != 1) in writeSingleSection() for... + +2022-11-26 Even Rouault + + Merge branch 'TIFFErrorExtR_fix_missing_calls' into 'master' + TIFFErrorExt() was not replaced with TIFFErrorExtR() everywhere in libtiff.... + + See merge request libtiff/libtiff!428 + +2022-11-26 Su Laus + + TIFFErrorExt() was not replaced with TIFFErrorExtR() everywhere in libtiff.... + +2022-11-25 Even Rouault + + Merge branch 'tif_jpeg_build_fix' into 'master' + tif_jpeg.c: fix compilation with MSVC (fixes commit 0fd1a81d3547acb8f5be50bbbc3e44bde01c014b) + + See merge request libtiff/libtiff!426 + +2022-11-25 Even Rouault + + tif_jpeg.c: fix compilation with MSVC (fixes commit 0fd1a81d3547acb8f5be50bbbc3e44bde01c014b) + +2022-11-25 Even Rouault + + Merge branch 'fix_0fd1a81d3547acb8f5be50bbbc3e44bde01c014b' into 'master' + JPEGEncode(): fix wrong pointer data type with libjpeg-turbo 2.2dev in 12-bit mode + + See merge request libtiff/libtiff!425 + +2022-11-25 Even Rouault + + JPEGEncode(): fix wrong pointer data type with libjpeg-turbo 2.2dev in 12-bit mode + (fixes commit 0fd1a81d3547acb8f5be50bbbc3e44bde01c014b) + +2022-11-25 Even Rouault + + Merge branch 'libjpegturbo_dual' into 'master' + Add support for libjpeg-turbo 2.2-dev 8/12 bit dual mode + + See merge request libtiff/libtiff!422 + +2022-11-25 Even Rouault + + Add support for libjpeg-turbo 2.2-dev 8/12 bit dual mode. + +2022-11-23 Even Rouault + + Merge branch 'windows-fix' into 'master' + libtiff: Fix TIFFOpen* for the Windows platform in tif_unix.c + + See merge request libtiff/libtiff!424 + +2022-11-23 Francois Bleibel + + libtiff: Fix TIFFOpen* for the Windows platform in tif_unix.c. + I'm not sure where this change was made, but it must have been in a recent update. TIFFOpenWEx is now TIFFOpenWExt, and _TIFFgetMode takes additional arguments. + + Verified: Tested libtiff on a local Windows build. + +2022-11-23 Even Rouault + + Merge branch 'tiffcrop_signed_vs_unsigned' into 'master' + tiffcrop.c: fix warning about signed vs unsigned comparison + + See merge request libtiff/libtiff!423 + +2022-11-23 Even Rouault + + tiffcrop.c: fix warning about signed vs unsigned comparison. + +2022-11-23 Even Rouault + + Merge branch 'TIFFClientOpenExt_warning_fix' into 'master' + TIFFClientOpenExt(): fix warning on 32-bit platforms (master only) + + See merge request libtiff/libtiff!421 + +2022-11-23 Even Rouault + + TIFFClientOpenExt(): fix warning on 32-bit platforms (master only) + +2022-11-23 Even Rouault + + Merge branch 'tiffcp_TIFFOpenOptionsFree_memleak_fix' into 'master' + tiffcp: fix leak of TIFFOpenOptionsAlloc() introduced in latest commit (master only) + + See merge request libtiff/libtiff!420 + +2022-11-23 Even Rouault + + tiffcp: fix leak of TIFFOpenOptionsAlloc() introduced in latest commit (master only) + Fixes Coverity CID 1517032 + +2022-11-23 Even Rouault + + Merge branch 'TIFFOpenOptionsSetMaxSingleMemAlloc' into 'master' + Add TIFFOpenOptionsSetMaxSingleMemAlloc() to define a limit in bytes for a single memory allocation done by libtiff + + See merge request libtiff/libtiff!419 + +2022-11-23 Even Rouault + + Emit explicit error message when tif_max_single_mem_alloc is exceeded. + + test_open_options: test TIFFOpenOptionsSetMaxSingleMemAlloc() + + Rename test_error_handlers to test_open_options. + + tiffinfo, tiffcp, tiffcrop, tiffsplit, tiff2rgba, tiff2ps: use TIFFOpenOptionsSetMaxSingleMemAlloc() + + Convert uses of _TIFFmalloc/realloc/calloc/free to the Ext functions. + +2022-11-22 Even Rouault + + Add TIFFOpenOptionsSetMaxSingleMemAlloc() + to define a limit in bytes for a single memory allocation done by libtiff. + + Also add internal functions used in replacement of the non Ext ones: + void* _TIFFmallocExt(TIFF* tif, tmsize_t s); + void* _TIFFcallocExt(TIFF* tif, tmsize_t nmemb, tmsize_t siz); + void* _TIFFreallocExt(TIFF* tif, void* p, tmsize_t s); + void _TIFFfreeExt(TIFF* tif, void* p); + +2022-11-22 Even Rouault + + Merge branch 'TIFFOpenEx' into 'master' + Add TIFFOpenExt(), TIFFOpenWExt() and TIFFFdOpenExt() with re-entrant error handlers + + See merge request libtiff/libtiff!413 + +2022-11-21 Even Rouault + + Remove TIFFSetErrorHandlerExtR() and TIFFSetWarningHandlerExtR() that were temporarily added in master + + Add a _TIFFErrorEarly() function to be able to use the re-entrant error handler, even before TIFF* is valid + + Rework TIFFOpenExt() and similar to use an opaque TIFFOpenOptions* opts argument, with alloc, free and setters + + Document TIFFOpenExt, TIFFOpenWExt, TIFFFdOpenExt, TIFFClientOpenExt, TIFFSetErrorHandlerExtR, TIFFSetWarningHandlerExtR + +2022-11-21 Even Rouault + + Add TIFFOpenExt(), TIFFOpenWExt() and TIFFFdOpenExt() with re-entrant error handlers + Rename TIFFClientOpenEx() to TIFFClientOpenExt() + + Rework signature of the re-entrant error handlers and of + TIFFSetWarningHandlerExt() and TIFFSetErrorHandlerExt() + + Use structures that can be extended as extra argument. + + Leverages and ammends https://gitlab.com/libtiff/libtiff/-/merge_requests/409 + +2022-11-21 Even Rouault + + Merge branch 'manpage_fix485_file-descriptor_clientdata' into 'master' + manpage: Correct description of file handle/descriptors tif_fd and tif_clientdata. Closes #485. + + Closes #485 + + See merge request libtiff/libtiff!418 + +2022-11-21 Su Laus + + manpage: Correct description of file handle/descriptors tif_fd and tif_clientdata. Closes #485. + +2022-11-20 Even Rouault + + Merge branch 'manpage_fix440_fix28_TIFFOpen_SubIFD_update' into 'master' + manpage: fix28, fix440, update TIFFOpen and SubIFD + + Closes #440 et #28 + + See merge request libtiff/libtiff!417 + +2022-11-20 Su Laus + + manpage: fix28, fix440, update TIFFOpen and SubIFD. + +2022-11-17 Even Rouault + + Merge branch 'cmake_tiff_install_warning' into 'master' + CMakeLists.txt: fix warning with -Wdev + + See merge request libtiff/libtiff!416 + +2022-11-13 Even Rouault + + CMakeLists.txt: fix warning with -Wdev. + ``` + CMake Warning (dev) at CMakeLists.txt:62 (option): + Policy CMP0077 is not set: option() honors normal variables. Run "cmake + --help-policy CMP0077" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + For compatibility with older versions of CMake, option is clearing the + normal variable 'tiff-install'. + This warning is for project developers. Use -Wno-dev to suppress it. + ``` + +2022-11-12 Even Rouault + + Merge branch 'fix_479' into 'master' + _TIFFReadEncodedTileAndAllocBuffer(): avoid excessive memory allocation on... + + See merge request libtiff/libtiff!412 + +2022-11-12 Even Rouault + + Merge branch 'typo_fix' into 'master' + tif_dirread.c: fix typo in comment + + See merge request libtiff/libtiff!414 + +2022-11-12 Even Rouault + + tif_dirread.c: fix typo in comment. + +2022-11-11 Even Rouault + + _TIFFReadEncodedTileAndAllocBuffer(): avoid excessive memory allocation on broken files (fixes #479) + +2022-11-10 Even Rouault + + Merge branch 'bugfix/tiff2pdf-stdout' into 'master' + tiff2pdf Don't try to seek into stdout. + + See merge request libtiff/libtiff!367 + +2022-11-10 Claus-Justus Heine + + tiff2pdf: Don't try to seek into stdout. + Fixes #441 + +2022-11-08 Even Rouault + + Merge branch 'fix_coverity_1516759' into 'master' + TIFFErrorExtR(): fix Dereference after null check (CID 1516759) + + See merge request libtiff/libtiff!411 + +2022-11-08 Even Rouault + + Merge branch 'fix_ossfuzz_53137' into 'master' + TIFFReadRGBATileExt(): fix (unsigned) integer overflow on strips/tiles > 2 GB + + See merge request libtiff/libtiff!410 + +2022-11-08 Even Rouault + + TIFFErrorExtR(): fix Dereference after null check (CID 1516759) + +2022-11-08 Even Rouault + + Merge branch 'no_sprintf' into 'master' + Replace sprintf calls with snprintf + + See merge request libtiff/libtiff!408 + +2022-11-08 Mark Mentovai + + Replace sprintf calls with snprintf. + This makes it possible to build libtiff without warnings using the macOS + 13 SDK. Calls to sprintf are replaced with snprintf, passing appropriate + buffer sizes. + + It doesn’t appear that any of the changed uses of sprintf were actually + unsafe, so no behavior change is expected aside from SDK compatibility. + + The macOS 13 SDK deprecates sprintf as it’s difficult to use safely. The + deprecation warning message is visible when building C++, but it is not + normally visible when building plain C code due to a quirk in how + sprintf is declared in the SDK. However, the deprecation message is + visible when building plain C under Address Sanitizer + (-fsanitize=address). This discrepancy was discovered at + https://crbug.com/1381706 and reported to Apple with a copy at + https://openradar.appspot.com/FB11761475. + + The macOS 13 SDK is packaged in Xcode 14.1, released on 2022-11-01. This + also affects the iOS 16 SDK and other 2022-era Apple OS SDKs packaged in + Xcode 14.0, released on 2022-09-12. + + libtiff is visible to the Chromium build via PDFium, and this change is + needed to allow Chromium to move forward to the macOS 13 SDK. + + This change is limited to the libtiff directory. Other uses of sprintf + were found in contrib, test, and tools. + +2022-11-08 Even Rouault + + Merge branch 'reentrant' into 'master' + Add reentrant error functions + + See merge request libtiff/libtiff!409 + +2022-11-08 Even Rouault + + TIFFReadRGBATileExt(): fix (unsigned) integer overflow on strips/tiles > 2 GB + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53137 + +2022-11-08 Laramie Leavitt + + Add reentrant error functions. + Prior to this change, libtiff relied on global error handlers, + which is problematic when libtiff used by multiple independent + libraries from within the same process, as they may unwittingly + clobber the error handling, introduce race conditions when setting + handlers, or otherwise have unintended side effects. + + This change adds error handlers to the TIFF struct, which are + used preferentially when available. The error handlers are invoked + when the re-entrant error functions are called: + + void TIFFErrorExtR(TIFF*, const char* module, const char* fmt, ...) + void TIFFWarningExtR(TIFF*, const char* module, const char* fmt, ...) + + The handlers have a similar signature to the existing extended + handlers, additionally returning an int: + + int TIFFErrorHandlerExtR(thandle_t, const char*, const char*, va_list) + + thandle_t is the userdata passed to TIFFOpen + When the handler returns 1, the global handlers are not called. + + Custom error/warning handlers may be installed on a per-file + basis by calling the Set functions: + + TIFF* tif = TIFFOpen(...); + TIFFSetErrorHandlerExtR(tif, MyErrorHandler); + TIFFSetWarningHandlerExtR(tif, MyWarningHandler); + + Additionally, the callsites to TIFFErrorExt and TIFFWarningExt + have been updated to call the reentrant versions. + +2022-11-08 Even Rouault + + Merge branch 'tiffcrop_fix_CoverityScan_tmsize_issue' into 'master' + tiffcrop: should fix some Coverity Scan issues OVERFLOW_BEFORE_WIDEN + + See merge request libtiff/libtiff!403 + +2022-11-08 Su Laus + + tiffcrop: should fix some Coverity Scan issues OVERFLOW_BEFORE_WIDEN. + +2022-11-02 Even Rouault + + Merge branch 'typo_fix' into 'master' + tif_dirread.c: fix typo in comment + + See merge request libtiff/libtiff!407 + +2022-11-02 Even Rouault + + tif_dirread.c: fix typo in comment. + +2022-10-23 Even Rouault + + Merge branch 'tiffcrop_formatting_fix' into 'master' + tiffcrop: add casts in TIFFError() to fix compiler warnings + + See merge request libtiff/libtiff!406 + +2022-10-23 Even Rouault + + Merge branch 'fix_482' into 'master' + CMake: correctly set default value of 'lzma' option when liblzma is detected (fixes #482) + + Closes #482 + + See merge request libtiff/libtiff!404 + +2022-10-23 Even Rouault + + tiffcrop: add casts in TIFFError() to fix compiler warnings. + + CMake: correctly set default value of 'lzma' option when liblzma is detected (fixes #482) + +2022-10-20 Even Rouault + + Merge branch 'fix_480' into 'master' + Fix incorrect printf() formatters introduced in recent commits (fixes #480) + + Closes #480 + + See merge request libtiff/libtiff!401 + +2022-10-19 Even Rouault + + Fix incorrect printf() formatters introduced in recent commits (fixes #480) + +2022-10-13 Even Rouault + + Merge branch 'CLIPPATH_tags_corrected' into 'master' + CLIPPATH tags defined twice but differently and also wrongly (#439) - corrected + + Closes #439 + + See merge request libtiff/libtiff!366 + +2022-10-13 Even Rouault + + Merge branch 'FIELD_IGNORE_warning-messages' into 'master' + Warning messages for FIELD_IGNORE tags for writing and for TIFF_SETGET_UNDEFINED for reading added. (#438) + + Closes #438 + + See merge request libtiff/libtiff!365 + +2022-10-13 Su Laus + + Warning messages for FIELD_IGNORE tags for writing and for TIFF_SETGET_UNDEFINED for reading added. (#438) + +2022-10-13 Even Rouault + + Merge branch 'tag-def_COMPRESSION_corrected' into 'master' + tif_dirinfo.c TIFFTAG_COMPRESSION and _BITSPERSAMPLE definition corrected + + See merge request libtiff/libtiff!364 + +2022-10-13 Even Rouault + + Merge branch 'fix_getopt_included_twice' into 'master' + Fix including module getopt.c twice with CMake and HAVE_GETOPT=false + + See merge request libtiff/libtiff!381 + +2022-10-13 Even Rouault + + Merge branch 'tiffcrop_CoverityScan_fix_PRINTF_ARGS' into 'master' + tiffcrop: fix Coverity Scan issues about PRINTF_ARGS. + + See merge request libtiff/libtiff!400 + +2022-10-13 Su_Laus + + tiffcrop fix Coverity Scan issues about PRINTF_ARGS. + +2022-10-13 Even Rouault + + Merge branch 'tiffcrop_fix_#450_too-many-mode-options' into 'master' + tiffcrop: fix #450 too many 'mode' options on command line. + + Closes #470 et #450 + + See merge request libtiff/libtiff!384 + +2022-10-13 Su Laus + + tiffcrop: fix #450 too many 'mode' options on command line. + +2022-10-13 Even Rouault + + Merge branch 'tiffcrop_fix_#435' into 'master' + tiffcrop subroutines require a larger buffer (fixes #271, #381, #386, #388, #389, #435) + + Closes #465, #464, #435, #389, #388, #386, #381 et #271 + + See merge request libtiff/libtiff!382 + +2022-10-13 Su Laus + + tiffcrop subroutines require a larger buffer (fixes #271, #381, #386, #388, #389, #435) + +2022-10-12 Even Rouault + + Merge branch 'InkNames_NumberOfInks_handling_revised' into 'master' + Revised handling of TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value (fixes #149, #150, #152, #168, #250, #269, #398 and #456) + + Closes #474, #463, #387, #456, #398, #269, #250, #168, #152, #150 et #149 + + See merge request libtiff/libtiff!385 + +2022-10-12 Even Rouault + + Merge branch 'tiffcrop_fix_#411_#413' into 'master' + tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411, #413 and #426) + + Closes #426, #413 et #411 + + See merge request libtiff/libtiff!383 + +2022-10-10 Even Rouault + + Merge branch 'TIFFAdvanceDirectory_mapped_uio' into 'master' + TIFFAdvanceDirectory(): fix unsigned-integer-overflow in mapped case + + See merge request libtiff/libtiff!398 + +2022-10-10 Even Rouault + + TIFFAdvanceDirectory(): fix unsigned-integer-overflow in mapped case. + Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52309 + +2022-10-08 Even Rouault + + Merge branch 'tiffinfo_parse_SubIFDs' into 'master' + tiffinfo: Updated to parse through SubIFDs and show their tags. + + See merge request libtiff/libtiff!396 + +2022-10-08 Su Laus + + tiffinfo: Updated to parse through SubIFDs and show their tags. + +2022-10-07 Roger Leigh + + Merge branch 'master' into 'master' + Moved linking of CMath::CMath into CMath_LIBRARY check + + See merge request libtiff/libtiff!397 + +2022-10-07 Frei Herr + + Moved linking of CMath::CMath into CMath_LIBRARY check. + +2022-10-06 Even Rouault + + Merge branch 'rational_precision2double_coverity-fix' into 'master' + rational_precision2double.c: Fix issue from Coverity Scan. + + See merge request libtiff/libtiff!395 + +2022-10-06 Su_Laus + + rational_precision2double.c: Fix issue from Coverity Scan. + + Fix including module getopt.c twice with CMake and HAVE_GETOPT=false. + The "make-files" for the tools- and test- programmes include the module getopt.c once directly as additional source and then again by including port.lib. + This can be avoided by including getopt.c as source in port.lib within port\CMakeLists.txt not with PUBLIC but with PRIVATE. + +2022-10-06 Even Rouault + + Merge branch 'fix-455_Improved-IFD-loop-handling' into 'master' + Improved IFD-Loop Handling (fixes #455) + + Closes #455 + + See merge request libtiff/libtiff!386 + +2022-10-06 Su Laus + + Improved IFD-Loop Handling (fixes #455) + IFD infinite looping was not fixed by MR 20 (see #455). + An improved IFD loop handling is proposed. + + Basic approach: + + - The order in the entire chain must be checked, and not only whether an offset has already been read once. + - To do this, pairs of directory number and offset are stored and checked. + - The offset of a directory number can change. + - TIFFAdvanceDirectory() must also perform an IFD loop check. + - TIFFCheckDirOffset() is replaced by _TIFFCheckDirNumberAndOffset(). + + Rules for the check: + + - If an offset is already in the list, it must have the same IFD number. Otherwise it is an IDF loop. + - If the offset is not in the list and the IFD number is greater than there are list entries, a new list entry is added. + - Otherwise, the offset of the IFD number is updated. + + Reference is also made to old bugzilla bug 2772 and MR 20, which did not solve the general issue. + This MR closes #455 + +2022-10-05 Roger Leigh + + Merge branch 'fix-cmake-subproject' into 'master' + Fix CMake build to be compatible with FetchContent + + See merge request libtiff/libtiff!394 + +2022-10-04 Timothy Lyanguzov + + Apply 9 suggestion(s) to 3 file(s) + +2022-10-04 Jeremy Maitin-Shepard + + Fix CMake build to be compatible with FetchContent. + Recent versions of CMake have improved support for including + dependencies, using the FetchContent module, which allows a dependency + to be imported as a subproject and then later found automatically by + calls to `find_package`. + + This change makes libtiff's CMake better behaved when used as a + sub-project: + + - CMake has a single global namespace for all target names in all + sub-projects. This commit renames the following CMake targets: + + - port -> tiff_port + - mkg3states -> tiff_mkg3states + - faxtable -> tiff_faxtable + - release -> tiff_release + + - When building TIFF as a sub-project, it is not normally useful to + create install rules for its targets. This commit adds a + `tiff-install` option that controls whether the install rules are + added and defaults to OFF when libtiff is included as a sub-project. + + - Previously, libtiff set `BUILD_SHARED_LIBS` to ON by default. With + this commit, that default is only set if libtiff is the top-level + project. + + - When using `find_package(TIFF)`, the targets `TIFF::TIFF` and + `TIFF::CXX` are defined. This commit makes libtiff itself define + those targets as aliases, to allow other cmake projects to use + either `find_package` or `FetchContent` interchangeably. + + - Adds ZSTD_HAVE_DECOMPRESS_STREAM variable which may be set to bypass + `check_symbol_exists` call. Fixes + https://gitlab.com/libtiff/libtiff/-/issues/472. + +2022-09-27 Even Rouault + + Merge branch 'getimage_overflow' into 'master' + Update getimage to support reading large raster images + + See merge request libtiff/libtiff!389 + +2022-09-26 Even Rouault + + Merge branch 'MinGW-warnings_ipctutil' into 'master' + Fix #458: MinGW Windows 64: warning because 'long' is a 32 bits type in... + + Closes #458 + + See merge request libtiff/libtiff!391 + +2022-09-26 Su Laus + + Fix #458: MinGW Windows 64: warning because 'long' is a 32 bits type in... + +2022-09-16 Eric Siegel + + Update getimage to support large raster images. + +2022-09-08 Even Rouault + + Merge branch 'typo_fix' into 'master' + tif_lzw.c: fix typo in code comment + + See merge request libtiff/libtiff!387 + +2022-09-08 Even Rouault + + tif_lzw.c: fix typo in code comment. + +2022-08-30 Su_Laus + + Revised handling of TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value + In order to solve the buffer overflow issues related to TIFFTAG_INKNAMES and related TIFFTAG_NUMBEROFINKS value, a revised handling of those tags within LibTiff is proposed: + + Behaviour for writing: + `NumberOfInks` MUST fit to the number of inks in the `InkNames` string. + `NumberOfInks` is automatically set when `InkNames` is set. + If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued. + If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued. + + Behaviour for reading: + When reading `InkNames` from a TIFF file, the `NumberOfInks` will be set automatically to the number of inks in `InkNames` string. + If `NumberOfInks` is different to the number of inks within `InkNames` string, that will be corrected and a warning is issued. + If `NumberOfInks` is not equal to samplesperpixel only a warning will be issued. + + This allows the safe use of the NumberOfInks value to read out the InkNames without buffer overflow + + This MR will close the following issues: #149, #150, #152, #168 (to be checked), #250, #269, #398 and #456. + + It also fixes the old bug at http://bugzilla.maptools.org/show_bug.cgi?id=2599, for which the limitation of `NumberOfInks = SPP` was introduced, which is in my opinion not necessary and does not solve the general issue. + +2022-08-25 Su_Laus + + tiffcrop: disable incompatibility of -Z, -X, -Y, -z options with any PAGE_MODE_x option (fixes #411 and #413) + tiffcrop does not support –Z, -z, -X and –Y options together with any other PAGE_MODE_x options like -H, -V, -P, -J, -K or –S. + + Code analysis: + + With the options –Z, -z, the crop.selections are set to a value > 0. Within main(), this triggers the call of processCropSelections(), which copies the sections from the read_buff into seg_buffs[]. + In the following code in main(), the only supported step, where that seg_buffs are further handled are within an if-clause with if (page.mode == PAGE_MODE_NONE) . + + Execution of the else-clause often leads to buffer-overflows. + + Therefore, the above option combination is not supported and will be disabled to prevent those buffer-overflows. + + The MR solves issues #411 and #413. + +2022-08-21 Even Rouault + + Merge branch 'tiffcrop_S-option_mutually_exclusive' into 'master' + tiffcrop: -S option mutually exclusive (fixes #349, #414, #422, #423, #424) + + Closes #424, #423, #422, #414 et #349 + + See merge request libtiff/libtiff!378 + +2022-08-20 Su_Laus + + tiffcrop -S option: Make decision simpler. + +2022-08-20 Even Rouault + + Merge branch 'remove_death_commented_code' into 'master' + Remove dead code from tif_dirread.c, tif_dirwrite.c and tif_getimage.c + + See merge request libtiff/libtiff!380 + +2022-08-20 Su Laus + + Remove dead code from tif_dirread.c, tif_dirwrite.c and tif_getimage.c. + +2022-08-16 Even Rouault + + Merge branch 'coverity_fixes' into 'master' + Silence Coverity Scan false positive warnings about out-of-bounds access + + See merge request libtiff/libtiff!379 + +2022-08-16 Even Rouault + + tif_zip.c: silence Coverity Scan false positive warnings about out-of-bounds access (CID 1491190, 1491197, 1491201) + + tif_dirread.c: silence Coverity Scan false positive warnings about out-of-bounds access (CID 1491182, 1491186) + +2022-08-16 Even Rouault + + Merge branch 'default_tag_values_extended' into 'master' + Presetting of default tag values extended (e.g. PlanarConfig). (fixes #449) + + Closes #449 + + See merge request libtiff/libtiff!377 + +2022-08-16 Su Laus + + Presetting of default tag values extended (e.g. PlanarConfig). (fixes #449) + +2022-08-15 Su_Laus + + According to Richard Nolde https://gitlab.com/libtiff/libtiff/-/issues/401#note_877637400 the tiffcrop option „-S“ is also mutually exclusive to the other crop options (-X|-Y), -Z and -z. + This is now checked and ends tiffcrop if those arguments are not mutually exclusive. + + This MR will fix the following tiffcrop issues: #349, #414, #422, #423, #424 + +2022-08-09 Even Rouault + + Merge branch 'warning_fix' into 'master' + Fix warning about shadowing + + See merge request libtiff/libtiff!376 + +2022-08-09 Even Rouault + + Fix warning about shadowing. + +2022-08-09 Even Rouault + + Merge branch 'fix_225' into 'master' + Deal with RichTIFFIPTC tag written with LONG type (fixes #225) + + Closes #225 + + See merge request libtiff/libtiff!374 + +2022-08-09 Even Rouault + + Merge branch 'Writing_IFD8_to_ClassicTIFF_bugfix' into 'master' + Correcting defects reported by Coverity Scan for MR !369 + + See merge request libtiff/libtiff!375 + +2022-08-09 Su Laus + + Correcting defects reported by Coverity Scan for MR !369. + +2022-08-09 Even Rouault + + Merge branch 'fix_442_Writing_IFD8_to_ClassicTIFF' into 'master' + TIFFSetValue(): Writing IFD8 & LONG8 tags to ClassicTIFF corrected (fixes #442) + + Closes #442 + + See merge request libtiff/libtiff!369 + +2022-08-09 Su Laus + + TIFFSetValue(): Writing IFD8 & LONG8 tags to ClassicTIFF corrected (fixes #442) + +2022-08-09 Even Rouault + + Deal with RichTIFFIPTC tag written with LONG type (fixes #225) + +2022-08-07 Roger Leigh + + Merge branch 'manpage-functions-added' into 'master' + doc: Missing public functions added to TIFF documentation in Sphinx + + See merge request libtiff/libtiff!372 + +2022-08-07 Su Laus + + doc: Missing public functions added to TIFF documentation in Sphinx. + +2022-07-29 Even Rouault + + Merge branch 'tifjpeg_version_check' into 'master' + tif_jpeg.c: allow to pass -DEXPECTED_JPEG_LIB_VERSION=number to do optional... + + See merge request libtiff/libtiff!373 + +2022-07-29 Even Rouault + + tif_jpeg.c: allow to pass -DEXPECTED_JPEG_LIB_VERSION=number to do optional compile-time version check + +2022-07-21 Even Rouault + + Merge branch 'TIFFReadFromUserBuffer_fix' into 'master' + TIFFReadFromUserBuffer(): fix clearing of TIFF_CODERSETUP flag that could... + + See merge request libtiff/libtiff!371 + +2022-07-21 Even Rouault + + TIFFReadFromUserBuffer(): fix clearing of TIFF_CODERSETUP flag that could cause issues with reading JPEG compressed files + +2022-07-21 Roger Leigh + + Merge branch 'vs2022-fixes' into 'master' + cmake: Correct duplicate definition of _CRT_SECURE_NO_WARNINGS + + Closes #443 + + See merge request libtiff/libtiff!370 + +2022-07-13 Roger Leigh + + cmake: Correct duplicate definition of _CRT_SECURE_NO_WARNINGS. + +2022-07-13 Even Rouault + + Merge branch 'vs2022-fixes' into 'master' + cmake: Fixes for Visual Studio 2022 + + See merge request libtiff/libtiff!368 + +2022-07-13 Roger Leigh + + cmake: Fixes for Visual Studio 2022. + +2022-07-03 Roger Leigh + + Merge branch 'elf-symbol-export' into 'master' + Explicit export of versioned ELF symbols + + Closes #437 + + See merge request libtiff/libtiff!361 + +2022-07-03 Even Rouault + + Merge branch 'fix_433' into 'master' + _TIFFCheckFieldIsValidForCodec(): return FALSE when passed a codec-specific... + + Closes #433 + + See merge request libtiff/libtiff!363 + +2022-07-01 Su_Laus + + CLIPPATH tags defined twice but differently and also wrongly. + In tif_dirinfo.c the tags for clippath are wrongly defined and the tag TIFFTAG_XCLIPPATHUNITS is even different twice. Therefore, those tags cannot be written / read correctly and may even lead to buffer overflow. + E.g.: In the case of TIFFSetField(YCLIPPATHUNITS), a 1 byte storage space is allocated because of TIFF_SETGET_UNDEFINED, in which an int32_t value should be stored because of TIFF_SLONG type definition. Then, an int32_t value is read from that 1 byte storage location. + + The current definition is: + + { TIFFTAG_CLIPPATH, -1, -3, TIFF_BYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath", NULL }, + { TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL }, + { TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_SBYTE, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL }, + { TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_SLONG, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL }, + + Whereas the correct definition according to TIFF Specification Supplement 1 (https://www.awaresystems.be/imaging/tiff/specification/TIFFPM6.pdf) should be: + + { TIFFTAG_CLIPPATH, -3, -3, TIFF_BYTE, 0, TIFF_SETGET_C32_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 1, "ClipPath", NULL }, + { TIFFTAG_XCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "XClipPathUnits", NULL }, + { TIFFTAG_YCLIPPATHUNITS, 1, 1, TIFF_LONG, 0, TIFF_SETGET_UINT32, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "YClipPathUnits", NULL }, + + Also the set_get_field of the following tag should be corrected from + + { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL }, + to + { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL }, + + However, if those tags schould not be handled by LibTiff because they are deamed as abandoned or unwanted tags, those tags need to be defined with FIELD_IGNORE instead of FIELD_CUSTOM and keeping set_field_type = TIFF_SETGET_UNDEFINED + +2022-07-01 Su_Laus + + In tif_dirinfo.c the definition for TIFFTAG_COMPRESSION has different settings of field_readcount=TIFF_VARIABLE (-1) and field_writecount=1. The tag is defined with Count=1, thus field_readcount is wrong and should also be 1. Although TIFFTAG_BITSPERSAMPLE is defined with Count:N=SamplesPerPixel, only ONE uint16_t value is passed with TIFFSetField() and TIFFGetField(). However, an array with N=SamplesPerPixel equal values is written into the TIFF file. Shouldn't field_readcount = field_writecount = 1 then? The behaviour of TiffLib does not change, because the handling is coded directly. + +2022-06-27 Even Rouault + + _TIFFCheckFieldIsValidForCodec(): return FALSE when passed a codec-specific tag and the codec is not configured (fixes #433) + This avoids crashes when querying such tags + +2022-06-27 Even Rouault + + Merge branch '16bit_cielab' into 'master' + add basic 16bit-cielab support + + See merge request libtiff/libtiff!336 + +2022-06-27 Caolán McNamara + + Add basic 16bit-cielab support. + just a copy of putcontig8bitCIELab that reads 16bit vals but divide l by + 257, a and b by 256 before passing to TIFFCIELabToXYZ + + motivation: https://bugs.documentfoundation.org/show_bug.cgi?id=131199 + the "clavijo16bitlab.tiff" example where tiffinfo says: + ``` + Image Width: 2601 Image Length: 3503 + Resolution: 96, 96 pixels/inch + Bits/Sample: 16 + Compression Scheme: AdobeDeflate + Photometric Interpretation: CIE L*a*b* + Orientation: row 0 top, col 0 lhs + Samples/Pixel: 3 + Rows/Strip: 1 + Planar Configuration: single image plane + DateTime: 2020:03:07 10:20:42 + ``` + +2022-06-24 Roger Leigh + + Merge branch 'manpage-fixes' into 'master' + Sphinx documentation fixes + + See merge request libtiff/libtiff!362 + +2022-06-24 Roger Leigh + + doc: Correct types and cross-references. + + doc: Correct manual page path. + + build: Make rational2double static only for automake. + This copies the same logic as used by CMake. + + build: Update autoconf version to 4.5.0 and soname to 6.0.0. + + build: Update autoconf ld-version-script default. + + libtiff: Correct version script for changes since v4.4.0. + + libtiff: Update version script documentation. + + libtiff: Add symbol versioning of all exported symbols. + +2022-06-24 Even Rouault + + Merge branch 'webp_mem_improvements' into 'master' + WEBP codec: avoid temporary buffer and memcpy() on whole tile/strip decoding + + See merge request libtiff/libtiff!360 + +2022-06-24 Roger Leigh + + build: Enable symbol versioning by default. + +2022-06-24 Roger Leigh + + Merge branch 'sphinx-manpages' into 'master' + doc: Add Sphinx conversion of all manpages + + Closes #361 + + See merge request libtiff/libtiff!356 + +2022-06-24 Roger Leigh + + Merge branch 'remove-wince' into 'master' + Remove obsolete WinCE source file + + See merge request libtiff/libtiff!357 + +2022-06-23 Even Rouault + + WEBP codec: avoid temporary buffer and memcpy() on whole tile/strip decoding + +2022-06-22 Even Rouault + + Merge branch 'horAcc8_fix' into 'master' + tif_predict.c: make horAcc8() work with icc (ICC) 2021.6.0 20220226 -O2 + + See merge request libtiff/libtiff!359 + +2022-06-22 Even Rouault + + tif_predict.c: make horAcc8() work with icc (ICC) 2021.6.0 20220226 -O2. + For a reason I don't understand, recent ICC generates wrong code in -O2 + mode for the stride = 3 and 4 cases. The modified code is more + straightfoward, so go for it. + +2022-06-19 Roger Leigh + + Merge branch 'ci-restore-old' into 'master' + ci: Restore testing with Ubuntu 20.04 + + See merge request libtiff/libtiff!358 + +2022-06-19 Roger Leigh + + ci: Restore testing with Ubuntu 20.04. + + Remove obsolete WinCE source file. + + doc: Add missing punctuation. + + doc: Remove semicolon from c:function definition. + + doc: Remove remaining HTML entities. + + doc: Improve the build page. + +2022-06-18 Roger Leigh + + doc: Add Sphinx conversion of all manpages. + +2022-06-18 Roger Leigh + + Merge branch 'dist-html' into 'master' + build: Distribute and install HTML documentation + + See merge request libtiff/libtiff!352 + +2022-06-13 Even Rouault + + Merge branch 'pkgconfig' into 'master' + Adding Requires.private generation + + See merge request libtiff/libtiff!355 + +2022-06-13 Yishen Miao + + Adding Requires.private generation. + Adds Requires.private generation so that pkg-config can correctly find + the dependencies of libtiff. + +2022-06-11 Roger Leigh + + Merge branch 'ci-dist' into 'master' + ci: Archive distribution tar and zip files + + See merge request libtiff/libtiff!354 + +2022-06-11 Roger Leigh + + ci: Archive distribution tar and zip files. + +2022-06-11 Even Rouault + + Merge branch 'export_TIFFClampDoubleToUInt32' into 'master' + libtiff.def: export _TIFFClampDoubleToUInt32 + + See merge request libtiff/libtiff!353 + +2022-06-11 Even Rouault + + libtiff.def: export _TIFFClampDoubleToUInt32. + +2022-06-11 Even Rouault + + Merge branch 'issue-415+427+428' into 'master' + fix the FPE in tiffcrop (#415, #427, and #428) + + Closes #428, #427 et #415 + + See merge request libtiff/libtiff!346 + +2022-06-11 4ugustus + + fix the FPE in tiffcrop (#415, #427, and #428) + +2022-06-11 Roger Leigh + + build: Distribute and install HTML documentation. + +2022-06-10 Even Rouault + + Merge branch 'tif_jpeg_warning_fix' into 'master' + tif_jpeg.c: fix error message + + See merge request libtiff/libtiff!351 + +2022-06-10 Even Rouault + + tif_jpeg.c: fix error message. + +2022-06-10 Roger Leigh + + Merge branch 'android_libm' into 'master' + Fix dependency on libm on Android + + See merge request libtiff/libtiff!350 + +2022-06-09 Matthias Kuhn + + Always link to libm if available. + +2022-06-05 Roger Leigh + + Merge branch 'vasyl5-master-patch-97651' into 'master' + libtoolize: command not found on macOS. + + See merge request libtiff/libtiff!289 + +2022-06-05 Roger Leigh + + Merge branch 'rst-docs' into 'master' + Convert HTML documentation to Sphinx RST + + See merge request libtiff/libtiff!349 + +2022-06-05 Roger Leigh + + Merge remote-tracking branch 'origin/master' into rst-docs. + +2022-06-05 Roger Leigh + + Merge branch 'cmake-xc-faxtable' into 'master' + cmake: Do not build faxtable target when cross-compiling + + See merge request libtiff/libtiff!342 + +2022-06-05 Roger Leigh + + Merge branch 'cmake-disable-options' into 'master' + Add options for disabling tools, tests, contrib and docs + + See merge request libtiff/libtiff!343 + +2022-06-05 Roger Leigh + + Merge branch 'cmake-msvc-options' into 'master' + cmake: Add MSVC options when building all libraries and executables + + See merge request libtiff/libtiff!344 + +2022-06-05 Roger Leigh + + Merge branch 'cmake-win32-libtiffxx-static' into 'master' + cmake: libtiffxx is static on win32 + + See merge request libtiff/libtiff!338 + +2022-06-05 Roger Leigh + + Merge branch 'licence-file' into 'master' + Rename COPYRIGHT to LICENSE.md + + See merge request libtiff/libtiff!345 + +2022-06-05 Roger Leigh + + Rename COPYRIGHT to LICENSE.md. + + doc: Fix make distcheck. + + doc: Update automake configuration. + + doc: Do not pass srcdir and builddir to sphinx-build. + + doc: Additional top-level tidying. + + doc: Tidy top-level index. + + doc: Move bugs to project. + + doc: Move misc to project. + + doc: Move all BigTIFF documentation into specification directory. + * Remove the BigTIFF proposal since this has long been completed + * Update the BigTIFF PR to note completion of the work and replace + present with past tense. + + doc: Split release history. + This permits the newer releases to be included in the top-level + toctree without polluting it with dozens of old releases. + + doc: Correct accents. + + doc: BigTIFF design markup improvements. + + Add doc/_static. + + doc: Move TIFF specification and design notes into subdirectory. + + doc: Move releases into subdirectory. + + doc: Mark up TIFF tech note 2. + + doc: Use sphinxdox theme. + The sphix_rtd_theme formats complex tables badly. + + doc: Clean up HTML tags. + +2022-06-04 Roger Leigh + + ci: Install Sphinx manual for use by GitLab pages. + + doc: Use sphinx_rtd_theme. + + Convert HTML documentation to Sphinx RST. + * Add CMake build logic + * Add Autotools build logic + * Move from html/ to doc/ + * Manual pages are still generated HTML for the time being + + git: Ignore common IDE build files. + +2022-06-04 Roger Leigh + + Merge branch 'ci-ubuntu-22.04' into 'master' + ci: Update to use Ubuntu 22.04 CI images + + Closes #429 + + See merge request libtiff/libtiff!348 + +2022-06-04 Roger Leigh + + Merge branch 'opengl-option' into 'master' + cmake: Add tiff-opengl option + + See merge request libtiff/libtiff!340 + +2022-06-04 Roger Leigh + + tiffdump: Avoid overflow warning when reading. + + ci: Update to use Ubuntu 22.04 CI images. + +2022-06-04 Even Rouault + + Merge branch 'master' into 'master' + Include stdlib.h in tif_lzw.c. + + See merge request libtiff/libtiff!347 + +2022-06-04 Brian Ledger + + Merge branch 'master' of https://gitlab.com/libtiff/libtiff. + +2022-06-04 Brian Ledger + + Include stdlib.h in tif_lzw.c. + In `tif_lzw.c`, a call is made to `_byteswap_uint64`. This is declared in `stdlib.h`. `stdlib.h` is not included in `tib_lzw.c`, so a name error may occur. + + This change adds `#include stdlib.h` to `tif_lzw.c`, to prevent a name error from occuring when `stdlib.h` is not included. + +2022-05-29 Roger Leigh + + Add options for disabling tools, tests, contrib and docs. + + cmake: Add MSVC options when building all libraries and executables. + + cmake: Do not build faxtable target when cross-compiling. + + cmake: Use add_compile_definitions and add_compile_options. + It seems that some CMake versions can't export targets using PRIVATE + linking, even though the private target is never used. + + Merge remote-tracking branch 'origin/master' into cmake-msvc-options. + + Merge remote-tracking branch 'origin/master' into cmake-win32-libtiffxx-static + +2022-05-29 Roger Leigh + + Merge branch 'ci-x64' into 'master' + ci: Remove arm64 temporarily + + See merge request libtiff/libtiff!341 + +2022-05-29 Roger Leigh + + ci: Remove arm64 temporarily. + + autoconf: Add --disable-opengl option. + + cmake: Add tiff-opengl option. + + cmake: Add MSVC options when building all libraries and executables. + + cmake: libtiffxx is static on win32. + +2022-05-22 Even Rouault + + html/Makefile.am: add v4.4.0.html to docfiles. + +2022-05-20 Even Rouault + + Update HOWTO-RELEASE with .tar.xz. + + Prepare for release 4.4.0. + +2022-05-16 Even Rouault + + libtiff v4.4.0 released + +2022-05-16 Even Rouault + + Merge branch 'pkgconf_abs_path' into 'master' + Handle absolute paths in pkg-config file + + See merge request libtiff/libtiff!333 + +2022-05-16 Miloš Komarčević + + Handle absolute paths in pkg-config file. + +2022-05-15 Even Rouault + + Merge branch 'fix-tests-with-ro-source-dir' into 'master' + cmake: allow running the tests with a read-only source directory + + See merge request libtiff/libtiff!332 + +2022-05-15 Alex Richardson + + cmake: allow running the tests with a read-only source directory. + Prior to this commit CTest would invoke all simple_tests tests with the + current working directory set to the source directory. However, some of + the tests (e.g. rewrite) will output files to the current working + directory and will therefore fail when run with a read-only source + directory. This can happen e.g. when testing a cross-compiled version of + libtiff where the sources are mounted read-only in the virtual machine. + + Simply changing the working directory to CMAKE_CURRENT_BINARY_DIR allows + all but raw_decode to pass. The raw_decode test looks for files in the + source directory, and uses the `srcdir` environment variable to find, so + we also have to add a set_tests_properties() call to specify that env var. + +2022-05-14 Even Rouault + + Merge branch 'tiffcrop_pipeline_error' into 'master' + tiffcrop: Fixes complain of pipeline "cmake-ninja-arm64" about abs() on... + + See merge request libtiff/libtiff!331 + +2022-05-14 Su Laus + + tiffcrop: Fixes complain of pipeline "cmake-ninja-arm64" about abs() on... + +2022-05-14 Even Rouault + + Merge branch 'TIFFField_SetGetSize_CountSize' into 'master' + Public functions TIFFFieldSetGetSize() and TIFFieldSetGetCountSize() added. + + See merge request libtiff/libtiff!284 + +2022-05-14 Su Laus + + Public functions TIFFFieldSetGetSize() and TIFFieldSetGetCountSize() added. + +2022-05-13 Even Rouault + + Merge branch 'jondo-master-patch-87274' into 'master' + Replace add_compile_definitions for CMake versions before 3.12 (#238) + + See merge request libtiff/libtiff!330 + +2022-05-13 Robert Pollak + + Replace add_compile_definitions for CMake versions before 3.12 (#238) + +2022-05-13 Even Rouault + + Merge branch 'master' into 'master' + Remove incorrect assert. + + See merge request libtiff/libtiff!329 + +2022-05-13 Ben Laurie + + Remove incorrect assert. + +2022-05-10 Even Rouault + + Merge branch 'Fix_Issue#330' into 'master' + tiffcrop: Fix issue #330 and some more from 320 to 349 + + Closes #330 + + See merge request libtiff/libtiff!298 + +2022-05-10 Su Laus + + tiffcrop: Fix issue #330 and some more from 320 to 349. + +2022-05-10 Even Rouault + + test_signed_tags.c: fix CID 1504376. + +2022-05-10 Even Rouault + + Merge branch 'fix_#29_tiffcp_orientationTag' into 'master' + tiffcp: Fix incomprehensible setting of orientation tag (fixes #29) + + Closes #29 + + See merge request libtiff/libtiff!327 + +2022-05-10 Even Rouault + + Merge branch 'palette-8bit' into 'master' + tiff2pdf: handle 8-bit palette colormap + + See merge request libtiff/libtiff!328 + +2022-05-09 Jay Berkenbilt + + tiff2pdf: handle 8-bit palette colormap. + If all the colors in a palette are in the range [0, 255], treat the + palette as an 8-bit colormap. This workaround already exists elsewhere + in the software including in tiff2ps. + +2022-05-08 Even Rouault + + Merge branch 'fix_#40_ReadSignedTags' into 'master' + Reading of signed tags added (fixes #40) + + Closes #40 + + See merge request libtiff/libtiff!326 + +2022-05-08 Su Laus + + Reading of signed tags added (fixes #40) + +2022-05-08 Even Rouault + + Fix typos in comments. + +2022-05-08 Even Rouault + + Merge branch 'fix_400' into 'master' + tiffcp: avoid buffer overflow in "mode" string (fixes #400) + + Closes #400 + + See merge request libtiff/libtiff!323 + +2022-05-08 Even Rouault + + Merge branch 'CheckForBigTiff' into 'master' + TIFFIsBigTiff() function added. + + See merge request libtiff/libtiff!325 + +2022-05-08 Su Laus + + TIFFIsBigTiff() function added. + +2022-05-01 Su_Laus + + tiffcp: Fix incomprehensible setting of orientation tag (fixes #29) + +2022-04-23 Even Rouault + + Merge branch 'fix_#8_FreeAnonTag' into 'master' + extra flag for anonymous (unknown) tags (fixes #8) + + Closes #400 et #8 + + See merge request libtiff/libtiff!324 + +2022-04-22 Even Rouault + + tif_lzw.c: fix potential out-of-bounds error when trying to read in the same tile/strip after an error has occured (fixes #410) + +2022-04-06 Su_Laus + + extra flag for anonymous (unknown) tags (fixes #8) + +2022-04-02 Su_Laus + + tiffcp: avoid buffer overflow in "mode" string (fixes #400) + +2022-03-21 Even Rouault + + avoid hang in TIFFRewriteDirectory() if a classic file > 4 GB is attempted to be created + Fixes https://github.com/OSGeo/gdal/issues/5479 + +2022-03-19 Even Rouault + + Merge branch 'Correct_tag_auto-registration_description' into 'master' + Correct reading description for anonymous tag auto-registration in addingtags.html (closes 353) + + Closes #353 + + See merge request libtiff/libtiff!320 + +2022-03-19 Su Laus + + Correct reading description for anonymous tag auto-registration in addingtags.html (closes 353) + +2022-03-18 Even Rouault + + tif_lzw.c: avoid harmless unsigned-integer-overflow (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45741) + +2022-03-17 Even Rouault + + Merge branch 'fix_396' into 'master' + tiffcp: do not try to fetch compressor-specific tags when not appropriate (fixes #396) + + Closes #396 + + See merge request libtiff/libtiff!316 + +2022-03-17 Even Rouault + + Merge branch 'Fix_cmake_warnings' into 'master' + Fix some CMake warnings + + See merge request libtiff/libtiff!319 + +2022-03-17 Su Laus + + Fix some CMake warnings. + +2022-03-17 Even Rouault + + Merge branch 'lzw_decode_improvements' into 'master' + LZWDecode(): major speed improvements + + See merge request libtiff/libtiff!318 + +2022-03-16 Even Rouault + + LZWDecode(): major speed improvements. + This mostly comes from dealing specifically with codes that expand to + 2, 3 and 4 bytes or more to avoid branches, and dealing with longer + repeated sequences (e.g. lots of bytes to 0). + + With the following bench.c, execution time is 32% faster on a 8000x8000 + 4 bands uint16 predictor=2 image that has a 1.6x compression ratio. with + gcc 9.4.0, on x86_64 + + bench.c: + ``` + #include "tiffio.h" + #include + #include + + int main(int argc, char* argv[]) + { + if( argc != 2 ) + { + fprintf(stderr, "Usage: ./bench my.tif\n"); + exit(1); + } + TIFF* tif = TIFFOpen(argv[1], "r"); + if( tif == NULL ) + { + fprintf(stderr, "Cannot open %s\n", argv[1]); + exit(1); + } + if( !TIFFIsTiled(tif) ) + { + fprintf(stderr, "Only tiled image supported\n"); + exit(1); + } + int tilesize = (int)TIFFTileSize(tif); + char* c = malloc(tilesize); + if( c == NULL ) + { + fprintf(stderr, "Out of memory\n"); + exit(1); + } + const uint32_t numtiles = TIFFNumberOfTiles(tif); + //int numloops = 4 * (int)(1e9 / ((double)tilesize * numtiles)); + //printf("Number of loops: %d\n", numloops); + int numloops = 1; + for(int i =0; i< numloops; i++) + { + for(uint32_t tileindex = 0; tileindex < numtiles; tileindex++ ) + { + TIFFReadEncodedTile(tif, tileindex, c, tilesize); + } + } + free(c); + TIFFClose(tif); + return 0; + } + ``` + +2022-03-16 Even Rouault + + LZWDecode(): modest speed improvement: fetch input data by chunks of the largest natural integer of the architecture + +2022-03-14 Even Rouault + + Merge branch 'kmilos-master-patch-45885' into 'master' + Correct fix for the pkgconf file relative paths + + See merge request libtiff/libtiff!317 + +2022-03-10 Even Rouault + + tif_lzw.c: make LZW_CHECKEOS non-optional. + + tiffsplit.c: fix compiler warning on 32-bit. + +2022-03-10 Miloš Komarčević + + Correct fix for the pkgconf file relative paths. + +2022-03-10 Even Rouault + + Merge branch 'issue-278' into 'master' + fix heap buffer overflow in tiffcp (#278) + + Closes #278 + + See merge request libtiff/libtiff!311 + +2022-03-10 4ugustus + + fix heap buffer overflow in tiffcp (#278) + +2022-03-09 Even Rouault + + tiffcp: do not try to fetch compressor-specific tags when not appropriate (fixes #396) + +2022-03-09 Even Rouault + + Merge branch 'i_am_a_unsympathetic_person' into 'master' + index.html: make it clear that I'm a unsympathetic person + + See merge request libtiff/libtiff!315 + +2022-03-09 Even Rouault + + index.html: make it clear that I'm a unsympathetic person. + +2022-03-08 Even Rouault + + Merge branch 'Fix_Issue#395' into 'master' + tiffcrop: fix issue #395: generation of strange section images. + + Closes #395 + + See merge request libtiff/libtiff!312 + +2022-03-08 Su Laus + + tiffcrop: fix issue #395: generation of strange section images. + +2022-03-08 Even Rouault + + Merge branch 'Fix_Issue#380' into 'master' + tiffcrop: fix issue #380 and #382 heap buffer overflow in extractImageSection + + Closes #382 et #380 + + See merge request libtiff/libtiff!307 + +2022-03-08 Su Laus + + tiffcrop: fix issue #380 and #382 heap buffer overflow in extractImageSection + +2022-03-08 Even Rouault + + Merge branch 'issue-392' into 'master' + add checks for return value of limitMalloc (#392) + + Closes #392 + + See merge request libtiff/libtiff!314 + +2022-03-08 Even Rouault + + Merge branch 'issue-393' into 'master' + fix the FPE in tiffcrop (#393) + + Closes #393 + + See merge request libtiff/libtiff!310 + +2022-03-08 4ugustus + + fix the FPE in tiffcrop (#393) + +2022-03-08 Even Rouault + + Merge branch 'kmilos-master-patch-56785' into 'master' + Fix pkgconf file relative paths + + Closes #394 + + See merge request libtiff/libtiff!309 + +2022-03-07 Augustus + + add checks for return value of limitMalloc (#392) + +2022-03-02 Miloš Komarčević + + Fix pkgconf file relative paths. + +2022-02-25 Even Rouault + + Merge branch 'fix_385' into 'master' + tif_jbig.c: fix crash when reading a file with multiple IFD in memory-mapped... + + Closes #385 + + See merge request libtiff/libtiff!306 + +2022-02-24 Even Rouault + + tif_jbig.c: fix crash when reading a file with multiple IFD in memory-mapped mode and when bit reversal is needed (fixes #385) + +2022-02-24 Even Rouault + + Merge branch 'string_size_limit' into 'master' + _TIFFVSetField(): when passing a string without explicit length, check that... + + See merge request libtiff/libtiff!304 + +2022-02-24 Even Rouault + + Merge branch 'TIFFClientOpen_cleanup' into 'master' + TIFFClientOpen(): remove useless initializations of tif_rawcc and tif_flags... + + See merge request libtiff/libtiff!303 + +2022-02-20 Even Rouault + + Remove extra word in comment. + + TIFFPrintDirectory(): avoid potential multi-threading issue when reading the DotRange tag + The severity of the issue would be low (mix of values displayed) and the + time window where that would occur would be short. + + Constify signature of _TIFFsetXXXXArray() functions, and remove unused _TIFFsetString() + + _TIFFVSetField(): when passing a string without explicit length, check that the length doesn't except the 1 << 31 maximum bytes we support + +2022-02-19 Even Rouault + + tiffsplit.c: fix use after free introduced in master per commit 8ed97f401552a2b4300d3c489b03dcada86a21fd (related to #290) + +2022-02-19 Even Rouault + + Merge branch 'Fix_Issue#284' into 'master' + tiff2ps: In limitMalloc() check for negative size (fixes #284) + + Closes #284 + + See merge request libtiff/libtiff!300 + +2022-02-19 Su Laus + + tiff2ps: In limitMalloc() check for negative size (fixes #284) + +2022-02-19 Even Rouault + + Merge branch 'fix_288' into 'master' + tiffinfo: limit more memory allocations using -M switch (fixes #288) + + Closes #288 + + See merge request libtiff/libtiff!299 + +2022-02-19 Even Rouault + + Merge branch 'Fix_Issue#290' into 'master' + tiffsplit: limitMalloc() and getopt() introduced and more error messages. (fixes #290) + + Closes #290 + + See merge request libtiff/libtiff!301 + +2022-02-19 Su Laus + + tiffsplit: limitMalloc() and getopt() introduced and more error messages. (fixes #290) + +2022-02-19 Even Rouault + + Merge branch 'Fix_Issue#273_#275' into 'master' + tiffcrop: buffsize check formula in loadImage() amended (fixes #273,#275) + + Closes #275 et #273 + + See merge request libtiff/libtiff!302 + +2022-02-19 Su Laus + + tiffcrop: buffsize check formula in loadImage() amended (fixes #273,#275) + +2022-02-19 Even Rouault + + TIFFClientOpen(): remove useless initializations of tif_rawcc and tif_flags after TIFFReadDirectory() + Those initializations date back to the initial commit of libtiff, but I + strongly suspect there are no longer needed those days. + Setting tif_rawcc to (tmsize_t)-1 is weird. AFAICS, nowhere else in the library + -1 is used as a special markeri for that field. Immediately after TIFFReadDirectory() + returns it is set to 0, and this is the value used in tif_read.c/tif_write.c to + reset it. + And setting the TIFF_BUFFERSETUP bit of tif_flags is even more + suspicious as the only place where it is set otherwise is in + TIFFWriteBufferSetup(). I suspect this bogus setting of the flag was the + reason for commit dbf2339a1 where BUFFERCHECK() in addition to checking + the bit also checked the tif_rawdata against nullptr. + + If setting those 2 fields was needed, it would mean that TIFFClientOpen() with the + 'h' hint to disable automatic TIFFReadDirectory() would be broken, + because someone issuing a manual TIFFReadDirectory() couldn't set them, + as being private members. + + The libtiff test suite is happy with that change, and the GDAL one too. + +2022-02-19 Even Rouault + + TIFFFetchNormalTag(): speed optimization when reading a (very large) nul-terminated ASCII tag + + TIFFWriteDirectoryTagData(): turn assertion on data length into a runtime check + For example, the assertion could actually be triggered when writing an + ASCII tag with more than 1 << 31 bytes. + +2022-02-17 Even Rouault + + TIFFFetchNormalTag(): avoid calling memcpy() with a null source pointer and size of zero (fixes #383) + +2022-02-15 Roger Leigh + + Merge branch 'tl/fix-cpack' into 'master' + Fix packaging with CPack + + See merge request libtiff/libtiff!292 + +2022-02-11 Even Rouault + + tiffinfo: limit more memory allocations using -M switch (fixes #288) + + tif_dirwrite.c: take into account COMPRESSION_JXL. + +2022-02-11 Even Rouault + + Merge branch 'predictor_2_64bit' into 'master' + Predictor 2 (horizontal differenciation): support 64-bit + + See merge request libtiff/libtiff!296 + +2022-02-10 Even Rouault + + Merge branch 'Fix_Issue#365' into 'master' + tiff2pdf: Fixes issues #365, #258 and #257 related to initializing 't2p->pdf_compressionquality'. + + Closes #257, #258 et #365 + + See merge request libtiff/libtiff!297 + +2022-02-10 Su Laus + + tiff2pdf: Fixes issues #365, #258 and #257 related to initializing 't2p->pdf_compressionquality'. + +2022-02-09 Even Rouault + + Predictor 2 (horizontal differenciation): support 64-bit. + There's no reason not to support 64-bit. The TIFF 6 specification + doesn't say anything about that (and even mention 4-bit, which we don't + support) + +2022-02-09 Even Rouault + + Merge branch 'Fix_Issue#352' into 'master' + tiffcrop.c: Fix issue #352 heap-buffer-overflow by correcting uint32_t underflow. + + Closes #352 + + See merge request libtiff/libtiff!294 + +2022-02-09 Su Laus + + tiffcrop.c: Fix issue #352 heap-buffer-overflow by correcting uint32_t underflow. + +2022-02-08 Even Rouault + + Merge branch 'custom_dir_EXIF_Coverity_fixes' into 'master' + Fix Coverity Scan report issues for custom_dir_EXIF_231.c and test_directory.c + + See merge request libtiff/libtiff!295 + +2022-02-08 Su Laus + + Fix Coverity Scan report issues for custom_dir_EXIF_231.c and test_directory.c + +2022-02-06 Roger Leigh + + Merge branch 'cmake-test' into 'master' + Correct CMake testing + + Closes #317 + + See merge request libtiff/libtiff!291 + +2022-02-06 Even Rouault + + LogLuvEncode32(): avoid undefined behaviour of left shift on a signed integer + + TIFFFetchStripThing(): avoid calling memcpy() with a null source pointer and size of zero (fixes #362) + +2022-02-05 Even Rouault + + TIFFReadDirectory(): avoid calling memcpy() with a null source pointer and size of zero (fixes #362) + +2022-01-29 Even Rouault + + Merge branch 'Jamaika1-master-patch-68264' into 'master' + Added stdlib.h + + See merge request libtiff/libtiff!293 + +2022-01-29 Jamaika + + tif_win32.c: include stdlib.h. + +2022-01-28 Timothy Lyanguzov + + Fix packaging with CPack. + Replace all CMAKE_INSTALL_FULL_ with CMAKE_INSTALL_ to allow CPack setting CMAKE_INSTALL_PREFIX + +2022-01-25 Even Rouault + + Merge branch 'master' into 'master' + Fix the global-buffer-overflow in tiffset + + See merge request libtiff/libtiff!287 + +2022-01-25 4ugustus + + tiffset: fix global-buffer-overflow for ASCII tags where count is required (fixes #355) + +2022-01-23 Roger Leigh + + Merge branch 'autogen' into 'master' + Fix autogen.sh permissions issues during mv + + See merge request libtiff/libtiff!290 + +2022-01-23 Roger Leigh + + Correct CMake testing. + * Use functions rather than macros to avoid problems with variables in + conditions (since macro arguments are not variables) + * Conditionally add to file lists and test program lists based upon the + configuration options (e.g. JPEG and old-JPEG availability) + * Sync tests, files and option usage with current automake usage + +2022-01-19 Will Cohen + + autogen.sh: mv -f for config.sub and config.guess. + +2022-01-12 Even Rouault + + TIFFYCbCrToRGBInit(): avoid Integer-overflow in gdal_TIFFYCbCrToRGBInit. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43559 + +2022-01-10 Even Rouault + + Merge branch 'fix_TIFFFillStrip_wrong_check' into 'master' + Fix sanity check in TIFFFillStrip()/TIFFFillStrile() + + See merge request libtiff/libtiff!288 + +2022-01-10 Even Rouault + + TIFFFillStrip()/TIFFFillStrile(): remove useless test. + + Fix sanity check in TIFFFillStrip()/TIFFFillStrile() + A sanity check comparing the compressed vs uncompressed file that was + originally written 'correctly' but relied on undefined behaviour was + changed in 1b5e3b6a23827c33acf19ad50ce5ce78f12b3773 in an incorrect way. + Fix that. Credits to @burn for spotting this in + https://gitlab.com/libtiff/libtiff/-/issues/343#note_806089714 + +2021-12-29 Even Rouault + + Merge branch 'Fix_FieldName_NULL' into 'master' + Fix Issue #354 Segmentation Fault due to field_name=NULL + + See merge request libtiff/libtiff!285 + +2021-12-29 Even Rouault + + Merge branch 'mingw-static' into 'master' + build: Fix static library imports in mingw + + See merge request libtiff/libtiff!286 + +2021-12-29 Biswapriyo Nath + + build: Fix static library imports in mingw. + This defines LERC_STATIC while creating libtiff static library + in Win32 platform in presence of lerc library. Otherwise, the + static library import lerc APIs with dllimport attribute and + thus linked with shared lerc library. + +2021-12-28 Su_Laus + + Fix Issue #354 Segmentation Fault due to field_name=NULL. + +2021-12-17 Even Rouault + + Merge branch 'fix_342' into 'master' + TIFFGetField(TIFFTAG_STRIPBYTECOUNTS/TIFFTAG_STRIPOFFSETS): return error if... + + Closes #342 + + See merge request libtiff/libtiff!283 + +2021-12-16 Even Rouault + + TIFFGetField(TIFFTAG_STRIPBYTECOUNTS/TIFFTAG_STRIPOFFSETS): return error if returned pointer is NULL (fixes #342) + + tiff2pdf: validate TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc) return (fixes #342) + +2021-12-16 Even Rouault + + Merge branch 'master' into 'master' + fix raw2tiff floating point exception(fixes #338) + + Closes #338 + + See merge request libtiff/libtiff!282 + +2021-12-16 t.feng + + raw2tiff: check that band number if not zero to avoid floating point exception(fixes #338) + +2021-12-14 Even Rouault + + Merge branch 'fix_337' into 'master' + OJPEG: avoid assertion when using TIFFReadScanline() (fixes #337) + + Closes #337 + + See merge request libtiff/libtiff!280 + +2021-12-13 Even Rouault + + OJPEG: avoid assertion when using TIFFReadScanline() (fixes #337) + Note: my analyis of the issue would be that the use of the scanline API + is currently propably broken with OJPEG. + +2021-12-10 Even Rouault + + JPEG 12bit: make it easier for GDAL's RENAME_INTERNAL_LIBTIFF_SYMBOLS mode + +2021-12-09 Even Rouault + + tif_lzw.c: other warning fixes. + + tif_lzw.c: fix warnings of previous commit. + +2021-12-09 Even Rouault + + Merge branch 'lzw_2gb_windows' into 'master' + LZW codec: fix support for strips/tiles > 2 GB on Windows + + See merge request libtiff/libtiff!279 + +2021-12-08 Even Rouault + + LZW codec: fix support for strips/tiles > 2 GB on Windows. + +2021-12-07 Even Rouault + + Merge branch 'fix_287' into 'master' + tiffinfo: add a -M switch to define the maximum heap allocation, and default... + + Closes #287 + + See merge request libtiff/libtiff!278 + +2021-12-06 Even Rouault + + Merge branch 'fix_319' into 'master' + TIFFReadDirectory: fix OJPEG hack (fixes #319) + + Closes #319 + + See merge request libtiff/libtiff!277 + +2021-12-06 Even Rouault + + Merge branch 'fix_309' into 'master' + TIFFAppendToStrip(): fix rewrite-in-place logic (fixes #309) + + Closes #309 + + See merge request libtiff/libtiff!276 + +2021-12-05 Even Rouault + + Merge branch 'b1' into 'master' + Fix resource leak on error path + + See merge request libtiff/libtiff!263 + +2021-12-05 bonniegong + + rast2tiff: Fix resource leak on error path. + +2021-12-05 Even Rouault + + Merge branch 'tiffsplit-leak' into 'master' + tiffsplit.c: Fix memleak before exit + + See merge request libtiff/libtiff!270 + +2021-12-05 Even Rouault + + tiffinfo: add a -M switch to define the maximum heap allocation, and default it to 256 MiB (fixes #287) + + tiffinfo: fix read of invalid pointer in TIFFReadRawDataTiled() (fixes #295) + +2021-12-05 Even Rouault + + TIFFReadDirectory: fix OJPEG hack (fixes #319) + to avoid having the size of the strip arrays inconsistent with the + number of strips returned by TIFFNumberOfStrips(), which may cause + out-ouf-bounds array read afterwards. + + One of the OJPEG hack that alters SamplesPerPixel may influence the + number of strips. Hence compute tif_dir.td_nstrips only afterwards. + +2021-12-04 Even Rouault + + TIFFAppendToStrip(): fix rewrite-in-place logic (fixes #309) + Properly reset tif_curoff when writing strips/tiles + +2021-12-03 Even Rouault + + TIFFReInitJPEG_12(): avoid warning about unused variable in -DNDEBUG. + +2021-12-01 Even Rouault + + Merge branch 'fix_316' into 'master' + TIFFReadCustomDirectory(): avoid crash when reading SubjectDistance tag on a non EXIF directory + + Closes #316 + + See merge request libtiff/libtiff!273 + +2021-12-01 Even Rouault + + Merge branch 'VisualStudio_warnings_suppress' into 'master' + Suppress unnecessary warnings in Visual Studio in AppVeyor test. + + See merge request libtiff/libtiff!234 + +2021-11-30 Even Rouault + + TIFFReadCustomDirectory(): avoid crash when reading SubjectDistance tag on a non EXIF directory + Fixes #316 + + The Valgrind trace was + ``` + TIFFReadCustomDirectory: Warning, Unknown field with tag 37382 (0x9206) encountered. + ==3277355== Invalid read of size 1 + ==3277355== at 0x4842B60: memmove (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) + ==3277355== by 0x48BB799: _TIFFmemcpy (tif_unix.c:346) + ==3277355== by 0x485B3CB: _TIFFVSetField (tif_dir.c:647) + ==3277355== by 0x485C125: TIFFVSetField (tif_dir.c:890) + ==3277355== by 0x485BEDC: TIFFSetField (tif_dir.c:834) + ==3277355== by 0x486DA9A: TIFFFetchSubjectDistance (tif_dirread.c:5826) + ==3277355== by 0x4869E35: TIFFReadCustomDirectory (tif_dirread.c:4530) + ==3277355== by 0x4869F0A: TIFFReadGPSDirectory (tif_dirread.c:4564) + ==3277355== by 0x10AA7A: main (tiffinfo.c:171) + ==3277355== Address 0x3fc856aaaaaaaaab is not stack'd, malloc'd or (recently) free'd + ==3277355== + ``` + +2021-11-29 Even Rouault + + Merge branch 'add-null-check' into 'master' + Added missing null check. + + See merge request libtiff/libtiff!274 + +2021-11-28 Dirk Lemstra + + Added missing null check. + +2021-11-26 Even Rouault + + tif_print.c: remove duplicated if() in previous commit. + +2021-11-26 Even Rouault + + Merge branch 'GPS_Print_BugFix' into 'master' + Fix Segmentation fault printing GPS directory if Altitude tag is present (tif_print.c/tiffinfo.c) + + See merge request libtiff/libtiff!272 + +2021-11-26 Su Laus + + Fix Segmentation fault printing GPS directory if Altitude tag is present (tif_print.c/tiffinfo.c) + +2021-11-01 Even Rouault + + Merge branch 'cmake_tiffconf' into 'master' + Fix STRIPCHOP_DEFAULT value in CMake builds + + See merge request libtiff/libtiff!271 + +2021-11-01 Even Rouault + + Fix STRIPCHOP_DEFAULT value in CMake builds. + CMake builds erroneously used value 1 instead of TIFF_STRIPCHOP, which + resulted in strip chopping not being enabled by default. + +2021-10-26 Even Rouault + + tif_jpeg.c: typo fix. + +2021-10-24 Han Han + + tiffsplit.c: Fix memleak before exit. + Details of the memleak: + $ valgrind --leak-check=full tiffsplit id:001763,sync:fuzzer07,src:001641,+cov + + ==2090657== + ==2090657== HEAP SUMMARY: + ==2090657== in use at exit: 13,517 bytes in 17 blocks + ==2090657== total heap usage: 41 allocs, 24 frees, 29,351 bytes allocated + ==2090657== + ==2090657== 2,473 (1,249 direct, 1,224 indirect) bytes in 1 blocks are definitely lost in loss record 10 of 13 + ==2090657== at 0x484086F: malloc (vg_replace_malloc.c:381) + ==2090657== by 0x48BF35C: TIFFClientOpen (tif_open.c:118) + ==2090657== by 0x48CF058: TIFFFdOpen (tif_unix.c:209) + ==2090657== by 0x48CF0C4: TIFFOpen (tif_unix.c:248) + ==2090657== by 0x10954C: main (tiffsplit.c:91) + ==2090657== + ==2090657== 11,044 (1,300 direct, 9,744 indirect) bytes in 1 blocks are definitely lost in loss record 13 of 13 + ==2090657== at 0x484086F: malloc (vg_replace_malloc.c:381) + ==2090657== by 0x48BF35C: TIFFClientOpen (tif_open.c:118) + ==2090657== by 0x48CF058: TIFFFdOpen (tif_unix.c:209) + ==2090657== by 0x48CF0C4: TIFFOpen (tif_unix.c:248) + ==2090657== by 0x1093D9: main (tiffsplit.c:75) + ==2090657== + ==2090657== LEAK SUMMARY: + ==2090657== definitely lost: 2,549 bytes in 2 blocks + ==2090657== indirectly lost: 10,968 bytes in 15 blocks + ==2090657== possibly lost: 0 bytes in 0 blocks + ==2090657== still reachable: 0 bytes in 0 blocks + ==2090657== suppressed: 0 bytes in 0 blocks + ==2090657== + ==2090657== For lists of detected and suppressed errors, rerun with: -s + ==2090657== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) + +2021-10-20 Even Rouault + + tif_webp.c: add explicit cast to please MSVC verbose warnings. + + tif_webp.c: white space fixing. + +2021-10-04 Even Rouault + + Merge branch 'work/amyspark/psd-blobs' into 'master' + Enable writing Photoshop blobs + + See merge request libtiff/libtiff!269 + +2021-10-04 L. E. Segovia + + Enable writing Photoshop blobs. + +2021-09-29 Even Rouault + + Merge branch 'remove_packbits_hack' into 'master' + PackBitsDecode: remove hack for when char is unsigned. + + See merge request libtiff/libtiff!267 + +2021-09-28 Even Rouault + + PackBitsDecode: remove hack for when char is unsigned. + The function has a hack for platforms where char is unsigned. This is + better replaced by making bp a int8_t* pointer, which is guaranteed to + be signed. + +2021-09-27 Even Rouault + + tiffcrop.c: remove useless 'set but not read' variables. + +2021-09-23 Even Rouault + + Merge branch 'fix_gdal_4538' into 'master' + TIFFAppendToStrip(): fix rewrite-in-place logic + + See merge request libtiff/libtiff!266 + +2021-09-23 Even Rouault + + TIFFAppendToStrip(): fix rewrite-in-place logic. + reproducable in particular with packbits compression. + + Fixes https://github.com/OSGeo/gdal/issues/4538 + +2021-09-17 Even Rouault + + tif_lzw.c: silence compiler warning about set but not used variable with recent clang + +2021-09-07 Even Rouault + + Merge branch 'fix_cygwin' into 'master' + Fix build warnings on cygwin about 'argument 1 of type 'float[3]' with... + + See merge request libtiff/libtiff!265 + +2021-09-06 Even Rouault + + test/rational_precision2double.c: add missing curly braces to fix -Werror=misleading-indentation + +2021-09-05 Even Rouault + + Fix build warnings on cygwin about 'argument 1 of type 'float[3]' with mismatched bound [-Werror=array-parameter=]' + +2021-09-05 Even Rouault + + Merge branch 'rewrite-fix' into 'master' + Fix TIFFRewriteDirectory discarding directories after the rewritten one + + See merge request libtiff/libtiff!264 + +2021-09-05 Facundo Tuesca + + tif_dirwrite.c: Fix TIFFRewriteDirectory discarding directories. + This fixes a bug caused by the `tif_lastdiroff` optimization when + rewriting directories. + + Rewriting the Nth directory temporarily zeroes the pointer to it + (located in the N-1th directory) and relies on `TIFFLinkDirectory` + traversing the whole directory list to find the zeroed pointer and + linking the rewritten directory to it. Since `TIFFLinkDirectory` skips + the traversal when `tif_lastdiroff` is set, this change unsets it + to force the full traversal when rewriting a directory. + + A test to catch this particular issue is also added. + +2021-09-01 Even Rouault + + test_directory.c: fix compiler warnings. + +2021-09-01 Even Rouault + + Merge branch 'multipage-optimization' into 'master' + Keep track of last directory to improve performance for large multi-page files + + See merge request libtiff/libtiff!262 + +2021-08-28 Facundo Tuesca + + Add field to keep track of last written directory. + This adds a new `tif_lastdiroff` field to the TIFF data structure + and uses it to store the offset of the last written directory. + + Appending a new directory required traversing the whole file + to find the last directory. By keeping track of its offset in this + new field, the search is no longer necessary. + + Since this offset is only stored in-memory, the first directory + append after opening a file will have to transverse the whole + directory list. Subsequent calls will have access to the last + offset, avoiding the transversal. + +2021-08-13 Even Rouault + + tif_jpeg.c: fix memory leak on error code path for JPEG 12 bit (CID 1086702) + +2021-07-29 Even Rouault + + Merge branch 'jpeg12' into 'master' + Enable JPEG 12bit support with a libjpeg that has a different ABI than the one for 8bit support + + See merge request libtiff/libtiff!261 + +2021-07-28 Even Rouault + + Reformat tif_jpeg.c and tif_jpeg_12.c with clang-format-10. + +2021-07-27 Even Rouault + + Enable JPEG 12bit support with a libjpeg that has a different ABI than the one for 8bit support + See https://github.com/OSGeo/gdal/pull/4139 for more details + + Note: this hasn't been tested for standalone libtiff builds. + +2021-07-09 Even Rouault + + Merge branch 'wip/export-targets' into 'master' + Export tiff targets + + See merge request libtiff/libtiff!258 + +2021-07-09 Even Rouault + + Merge branch 'pkgconfig' into 'master' + Add version and requirements to pc file + + See merge request libtiff/libtiff!256 + +2021-07-09 Kai Pastor <8989969-dg0yt@users.noreply.gitlab.com> + + Fix version in libtiff-4.pc.in, and CMake build: Add requirements to pc file + +2021-07-09 Even Rouault + + Merge branch 'cmake' into 'master' + Fix build issues with CMake 3.10 + + See merge request libtiff/libtiff!260 + +2021-07-04 Kai Pastor + + Fix reconfiguration with cmake. + + Fix build with CMake 3.10. + +2021-06-28 Milian Wolff + + Export tiff targets. + Fixes build when including libtiff as a cmake subproject into + another project and then installing a target from there which + depends on tiff. For example we could end up with: + + ``` + CMake Error in 3rdParty/diplib/CMakeLists.txt: + export called with target "DIP" which requires target "tiff" that is not in + any export set. + ``` + +2021-06-21 Even Rouault + + Merge branch 'libjpeg9d_support_simplification' into 'master' + tif_jpeg.c: simplify libjpeg 9d support (refs #266) + + See merge request libtiff/libtiff!257 + +2021-06-20 Even Rouault + + tif_jpeg.c: simplify libjpeg 9d support (refs #266) + Credits to Guido Vollbeding for the suggestion + +2021-06-15 Even Rouault + + Merge branch 'jpeg_in_tiff_jpeg_9d' into 'master' + tif_jpeg.c: workaround bug of libjpeg 9d that defers Huffman table creation + + Closes #266 + + See merge request libtiff/libtiff!255 + +2021-06-15 Even Rouault + + Merge branch 'jpeg_disable_progressive_with_mozjpeg' into 'master' + tif_jpeg.c: do not emit progressive scans with mozjpeg and force optimize_coding + + See merge request libtiff/libtiff!254 + +2021-06-12 Even Rouault + + tif_jpeg.c: with mozjpeg, disable emission of Huffman tables in JpegTables tag, and use optimize_coding + +2021-06-10 Even Rouault + + tif_jpeg.c: workaround bug of libjpeg 9d that defers Huffman table creation + Fixes #266 + + libjpeg-9d no longer creates default Huffman tables in + jpeg_set_defaults(), which make their emission in the JpegTables tag no + longer possible. Workaround that by borrowing code from libjpeg to + manually create them when they are not initialized. + +2021-06-10 Even Rouault + + tif_jpeg.c: do not emit progressive scans with mozjpeg. + Relates to #266 + + - On writing, explicitly disable progressive scans, which is normally + not enabled, except with mozjpeg. + - On reading, emit a warning when encountering progressive scans. + +2021-06-10 Even Rouault + + Merge branch 'fix-263' into 'master' + Fix memory leak in tiff2pdf + + See merge request libtiff/libtiff!249 + +2021-06-09 Even Rouault + + Merge branch 'diizzyy-master-patch-20521' into 'master' + html: Add missing pages when using CMake + + See merge request libtiff/libtiff!242 + +2021-06-09 Daniel E + + html: Add missing pages when using CMake. + +2021-06-07 Even Rouault + + Merge branch 'ci-reenable-cygwin' into 'master' + ci: Re-enable cygwin builds + + See merge request libtiff/libtiff!252 + +2021-06-06 Roger Leigh + + ci: Re-enable cygwin builds. + +2021-06-06 Even Rouault + + Merge branch 'ci-arm64' into 'master' + ci: Add arm64 build + + See merge request libtiff/libtiff!251 + +2021-06-06 Roger Leigh + + ci: Add arm64 build. + +2021-06-05 Even Rouault + + _TIFFRewriteField(): fix when writing a IFD with a single tile that is a sparse one, on big endian hosts + +2021-06-02 Timothy Lyanguzov + + Fix memory leak in tiff2pdf. + +2021-06-01 Even Rouault + + Merge branch 'lzw_cleanup' into 'master' + tif_lzw.c: cleanup, no functional change + + See merge request libtiff/libtiff!248 + +2021-05-31 Even Rouault + + tif_lzw.c: cleanup, no functional change. + +2021-05-22 Even Rouault + + Merge branch 'appveyor_disable_cygwin' into 'master' + .appveyor.yml: disable cygwin configs for now as they are broken + + See merge request libtiff/libtiff!247 + +2021-05-22 Even Rouault + + Merge branch 'zstd_reuse_objects' into 'master' + ZSTD codec: reuse compressor/decompressor objects + + See merge request libtiff/libtiff!246 + +2021-05-22 Even Rouault + + .appveyor.yml: disable cygwin configs for now as they are broken. + + ZSTD codec: reuse compressor/decompressor objects. + No need to recreate them each time in the PreEncode/Decode functions. + They can be reused if already existing. + +2021-05-08 Even Rouault + + Merge branch 'adobedeflate-fix' into 'master' + Fix all remaining uses of legacy Deflate compression id and warn on use + + See merge request libtiff/libtiff!245 + +2021-05-08 David Ryskalczyk + + Fix all remaining uses of legacy Deflate compression id and warn on use. + +2021-05-06 Even Rouault + + Merge branch 'improve_tiffinfo_tiffdump_for_gdal_tags' into 'master' + tiffinfo/tiffdump: improve output for GDAL tags + + See merge request libtiff/libtiff!244 + +2021-05-03 Even Rouault + + Merge branch 'issue-252' into 'master' + Prevent adding root directory to include list + + Closes #252 et #218 + + See merge request libtiff/libtiff!243 + +2021-05-03 Even Rouault + + tiffinfo/tiffdump: improve output for GDAL tags. + +2021-04-29 Timothy Lyanguzov + + Prevent adding root directory to include list. + there is a file VERSION in the root directory which clashes with C++20 standard header + "config.h" file is created in "config" subdirectory to prevent adding "-I.." to generated Makefile + + closes #218, #252 + +2021-04-23 Laszlo Boszormenyi (GCS) + + fix TIFFReadRawStrip man and HTML page typo. + From https://github.com/conda-forge/libtiff-feedstock/blob/master/recipe/patches/fix_TIFFReadRawStrip_man_page_typo.patch + +2021-04-20 Even Rouault + + HOWTO-RELEASE: update. + +2021-04-18 Even Rouault + + Merge branch 'lerc_zstd_deflate' into 'master' + Make LERC_SUPPORT conditional on ZLIB_SUPPORT. Make display of lerc options in tiffcp depend on actual zstd support. + + See merge request libtiff/libtiff!239 + +2021-04-18 Miguel Medalha + + Make LERC_SUPPORT conditional on ZLIB_SUPPORT. Make display of lerc options in tiffcp depend on actual zstd support. + +2021-04-17 Even Rouault + + Merge branch 'vtorri_xz' into 'master' + automatic creation of xz archive when running make distcheck + + See merge request libtiff/libtiff!238 + +2021-04-16 Even Rouault + + iptcutil.c: fix bug in EOF comparison, spotted on NetBSD 9 earmv7hf-el. + 2021-04-16 Even Rouault libtiff v4.3.0 released @@ -4735,7 +8568,7 @@ 2016-12-03 Even Rouault * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to - instantiate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip), + instantiate compute nstrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip), instead of a logic based on the total size of data. Which is faulty is the total size of data is not sufficient to fill the whole image, and thus results in reading outside of the StripByCounts/StripOffsets arrays when diff --git a/Source/LibTIFF4/RELEASE-DATE b/Source/LibTIFF4/RELEASE-DATE index e74bf2b..68d9434 100644 --- a/Source/LibTIFF4/RELEASE-DATE +++ b/Source/LibTIFF4/RELEASE-DATE @@ -1 +1 @@ -20210416 +20230908 diff --git a/Source/LibTIFF4/tif_config.h.cmake.in b/Source/LibTIFF4/tif_config.h.cmake.in index bc0717f..86e6b6a 100644 --- a/Source/LibTIFF4/tif_config.h.cmake.in +++ b/Source/LibTIFF4/tif_config.h.cmake.in @@ -40,18 +40,6 @@ /* Define to 1 if you have the `getopt' function. */ #cmakedefine HAVE_GETOPT 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_GLUT_GLUT_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_GL_GLUT_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_GL_GLU_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_GL_GL_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IO_H 1 @@ -61,12 +49,6 @@ /* Define to 1 if you have the `mmap' function. */ #cmakedefine HAVE_MMAP 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_OPENGL_GLU_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_OPENGL_GL_H 1 - /* Define to 1 if you have the `setmode' function. */ #cmakedefine HAVE_SETMODE 1 @@ -100,23 +82,17 @@ /* Define to the full name of this package. */ #define PACKAGE_NAME "@PACKAGE_NAME@" -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "@PACKAGE_STRING@" - /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "@PACKAGE_TARNAME@" /* Define to the home page for this package. */ #define PACKAGE_URL "@PACKAGE_URL@" -/* Define to the version of this package. */ -#define PACKAGE_VERSION "@PACKAGE_VERSION@" - /* Size of size_t */ #define SIZEOF_SIZE_T @SIZEOF_SIZE_T@ /* Default size of the strip in bytes (when strip chopping enabled) */ -#define STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@ +#cmakedefine STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@ /** Maximum number of TIFF IFDs that libtiff can iterate through in a file. */ #define TIFF_MAX_DIR_COUNT @TIFF_MAX_DIR_COUNT@ @@ -124,9 +100,6 @@ /* define to use win32 IO system */ #cmakedefine USE_WIN32_FILEIO 1 -/* Version number of package */ -#define VERSION "@PACKAGE_VERSION@" - /* Support WEBP compression */ #cmakedefine WEBP_SUPPORT 1 diff --git a/Source/LibTIFF4/tif_config.h.in b/Source/LibTIFF4/tif_config.h.in index 2778dfb..28e5a5e 100644 --- a/Source/LibTIFF4/tif_config.h.in +++ b/Source/LibTIFF4/tif_config.h.in @@ -40,18 +40,6 @@ /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT -/* Define to 1 if you have the header file. */ -#undef HAVE_GLUT_GLUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GL_GLUT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GL_GLU_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GL_GL_H - /* Define to 1 if you have the header file. */ #undef HAVE_IO_H @@ -61,12 +49,6 @@ /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENGL_GLU_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_OPENGL_GL_H - /* Define to 1 if you have the `setmode' function. */ #undef HAVE_SETMODE @@ -103,18 +85,12 @@ /* Define to the full name of this package. */ #undef PACKAGE_NAME -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T @@ -127,9 +103,6 @@ /* define to use win32 IO system */ #undef USE_WIN32_FILEIO -/* Version number of package */ -#undef VERSION - /* Support webp compression */ #undef WEBP_SUPPORT diff --git a/Source/LibTIFF4/tif_dirinfo.c b/Source/LibTIFF4/tif_dirinfo.c index 148ad04..c8a4e70 100644 --- a/Source/LibTIFF4/tif_dirinfo.c +++ b/Source/LibTIFF4/tif_dirinfo.c @@ -842,8 +842,8 @@ const TIFFField *TIFFFieldWithTag(TIFF *tif, uint32_t tag) const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY); if (!fip) { - TIFFErrorExtR(tif, "TIFFFieldWithTag", - "Internal error, unknown tag 0x%x", (unsigned int)tag); + TIFFWarningExtR(tif, "TIFFFieldWithTag", "Warning, unknown tag 0x%x", + (unsigned int)tag); } return (fip); } @@ -853,8 +853,8 @@ const TIFFField *TIFFFieldWithName(TIFF *tif, const char *field_name) const TIFFField *fip = _TIFFFindFieldByName(tif, field_name, TIFF_ANY); if (!fip) { - TIFFErrorExtR(tif, "TIFFFieldWithName", - "Internal error, unknown tag %s", field_name); + TIFFWarningExtR(tif, "TIFFFieldWithName", "Warning, unknown tag %s", + field_name); } return (fip); } diff --git a/Source/LibTIFF4/tif_dirread.c b/Source/LibTIFF4/tif_dirread.c index 0a94ab9..a914e04 100644 --- a/Source/LibTIFF4/tif_dirread.c +++ b/Source/LibTIFF4/tif_dirread.c @@ -144,10 +144,11 @@ static void TIFFReadDirEntryCheckedFloat(TIFF *tif, TIFFDirEntry *direntry, float *value); static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF *tif, TIFFDirEntry *direntry, double *value); +#if 0 static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRationalDirect(TIFF *tif, TIFFDirEntry *direntry, TIFFRational_t *value); - +#endif static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8_t value); static enum TIFFReadDirEntryErr @@ -3472,6 +3473,7 @@ TIFFReadDirEntryCheckedSrational(TIFF *tif, TIFFDirEntry *direntry, return (TIFFReadDirEntryErrOk); } +#if 0 static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRationalDirect(TIFF *tif, TIFFDirEntry *direntry, TIFFRational_t *value) @@ -3512,6 +3514,7 @@ TIFFReadDirEntryCheckedRationalDirect(TIFF *tif, TIFFDirEntry *direntry, value->uDenom = m.i[1]; return (TIFFReadDirEntryErrOk); } /*-- TIFFReadDirEntryCheckedRationalDirect() --*/ +#endif static void TIFFReadDirEntryCheckedFloat(TIFF *tif, TIFFDirEntry *direntry, float *value) @@ -4569,7 +4572,8 @@ int TIFFReadDirectory(TIFF *tif) } } break; - /* END REV 4.0 COMPATIBILITY */ + /* END REV 4.0 COMPATIBILITY */ +#if 0 case TIFFTAG_EP_BATTERYLEVEL: /* TIFFTAG_EP_BATTERYLEVEL can be RATIONAL or ASCII. * LibTiff defines it as ASCII and converts RATIONAL to an @@ -4613,6 +4617,7 @@ int TIFFReadDirectory(TIFF *tif) break; } break; +#endif default: (void)TIFFFetchNormalTag(tif, dp, TRUE); break; @@ -5033,7 +5038,7 @@ static void TIFFReadDirectoryCheckOrder(TIFF *tif, TIFFDirEntry *dir, uint16_t dircount) { static const char module[] = "TIFFReadDirectoryCheckOrder"; - uint16_t m; + uint32_t m; uint16_t n; TIFFDirEntry *o; m = 0; diff --git a/Source/LibTIFF4/tif_dirwrite.c b/Source/LibTIFF4/tif_dirwrite.c index d80df27..981cb38 100644 --- a/Source/LibTIFF4/tif_dirwrite.c +++ b/Source/LibTIFF4/tif_dirwrite.c @@ -2073,34 +2073,41 @@ static int TIFFWriteDirectoryTagTransferfunction(TIFF *tif, uint32_t *ndir, (*ndir)++; return (1); } + /* TIFFTAG_TRANSFERFUNCTION expects (1 or 3) pointer to arrays with + * (1 << BitsPerSample) * uint16_t values. + */ m = (1 << tif->tif_dir.td_bitspersample); - n = tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples; + /* clang-format off */ + n = (tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples) > 1 ? 3 : 1; + /* clang-format on */ + + /* Check for proper number of transferfunctions */ + for (int i = 0; i < n; i++) + { + if (tif->tif_dir.td_transferfunction[i] == NULL) + { + TIFFWarningExtR( + tif, module, + "Too few TransferFunctions provided. Tag not written to file"); + return (1); /* Not an error; only tag is not written. */ + } + } /* * Check if the table can be written as a single column, * or if it must be written as 3 columns. Note that we * write a 3-column tag if there are 2 samples/pixel and * a single column of data won't suffice--hmm. */ - if (n > 3) - n = 3; if (n == 3) { - if (tif->tif_dir.td_transferfunction[2] == NULL || - !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0], + if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0], tif->tif_dir.td_transferfunction[2], - m * sizeof(uint16_t))) - n = 2; - } - if (n == 2) - { - if (tif->tif_dir.td_transferfunction[1] == NULL || + m * sizeof(uint16_t)) && !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0], tif->tif_dir.td_transferfunction[1], m * sizeof(uint16_t))) n = 1; } - if (n == 0) - n = 1; o = _TIFFmallocExt(tif, n * m * sizeof(uint16_t)); if (o == NULL) { diff --git a/Source/LibTIFF4/tif_webp.c b/Source/LibTIFF4/tif_webp.c index 07db7cc..bf9d77e 100644 --- a/Source/LibTIFF4/tif_webp.c +++ b/Source/LibTIFF4/tif_webp.c @@ -47,9 +47,11 @@ typedef struct { uint16_t nSamples; /* number of samples per pixel */ - int lossless; /* lossy/lossless compression */ - int quality_level; /* compression level */ - WebPPicture sPicture; /* WebP Picture */ + int lossless; /* lossy/lossless compression */ + int lossless_exact; /* lossless exact mode. If TRUE, R,G,B values in areas + with alpha = 0 will be preserved */ + int quality_level; /* compression level */ + WebPPicture sPicture; /* WebP Picture */ WebPConfig sEncoderConfig; /* WebP encoder config */ uint8_t *pBuffer; /* buffer to hold raw data on encoding */ unsigned int buffer_offset; /* current offset into the buffer */ @@ -149,6 +151,64 @@ static int TWebPDecode(TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s) segment_height = td->td_rowsperstrip; } + int webp_width, webp_height; + if (!WebPGetInfo(tif->tif_rawcp, + (uint64_t)tif->tif_rawcc > UINT32_MAX + ? UINT32_MAX + : (uint32_t)tif->tif_rawcc, + &webp_width, &webp_height)) + { + TIFFErrorExtR(tif, module, "WebPGetInfo() failed"); + return 0; + } + if ((uint32_t)webp_width != segment_width || + (uint32_t)webp_height != segment_height) + { + TIFFErrorExtR( + tif, module, "WebP blob dimension is %dx%d. Expected %ux%u", + webp_width, webp_height, segment_width, segment_height); + return 0; + } + +#if WEBP_DECODER_ABI_VERSION >= 0x0002 + WebPDecoderConfig config; + if (!WebPInitDecoderConfig(&config)) + { + TIFFErrorExtR(tif, module, "WebPInitDecoderConfig() failed"); + return 0; + } + + const bool bWebPGetFeaturesOK = + WebPGetFeatures(tif->tif_rawcp, + (uint64_t)tif->tif_rawcc > UINT32_MAX + ? UINT32_MAX + : (uint32_t)tif->tif_rawcc, + &config.input) == VP8_STATUS_OK; + + WebPFreeDecBuffer(&config.output); + + if (!bWebPGetFeaturesOK) + { + TIFFErrorExtR(tif, module, "WebPInitDecoderConfig() failed"); + return 0; + } + + const int webp_bands = config.input.has_alpha ? 4 : 3; + if (webp_bands != sp->nSamples && + /* We accept the situation where the WebP blob has only 3 bands, + * whereas the raster is 4 bands. This can happen when the alpha + * channel is fully opaque, and WebP decoding works fine in that + * situation. + */ + !(webp_bands == 3 && sp->nSamples == 4)) + { + TIFFErrorExtR(tif, module, + "WebP blob band count is %d. Expected %d", webp_bands, + sp->nSamples); + return 0; + } +#endif + buffer_size = segment_width * segment_height * sp->nSamples; if (occ == (tmsize_t)buffer_size) { @@ -461,6 +521,9 @@ static int TWebPSetupEncode(TIFF *tif) if (sp->lossless) { sp->sPicture.use_argb = 1; +#if WEBP_ENCODER_ABI_VERSION >= 0x0209 + sp->sEncoderConfig.exact = sp->lossless_exact; +#endif } #endif @@ -695,6 +758,17 @@ static int TWebPVSetField(TIFF *tif, uint32_t tag, va_list ap) "Need to upgrade WEBP driver, this version doesn't support " "lossless compression."); return 0; +#endif + case TIFFTAG_WEBP_LOSSLESS_EXACT: +#if WEBP_ENCODER_ABI_VERSION >= 0x0209 + sp->lossless_exact = va_arg(ap, int); + return 1; +#else + TIFFErrorExtR( + tif, module, + "Need to upgrade WEBP driver, this version doesn't support " + "lossless compression."); + return 0; #endif default: return (*sp->vsetparent)(tif, tag, ap); @@ -714,6 +788,9 @@ static int TWebPVGetField(TIFF *tif, uint32_t tag, va_list ap) case TIFFTAG_WEBP_LOSSLESS: *va_arg(ap, int *) = sp->lossless; break; + case TIFFTAG_WEBP_LOSSLESS_EXACT: + *va_arg(ap, int *) = sp->lossless_exact; + break; default: return (*sp->vgetparent)(tif, tag, ap); } @@ -726,6 +803,9 @@ static const TIFFField TWebPFields[] = { {TIFFTAG_WEBP_LOSSLESS, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "WEBP lossless/lossy", NULL}, + {TIFFTAG_WEBP_LOSSLESS_EXACT, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT, + TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "WEBP exact lossless", + NULL}, }; int TIFFInitWebP(TIFF *tif, int scheme) @@ -764,6 +844,7 @@ int TIFFInitWebP(TIFF *tif, int scheme) /* Default values for codec-specific fields */ sp->quality_level = 75; /* default comp. level */ sp->lossless = 0; /* default to false */ + sp->lossless_exact = 1; /* exact lossless mode (if lossless enabled) */ sp->state = 0; sp->nSamples = 0; sp->psDecoder = NULL; diff --git a/Source/LibTIFF4/tif_win32.c b/Source/LibTIFF4/tif_win32.c index 5bc1799..75e0bea 100644 --- a/Source/LibTIFF4/tif_win32.c +++ b/Source/LibTIFF4/tif_win32.c @@ -332,7 +332,7 @@ TIFF *TIFFOpenWExt(const wchar_t *name, const char *mode, TIFFOpenOptions *opts) dwMode = OPEN_EXISTING; break; case O_RDWR: - dwMode = OPEN_ALWAYS; + dwMode = OPEN_EXISTING; break; case O_RDWR | O_CREAT: dwMode = OPEN_ALWAYS; diff --git a/Source/LibTIFF4/tiff.h b/Source/LibTIFF4/tiff.h index e41e9ae..460e165 100644 --- a/Source/LibTIFF4/tiff.h +++ b/Source/LibTIFF4/tiff.h @@ -646,7 +646,7 @@ typedef enum #define TIFFTAG_EP_EXPOSUREINDEX 37397 /* Exposure index */ #define TIFFTAG_EP_STANDARDID 37398 /* TIFF/EP standard version, n.n.n.n */ #define TIFFTAG_EP_SENSINGMETHOD 37399 /* Type of image sensor */ -/* +/* * TIFF/EP tags equivalent to EXIF tags * Note that TIFF-EP and EXIF use nearly the same metadata tag set, but TIFF-EP stores the tags in IFD 0, * while EXIF store the tags in a separate IFD. Either location is allowed by DNG, but the EXIF location is preferred. @@ -761,6 +761,7 @@ typedef enum #define TIFFTAG_LERC_MAXZERROR 65567 /* LERC maximum error */ #define TIFFTAG_WEBP_LEVEL 65568 /* WebP compression level */ #define TIFFTAG_WEBP_LOSSLESS 65569 /* WebP lossless/lossy */ +#define TIFFTAG_WEBP_LOSSLESS_EXACT 65571 /* WebP lossless exact mode. Set-only mode. Default is 1. Can be set to 0 to increase compression rate, but R,G,B in areas where alpha = 0 will not be preserved */ #define TIFFTAG_DEFLATE_SUBCODEC 65570 /* ZIP codec: to get/set the sub-codec to use. Will default to libdeflate when available */ #define DEFLATE_SUBCODEC_ZLIB 0 #define DEFLATE_SUBCODEC_LIBDEFLATE 1 diff --git a/Source/LibTIFF4/tiffio.h b/Source/LibTIFF4/tiffio.h index 31a7b64..67396de 100644 --- a/Source/LibTIFF4/tiffio.h +++ b/Source/LibTIFF4/tiffio.h @@ -277,7 +277,7 @@ typedef struct #define LOGLUV_PUBLIC 1 #endif -#if defined(__GNUC__) || defined(__attribute__) +#if defined(__GNUC__) || defined(__clang__) || defined(__attribute__) #define TIFF_ATTRIBUTE(x) __attribute__(x) #else #define TIFF_ATTRIBUTE(x) /*nothing*/ diff --git a/Source/LibTIFF4/tiffvers.h b/Source/LibTIFF4/tiffvers.h index a20ef9e..56f6508 100644 --- a/Source/LibTIFF4/tiffvers.h +++ b/Source/LibTIFF4/tiffvers.h @@ -1,9 +1,14 @@ +/* tiffvers.h version information is updated according to version information + * in configure.ac */ + /* clang-format off */ /* clang-format disabled because FindTIFF.cmake is very sensitive to the * formatting of below line being a single line. + * Furthermore, configure_file variables of type "@VAR@" are + * modified by clang-format and won't be substituted by CMake. */ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.5.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." +#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.6.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." /* * This define can be used in code that requires * compilation-related definitions specific to a @@ -11,12 +16,13 @@ * version checking should be done based on the * string returned by TIFFGetVersion. */ -#define TIFFLIB_VERSION 20221213 +#define TIFFLIB_VERSION 20230908 /* The following defines have been added in 4.5.0 */ #define TIFFLIB_MAJOR_VERSION 4 -#define TIFFLIB_MINOR_VERSION 5 +#define TIFFLIB_MINOR_VERSION 6 #define TIFFLIB_MICRO_VERSION 0 +#define TIFFLIB_VERSION_STR_MAJ_MIN_MIC "4.6.0" /* Macro added in 4.5.0. Returns TRUE if the current libtiff version is * greater or equal to major.minor.micro diff --git a/Source/LibTIFF4/tiffvers.h.in b/Source/LibTIFF4/tiffvers.h.in index ff7ac37..2089fa1 100644 --- a/Source/LibTIFF4/tiffvers.h.in +++ b/Source/LibTIFF4/tiffvers.h.in @@ -1,9 +1,14 @@ +/* tiffvers.h version information is updated according to version information + * in configure.ac */ + /* clang-format off */ /* clang-format disabled because FindTIFF.cmake is very sensitive to the * formatting of below line being a single line. + * Furthermore, configure_file variables of type "@VAR@" are + * modified by clang-format and won't be substituted by CMake. */ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version LIBTIFF_VERSION\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." +#define TIFFLIB_VERSION_STR "LIBTIFF, Version @LIBTIFF_VERSION@\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." /* * This define can be used in code that requires * compilation-related definitions specific to a @@ -11,12 +16,13 @@ * version checking should be done based on the * string returned by TIFFGetVersion. */ -#define TIFFLIB_VERSION LIBTIFF_RELEASE_DATE +#define TIFFLIB_VERSION @LIBTIFF_RELEASE_DATE@ /* The following defines have been added in 4.5.0 */ -#define TIFFLIB_MAJOR_VERSION LIBTIFF_MAJOR_VERSION -#define TIFFLIB_MINOR_VERSION LIBTIFF_MINOR_VERSION -#define TIFFLIB_MICRO_VERSION LIBTIFF_MICRO_VERSION +#define TIFFLIB_MAJOR_VERSION @LIBTIFF_MAJOR_VERSION@ +#define TIFFLIB_MINOR_VERSION @LIBTIFF_MINOR_VERSION@ +#define TIFFLIB_MICRO_VERSION @LIBTIFF_MICRO_VERSION@ +#define TIFFLIB_VERSION_STR_MAJ_MIN_MIC "@LIBTIFF_VERSION@" /* Macro added in 4.5.0. Returns TRUE if the current libtiff version is * greater or equal to major.minor.micro