Flask-AppBuilder icon indicating copy to clipboard operation
Flask-AppBuilder copied to clipboard

ANTIALIAS does not exist anymore in the library Pillow version 10

Open befuhro opened this issue 1 year ago • 1 comments

Environment

Flask-Appbuilder version: 4.3.2

pip freeze output: alembic==1.11.1 anyio==3.7.1 apispec==5.2.2 astroid==2.15.6 attrs==23.1.0 Babel==2.12.1 blinker==1.6.2 certifi==2023.5.7 click==8.1.6 colorama==0.4.6 contourpy==1.1.0 cycler==0.11.0 Deprecated==1.2.14 dill==0.3.6 dnspython==2.4.0 email-validator==1.3.1 exceptiongroup==1.1.2 Faker==19.1.0 Flask==2.3.2 Flask-AppBuilder==4.3.2 Flask-Babel==2.0.0 Flask-Cors==4.0.0 Flask-JWT-Extended==4.5.2 Flask-Limiter==3.3.1 Flask-Login==0.6.2 Flask-Migrate==4.0.4 Flask-SQLAlchemy==2.5.1 Flask-WTF==1.1.1 fontawesomefree==6.4.0 fonttools==4.41.0 greenlet==2.0.2 h11==0.14.0 httpcore==0.17.3 idna==3.4 importlib-resources==6.0.0 isort==5.12.0 itsdangerous==2.1.2 Jinja2==3.1.2 jsonschema==4.18.4 jsonschema-specifications==2023.7.1 kiwisolver==1.4.4 lazy-object-proxy==1.9.0 limits==3.5.0 Mako==1.2.4 markdown-it-py==3.0.0 MarkupSafe==2.1.3 marshmallow==3.19.0 marshmallow-enum==1.5.1 marshmallow-sqlalchemy==0.26.1 matplotlib==3.7.2 mccabe==0.7.0 mdurl==0.1.2 numpy==1.25.1 ordered-set==4.1.0 packaging==23.1 pandas==2.0.3 Pillow==10.0.0 platformdirs==3.9.1 pprintpp==0.4.0 prison==0.2.1 pyasn1==0.5.0 pyasn1-modules==0.3.0 Pygments==2.15.1 PyJWT==2.8.0 pylint==2.17.4 pyparsing==3.0.9 python-dateutil==2.8.2 python-ldap==3.4.3 pytz==2023.3 pywaffle==1.1.0 PyYAML==6.0.1 referencing==0.30.0 rich==13.4.2 rpds-py==0.9.2 six==1.16.0 sniffio==1.3.0 SQLAlchemy==1.4.49 SQLAlchemy-Utils==0.41.1 tomli==2.0.1 tomlkit==0.11.8 typing_extensions==4.7.1 tzdata==2023.3 Werkzeug==2.3.6 wrapt==1.15.0 WTForms==3.0.1

Describe the expected results

Should be able to upload an image that needs to be resized

https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/filemanager.py#L216

Describe the actual results

Could not upload an image that needs to be resized

Exception seems to be caught and displayed in GUI: module 'PIL.Image' has no attribute 'ANTIALIAS'

Steps to reproduce

Uploading an image file that needs to be resized

More

It seems that the filter ANTIALIAS has been deprecated and does not exist anymore in the library Pillow since version 10 https://stackoverflow.com/questions/76616042/attributeerror-module-pil-image-has-no-attribute-antialias

befuhro avatar Jul 31 '23 07:07 befuhro

@befuhro if you want to submit a PR you could look at how Apache Superset (built on FAB) fixed this problem: https://github.com/apache/superset/pull/25931/files

sfirke avatar Nov 29 '23 19:11 sfirke