dhash icon indicating copy to clipboard operation
dhash copied to clipboard

Deprecation warning with regards to pillow

Open apockill opened this issue 2 years ago • 1 comments

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!

apockill avatar Aug 11 '22 01:08 apockill

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.

benhoyt avatar Aug 11 '22 03:08 benhoyt

Fixed by #11. Will release a new version to PyPI in the next week or so.

benhoyt avatar Oct 19 '22 04:10 benhoyt

This totally slipped my mind. Thanks for the fix!

apockill avatar Oct 19 '22 16:10 apockill