| |
@@ -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
|
| |
https://github.com/wrobell/geotiler/pull/37
Also patches out the
pytest-cov
dependency.This
still FTBFS on F39/Rawhide due toalso fixes a Pillow 10 incompatibility, https://github.com/wrobell/geotiler/issues/36.