libtiff: Prepare for v4.5.1 release

From 8e424c701ef58af4cdcaab239f45ba612935e1fc Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Fri, 9 Jun 2023 14:38:34 +0200
Subject: [PATCH] Prepare for v4.5.1 release

---
 ChangeLog               | 136 ++++++++++++++++++++++++++++++++++++++++
 RELEASE-DATE            |   2 +-
 doc/index.rst           |  10 +++
 doc/releases/v4.5.1.rst |  57 +++++++++--------
 libtiff/tiffvers.h      |   2 +-
 5 files changed, 179 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9d26af85..21248161 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,139 @@
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	libtiff v4.5.1 released
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation'
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_577' into 'master'
+	CMake related fixes
+
+	Closes #577
+
+	See merge request libtiff/libtiff!496
+
+2023-06-07  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <theta682@gmail.com>
+
+	Apply 1 suggestion(s) to 1 file(s)
+
+2023-06-05  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <even.rouault@spatialys.com>
+
+	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  <sulau@freenet.de>
+
+	TIFFFieldWithName() and TIFFFieldWithTag() downgrade errors to warnings. see https://gitlab.com/libtiff/libtiff/-/issues/575#note_1407633888
+
+2023-05-25  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <benni.buch@gmail.com>
+
+	check if upstream lzma (xz) config was used and bind to it if so.
+
+2023-05-25  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <even.rouault@spatialys.com>
+
+	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  <sulau@freenet.de>
+
+	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>_LIBRARY_RELEASE nor <library>_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  <benni.buch@gmail.com>
+
+	prefer shared over static.
+
+	check if upstream zstd config was used and bind to it if so.
+
+2023-05-24  Even Rouault  <even.rouault@spatialys.com>
+
+	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  <benni.buch@gmail.com>
+
+	CMake: make WebP component name compatible with upstream ConfigWebP.cmake
+
+2023-05-18  Su_Laus  <sulau@freenet.de>
+
+	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  <even.rouault@spatialys.com>
+
+	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  <even.rouault@spatialys.com>
+
+	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  <even.rouault@spatialys.com>
 
 	Merge branch 'fix_559_DNG_1.6_passcount_error' into 'master'
diff --git a/RELEASE-DATE b/RELEASE-DATE
index f84acaf5..a4ca097f 100644
--- a/RELEASE-DATE
+++ b/RELEASE-DATE
@@ -1 +1 @@
-20230507
+20230609
diff --git a/doc/index.rst b/doc/index.rst
index 99f7ea4b..d08a51ca 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -35,6 +35,16 @@ your needs for reading and writing TIFF images.
 LibTIFF is portable software, supported on various operating systems including
 UNIX (Linux, BSD, MacOS X) and Windows.
 
+.. warning::
+
+    libtiff v4.5.1 will be the last one supporting most TIFF tools (except tiffinfo,
+    tiffdump, tiffcp and tiffset), whose maintenance will be discontinued, due
+    to the lack of contributors able to address reported security issues.
+    Starting with libtiff v4.6.0, their source code, at this time ,will still be
+    available in the source distribution, but they will no longer be built by
+    default, and issues related to them will no longer be accepted in the
+    libtiff bug tracker.
+
 The following sections are included in this documentation:
 
 .. toctree::
diff --git a/doc/releases/v4.5.1.rst b/doc/releases/v4.5.1.rst
index 9abadf3e..3496dccf 100644
--- a/doc/releases/v4.5.1.rst
+++ b/doc/releases/v4.5.1.rst
@@ -18,12 +18,15 @@ software between the *previous* and *current* versions (see
 above). A fully-detailed change summary is provided by the :file:`ChangeLog` file
 included in the release package and by the Git commit history:
 
-.. note::
+.. warning::
 
-    This version will be the last one supporting TIFF tools.
-    TIFF tools maintenance will be discontinued.
-    The source code at this time will still be available
-    in the /archive/tools directory.
+    This version will be the last one supporting most TIFF tools (except tiffinfo,
+    tiffdump, tiffcp and tiffset), whose maintenance will be discontinued, due
+    to the lack of contributors able to address reported security issues.
+    Starting with libtiff v4.6.0, their source code, at this time ,will still be
+    available in the source distribution, but they will no longer be built by
+    default, and issues related to them will no longer be accepted in the
+    libtiff bug tracker.
 
 Major changes
 -------------
@@ -33,26 +36,29 @@ None
 Software configuration changes
 ------------------------------
 
