dhash
dhash copied to clipboard
Deprecation warning with regards to pillow
I noticed this while running tests on a project of mine and thought I'd bring it up:
/long/path/dhash.py:66: DeprecationWarning: ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
small_image = gray_image.resize((width, height), PIL.Image.ANTIALIAS)
Referring to the resize
operation here:
elif PIL is not None and isinstance(image, PIL.Image.Image):
gray_image = image.convert('L')
small_image = gray_image.resize((width, height), PIL.Image.ANTIALIAS)
return list(small_image.getdata())
This was found while using pillow==9.2.0
and dhash==1.3
Cheers!
Hi @apockill -- good find, thanks. Would you be interested in creating a PR to fix it? Ideally we'd fix the code (should be a trivial fix) but also add a GitHub Actions job to install Pillow and run the doctests. If you add the Actions job first it should show up the error, then we can fix it. See here for an example of a Python GitHub Actions configuration.
Fixed by #11. Will release a new version to PyPI in the next week or so.
This totally slipped my mind. Thanks for the fix!