Notification time stamped 2023-07-31 23:16:35 UTC
From b198c4c3351873d1e3e2b685a01f1b7a948dfaeb Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley code@musicinmybrain.net Date: Jul 31 2023 23:04:58 +0000 Subject: Patch for Pillow 10 (fix RHBZ#2220253, fix RHBZ#2226199)
---
diff --git a/geotiler-0.14.7-pillow10.patch b/geotiler-0.14.7-pillow10.patch new file mode 100644 index 0000000..d841472 --- /dev/null +++ b/geotiler-0.14.7-pillow10.patch @@ -0,0 +1,44 @@ +From 5e0cfbafcda83ca14cfe6c63b2a791d4ad6c338b Mon Sep 17 00:00:00 2001 +From: wrobell wrobell@riseup.net +Date: Mon, 31 Jul 2023 21:54:13 +0100 +Subject: [PATCH] Update GeoTiler to use Pillow newer API + +Some Pillow API got deprecated, so let's use the latest version of the +library. +--- + geotiler/tile/img.py | 8 ++++++-- + setup.cfg | 2 +- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/geotiler/tile/img.py b/geotiler/tile/img.py +index d5349a0..aa775b4 100644 +--- a/geotiler/tile/img.py ++++ b/geotiler/tile/img.py +@@ -84,8 +84,12 @@ def _error_image(width, height): + img = PIL.Image.new('RGBA', (width, height)) + draw = PIL.ImageDraw.Draw(img) + msg = 'Error downloading map tile.' +- tw, th = draw.textsize(msg) +- draw.text(((width - tw) // 2, (height - th) // 2), msg, 'red') ++ x0 = width / 2 ++ y0 = height / 2 ++ bb_l, bb_t, bb_r, bb_b = draw.textbbox((int(x0), int(y0)), msg) ++ x = x0 + (bb_r - bb_l) / 2 ++ y = y0 + (bb_b - bb_t) / 2 ++ draw.text((int(x), int(y)), msg, 'red') + return img + + def _tile_image(data): +diff --git a/setup.cfg b/setup.cfg +index bc9b04e..170303a 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -28,7 +28,7 @@ scripts = + bin/geotiler-route + bin/geotiler-fetch + install_requires = +- Pillow ++ Pillow >= 10.0.0 + cytoolz >= 0.8.2 + aiohttp >= 2.3.5 + setuptools diff --git a/python-geotiler.spec b/python-geotiler.spec index 3477e29..45a5a3e 100644 --- a/python-geotiler.spec +++ b/python-geotiler.spec @@ -38,6 +38,10 @@ Source4: geotiler-route.1 # https://github.com/wrobell/geotiler/pull/37 # Rebased on the PyPI sdist, which has different whitespace in setup.cfg. Patch: geotiler-0.14.7-tests.patch +# Update GeoTiler to use Pillow newer API +# https://github.com/wrobell/geotiler/commit/5e0cfbafcda83ca14cfe6c63b2a791d4a... +# Rebased on the 0.14.7 PyPI sdist (whitespace differs in setup.cfg) +Patch: geotiler-0.14.7-pillow10.patch
BuildRequires: python3-devel BuildRequires: make @@ -133,6 +137,7 @@ install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ %changelog * Mon Jul 31 2023 Benjamin A. Beasley code@musicinmybrain.net - 0.14.7-4 - Patch out unused uvloop test dependency +- Patch for Pillow 10 (fix RHBZ#2220253, fix RHBZ#2226199)
* Fri Jul 21 2023 Fedora Release Engineering releng@fedoraproject.org - 0.14.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
https://src.fedoraproject.org/rpms/python-geotiler/c/b198c4c3351873d1e3e2b68...