ome / omero-web

Django-based OMERO.web client
https://www.openmicroscopy.org/omero
16 stars 29 forks source link

Use Image.LANCZOS alias rather than Image.ANTIALIAS #487

Closed sbesson closed 1 year ago

sbesson commented 1 year ago

These aliases are strictly equivalent but the latter has been deprecated in Pillow 9.1 and dropped in Pillow 10 - see https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html

See also https://github.com/ome/omero-py/pull/376

knabar commented 1 year ago

For future reference, Image.LANCZOS was also deprecated in Pillow 9.1.0 but reinstated in 9.4.0 (see https://pillow.readthedocs.io/en/stable/releasenotes/9.4.0.html#restored-image-constants), so there's a lot of outdated Google results about it being deprecated.

sbesson commented 1 year ago

Thanks @knabar, there was indeed a deprecation dance happening upstream. Also adding a bit of additional context, Image.LANCZOS was chosen rather than the Image.Resampling.LANCZOS primarily because the second form would require to introduce a minimal dependency on Pillow>=9.1.0 which introduced the enum classes.