-* test: add :file:`test_write_read_tags.c`, which writes and then 
-  reads and checks nearly all tags defined in :file:`tif_dirinfo.c`.
-
 * Definition of tags reformatted (clang-format off) for better
   readability of tag comments in tiff.h and tif_dirinfo.c
 
 * Do not install libtiff-4.pc when tiff-install is reset.
 
-* test: avoid running tool tests if not built
-  (:issue:`421`).
-
-* test: test added within test_ifd_loop_detection.c
-  to check loops in SubIFDs that are chained.
-
 * Add versioninfo resource files for DLL and tools
   compiled with Windows MSVC and MINGW.
 
 * Disable clang-formatting for tif_config.h.cmake.in and
   tiffconf.h.cmake.in because sensitive for CMake scripts.
 
+* CMake: make WebP component name compatible with upstream ConfigWebP.cmake
+
+* CMake: make Findliblzma with upstream CMake config file
+
+* CMake: FindDeflate.cmake: fix several errors (:issue:`526`).
+
+* CMake: FindLERC.cmake: version string return added.
+
+* CMake: export TiffConfig.cmake and TiffConfigVersion.cmake files
+
+* CMake: fix export of INTERFACE_INCLUDE_DIRECTORIES
+
 Library changes
 ---------------
 
@@ -62,19 +68,11 @@ New/improved functionalities:
   :c:func:`TIFFOpen` to warn and an alias of FILLORDER_MSB2LSB. 
   :file:`tif_lerc.c`: use WORDS_BIGENDIAN instead of HOST_BIGENDIAN.
 
-* Add DNG tags up to version 1.6.0.0 and some TIFF/EP tags and update documentation.
-	- 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.
-
 * Optimize relative seeking within :c:func:`TIFFSetDirectory`
   by using the learned list of IFD offsets.
 
 * Improve internal IFD offset and directory number map handling.
 
-* manpage: add multi page TIFF and SubIFDs description and read / write example.
-
 * Behavior of :c:func:`TIFFOpen`  mode "r+" in the Windows implementation
   adjusted to that of Linux.
 
@@ -87,7 +85,7 @@ Bug fixes:
 * TIFFDirectory td_fieldsset type changed from unsigned long, which can
   be 32 or 64 bits, to uint32_t (fixes :issue:`484`).
 
-*	tif_ojpeg.c: checking for division by zero (fixes :issue:`554`).
+* tif_ojpeg.c: checking for division by zero (fixes :issue:`554`).
 
 * LZWDecode(): avoid crash when trying to read again from a strip whith
   a missing end-of-information marker (fixes :issue:`548`).
@@ -95,8 +93,6 @@ Bug fixes:
 * Fixed runtime error: applying zero offset to null pointer
   in :c:func:`countInkNamesString`.
 
-* tif_ovrcache.c: check :c:func:`TIFFSetSubDirectory` return value (CID 1524573).
-
 * Fixing crash in :c:func:`TIFFUnlinkDirectory` when called with
   directory number zero ("TIFFUnlinkDirectory(**0**)") as well as fixing
   incorrect behaviour when unlinking the first directory.
@@ -124,6 +120,13 @@ Bug fixes:
 * LZWDecode(): avoid crash when trying to read again from a strip whith
   a missing end-of-information marker (:issue:`548`).
 
+Documentation
+-------------
+
+* mention TIFFSetTagExtender() cannot add tags to custom directories.
+
+* manpage: add multi page TIFF and SubIFDs description and read / write example.
+
 Tools changes
 -------------
 
@@ -133,7 +136,7 @@ New/improved functionality:
 
 Bug fixes:
 
-*	:program:`tiffcrop`: Consider error return of writeSelections() (fixes :issue:`553`).
+* :program:`tiffcrop`: Consider error return of writeSelections() (fixes :issue:`553`).
 
 * :program:`tiffcrop`: fix memory leak
   (:issue:`475`).
@@ -165,6 +168,8 @@ Bug fixes:
 
 * :program:`tiffcrop`: fix :issue:`553` by considering error return of writeSelections().
 
+* tif_ovrcache.c: check :c:func:`TIFFSetSubDirectory` return value (CID 1524573).
+
 
 Contributed software changes
 ----------------------------
diff --git a/libtiff/tiffvers.h b/libtiff/tiffvers.h
index 9b9383d7..ed847760 100644
--- a/libtiff/tiffvers.h
+++ b/libtiff/tiffvers.h
@@ -11,7 +11,7 @@
  * version checking should be done based on the
  * string returned by TIFFGetVersion.
  */
-#define TIFFLIB_VERSION 20230507
+#define TIFFLIB_VERSION 20230609
 
 /* The following defines have been added in 4.5.0 */
 #define TIFFLIB_MAJOR_VERSION 4