From 2fcadec505dd4214dbb7dd6e41d2d9552f661372dfe5cb24682a558edb8d0c15 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Wed, 1 Jun 2022 15:44:59 +0000 Subject: [PATCH] Accepting request 980378 from home:mcalabkova:branches:devel:languages:python - Add patch tiff-readcount.patch to fix build with the new tiff OBS-URL: https://build.opensuse.org/request/show/980378 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=129 --- python-Pillow.changes | 5 +++++ python-Pillow.spec | 2 ++ tiff-readcount.patch | 44 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 tiff-readcount.patch diff --git a/python-Pillow.changes b/python-Pillow.changes index 4e68599..de44c10 100644 --- a/python-Pillow.changes +++ b/python-Pillow.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 1 12:28:33 UTC 2022 - Markéta Machová + +- Add patch tiff-readcount.patch to fix build with the new tiff + ------------------------------------------------------------------- Sun May 29 18:37:16 UTC 2022 - Dirk Müller diff --git a/python-Pillow.spec b/python-Pillow.spec index 7f5860e..60aa7a6 100644 --- a/python-Pillow.spec +++ b/python-Pillow.spec @@ -26,6 +26,8 @@ Summary: Python Imaging Library (Fork) License: HPND URL: https://python-pillow.org/ Source: https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/python-pillow/Pillow/commit/40a918d274182b7d7c063d7797fb77d967982c4a Set readcount to TIFF_VARIABLE for a variable number of values +Patch0: tiff-readcount.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module olefile} BuildRequires: %{python_module pytest >= 4.0} diff --git a/tiff-readcount.patch b/tiff-readcount.patch new file mode 100644 index 0000000..b37e9c6 --- /dev/null +++ b/tiff-readcount.patch @@ -0,0 +1,44 @@ +From 40a918d274182b7d7c063d7797fb77d967982c4a Mon Sep 17 00:00:00 2001 +From: Andrew Murray +Date: Sat, 28 May 2022 20:14:05 +1000 +Subject: [PATCH] Set readcount to TIFF_VARIABLE for a variable number of + values + +--- + src/libImaging/TiffDecode.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c +index f818f19d50..3bb444c804 100644 +--- a/src/libImaging/TiffDecode.c ++++ b/src/libImaging/TiffDecode.c +@@ -815,11 +815,11 @@ ImagingLibTiffMergeFieldInfo( + + // custom fields added with ImagingLibTiffMergeFieldInfo are only used for + // decoding, ignore readcount; +- int readcount = 1; ++ int readcount = is_var_length ? TIFF_VARIABLE : 1; + // we support writing a single value, or a variable number of values +- int writecount = 1; ++ int writecount = is_var_length ? TIFF_VARIABLE : 1; + // whether the first value should encode the number of values. +- int passcount = 0; ++ int passcount = (is_var_length && field_type != TIFF_ASCII) ? 1 : 0; + + TIFFFieldInfo info[] = { + {key, +@@ -831,14 +831,6 @@ ImagingLibTiffMergeFieldInfo( + passcount, + "CustomField"}}; + +- if (is_var_length) { +- info[0].field_writecount = -1; +- } +- +- if (is_var_length && field_type != TIFF_ASCII) { +- info[0].field_passcount = 1; +- } +- + n = sizeof(info) / sizeof(info[0]); + + // Test for libtiff 4.0 or later, excluding libtiff 3.9.6 and 3.9.7