Closed SamR1 closed 1 year ago
Hi @SamR1 and thanks for your contribution. This code will work now for recent versions of PIL, will it also work for old versions? Do you know when/which version of PIL introduced Image.LANCZOS ?
Hi,
Thanks for your feedback.
The constant Image.ANTIALIAS
was deprecated in 9.1.0 (2022-04-01): https://pillow.readthedocs.io/en/stable/releasenotes/9.1.0.html#deprecations.
The constant Image.LANCZOS
was added in 2.7.0 (2015-01-01) and ANTIALIAS
is left as an alias for LANCZOS
: https://pillow.readthedocs.io/en/stable/releasenotes/2.7.0.html#antialias-renamed-to-lanczos.
FYI, in another branch I add a test on rendering (I didn't push the test in this pull request, since the tile server call is not mocked :/, but I can at least add GitHub Actions on existing tests, if you want). So to check rendering with different versions of Pillow, I set another branch. Rendering fails with Pillow <2.7 and python 3.8 (with a more recent version of Python, it fails with Pillow <6 due to Python version incompatibilities, see Python version matrix).
It should be OK to let Pillow version unpinned in this case since LANCZOS
was added in 2.7.0 (but I don't know if there are any other incompatibilities with latest version of Pillow).
Thanks for checking and your detailed explanation. There is definitely no need for fixing backward compatibility with a version that is 8 years ago. I will merge now and release a new version next week when I am back from holidays and in front of my computer
And I’d welcome any improvement regarding ci and test coverage. This repo aged over time.
Thanks for your feedback! I'll open a PR with GitHub action and existing tests on supported python versions.
Have a good holiday!
Hi,
The latest release of Pillow removed some constants, including
Image.ANTIALIAS
, which causes this error:As indicated in the documentation, I have replaced it with
Image.LANCZOS
. The following snippet generates an image without errors: