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

AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' #2375

Open
pankus opened this issue Aug 31, 2023 · 3 comments
Open

AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' #2375

pankus opened this issue Aug 31, 2023 · 3 comments

Comments

@pankus
Copy link

pankus commented Aug 31, 2023

https://github.com/flask-admin/flask-admin/blob/896fca64f7eb7970bb5775c2c9ff6b3a07c9de4a/flask_admin/form/upload.py#L467C21-L467C21

ANTIALIAS was removed in Pillow 10.0.0 (after being deprecated through many previous versions). Now you need to use PIL.Image.LANCZOS or PIL.Image.Resampling.LANCZOS. https://stackoverflow.com/a/76616129/5541592

Line 467 must be corrected. Even better, I presume, if a user can manage the compression type using some user-defined parameter.

@skwzrd
Copy link

skwzrd commented Oct 24, 2023

Seems like this was fixed on the master branch (currently version 1.6.1),
https://github.com/flask-admin/flask-admin/blob/14e24c970f0ee3a29add830612eee9a0b0ba5dcc/flask_admin/form/upload.py#L464

And here is the commit 96b92de

I tested uploading a file, and didn't receive any errors.

@urshulgi
Copy link

Seems like this was fixed on the master branch (currently version 1.6.1),

Maybe I'm wrong but I can see the commit and this is from August 9, 2023:
image

And the version was released June 19:
image

So the fix was added two months later?

And another thing, I can see 1.6.1 being on a different date on pypi, February 20 (Which matches the tag build):
image

I just downloaded the source code that is attached to the release here on GH for 1.6.1 and still can see ANTIALIAS:
image

And I have got the error despite reinstalling the library a few times:
image

@samuelhwilliams
Copy link
Contributor

You're right - it looks like this change hasn't been released yet. This project has just been transferred under to the pallets ecosysytem project, so hopefully we can get a release lined up shortly, but we have some admin to take care of first.

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

No branches or pull requests

4 participants