Skip to content
New issue

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 deprecating ANTIALIAS #566

Closed
chemeng opened this issue Jul 6, 2023 · 5 comments
Closed

Pillow deprecating ANTIALIAS #566

chemeng opened this issue Jul 6, 2023 · 5 comments

Comments

@chemeng
Copy link

chemeng commented Jul 6, 2023

Installing the latest version of Pillow 10.0.0 breaks part of the resizing code:

  File "/home/appuser/.local/lib/python3.10/site-packages/pilkit/processors/resize.py", line 24, in process
    img = img.resize((self.width, self.height), Image.ANTIALIAS)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

reference: https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#constants

@Alexerson
Copy link
Contributor

See also matthewwithanm/pilkit#64

@vnagendra
Copy link

In case anyone else is running into this issue, I was able to get around this by using a fork of the pilkit package.

In my requirements.in..

django-imagekit
git+https://github.com/sereema/pilkit

That added the correct library to my requirements.txt..

pilkit @ git+https://github.com/sereema/pilkit
    # via
    #   -r requirements.in
    #   django-imagekit

The only funny thing I had to do was to uninstall (on my local) and reinstall. I wasn't using this library extensively or anything, just making 1 thumbnail. YMMW.

cdubz added a commit to babybuddy/babybuddy that referenced this issue Jul 29, 2023
Fixes #684

Django-imagekit has a dependency on pilkit which is using the removed attribute.

See:
 - matthewwithanm/django-imagekit#566
 - matthewwithanm/pilkit#64
@jtremesay-sereema
Copy link

Hi @vnagendra. I’m the "maintainer" of sereema/pilkit.
For your information, this is a temporary fork until upstream fix the issue. You should not rely on it :)

@vnagendra
Copy link

Noted. There just wasn’t anything that had small changes like this. I’ll keep any eye out for upstream fix and then change to it when fixed

@vstoykov
Copy link
Collaborator

The new release of pilkit is uploaded to PyPi that adds compatibility with Pillow 10. You can update your dependencies and it will start working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants