We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pillow 10 has removed the ImageDraw.textsize() method. The intended replacement, ImageDraw.textbbox(), is available beginning with Pillow 8.0.0.
ImageDraw.textsize()
ImageDraw.textbbox()
python3.11 -m venv _e . _e/bin/activate pip install .[tests] pip install numpy python -m pytest
=================================== FAILURES =================================== ____________________________ test_render_error_tile ____________________________ def test_render_error_tile(): """ Test rendering of error tile. """ tile_img._error_image.cache_clear() > img = tile_img._error_image(10, 10) geotiler/tests/test_tile_img.py:66: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ width = 10, height = 10 @functools.lru_cache(maxsize=4) def _error_image(width, height): """ Create error tile image. The error tile image is PIL image object showing message that a map tile could not be downloaded. :param width: Width of tile image. :param height: Height of tile image. """ img = PIL.Image.new('RGBA', (width, height)) draw = PIL.ImageDraw.Draw(img) msg = 'Error downloading map tile.' > tw, th = draw.textsize(msg) E AttributeError: 'ImageDraw' object has no attribute 'textsize' geotiler/tile/img.py:87: AttributeError ______________________________ test_render_image _______________________________ def test_render_image(): """ Test rendering map image. """ tile = PIL.Image.new('RGBA', (10, 10)) map = mock.MagicMock() map.size = [30, 20] map.provider.tile_width = 10 map.provider.tile_height = 10 with mock.patch('geotiler.tile.img._tile_image') as tf, \ mock.patch.object(PIL.Image, 'new') as img_new: tf.return_value = tile data = (tile, tile, tile, tile) offsets = ((0, 0), (10, 0), (20, 0), (0, 10)) tiles = _tile_generator(offsets, data) > image = _run_render_image(map, tiles) geotiler/tests/test_tile_img.py:108: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ geotiler/tests/test_tile_img.py:51: in _run_render_image image = loop.run_until_complete(task) /usr/lib64/python3.11/asyncio/base_events.py:653: in run_until_complete return future.result() geotiler/tile/img.py:65: in render_image error = _error_image(provider.tile_width, provider.tile_height) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ width = 10, height = 10 @functools.lru_cache(maxsize=4) def _error_image(width, height): """ Create error tile image. The error tile image is PIL image object showing message that a map tile could not be downloaded. :param width: Width of tile image. :param height: Height of tile image. """ img = PIL.Image.new('RGBA', (width, height)) draw = PIL.ImageDraw.Draw(img) msg = 'Error downloading map tile.' > tw, th = draw.textsize(msg) E ValueError: not enough values to unpack (expected 2, got 0) geotiler/tile/img.py:87: ValueError ___________________________ test_render_image_error ____________________________ def test_render_image_error(): """ Test rendering map image with error tile. """ tile = PIL.Image.new('RGBA', (10, 10)) map = mock.MagicMock() map.size = 30, 20 map.provider.tile_width = 10 map.provider.tile_height = 10 with mock.patch('geotiler.tile.img._tile_image') as tf: tf.return_value = tile data = (tile, tile, None, tile, None, tile) offsets = ((0, 0), (10, 0), (20, 0), (0, 10), (10, 10), (20, 10)) tiles = _tile_generator(offsets, data) > image = _run_render_image(map, tiles) geotiler/tests/test_tile_img.py:128: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ geotiler/tests/test_tile_img.py:51: in _run_render_image image = loop.run_until_complete(task) /usr/lib64/python3.11/asyncio/base_events.py:653: in run_until_complete return future.result() geotiler/tile/img.py:65: in render_image error = _error_image(provider.tile_width, provider.tile_height) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ width = 10, height = 10 @functools.lru_cache(maxsize=4) def _error_image(width, height): """ Create error tile image. The error tile image is PIL image object showing message that a map tile could not be downloaded. :param width: Width of tile image. :param height: Height of tile image. """ img = PIL.Image.new('RGBA', (width, height)) draw = PIL.ImageDraw.Draw(img) msg = 'Error downloading map tile.' > tw, th = draw.textsize(msg) E AttributeError: 'ImageDraw' object has no attribute 'textsize' geotiler/tile/img.py:87: AttributeError [...] =========================== short test summary info ============================ FAILED geotiler/tests/test_tile_img.py::test_render_error_tile - AttributeError: 'ImageDraw' object has no attribute 'textsize' FAILED geotiler/tests/test_tile_img.py::test_render_image - ValueError: not enough values to unpack (expected 2, got 0) FAILED geotiler/tests/test_tile_img.py::test_render_image_error - AttributeError: 'ImageDraw' object has no attribute 'textsize' ========================= 3 failed, 40 passed in 0.49s ========================
The text was updated successfully, but these errors were encountered:
Fixed in commit 5e0cfba.
Sorry, something went wrong.
Thank you! I backported that commit as a patch in Fedora Rawhide, where it seems to work well.
No branches or pull requests
Pillow 10 has removed the
ImageDraw.textsize()
method. The intended replacement,ImageDraw.textbbox()
, is available beginning with Pillow 8.0.0.The text was updated successfully, but these errors were encountered: