SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.37k stars 312 forks source link

fix #600: Сhange deprecated pillow constants #601

Closed dnazymok closed 1 year ago

dnazymok commented 2 years ago

Fixes #600

Changed the constants, which will be removed in Pillow 10.0.0 based on list: https://pillow.readthedocs.io/en/stable/releasenotes/9.1.0.html#deprecations

jaap3 commented 2 years ago

easy_thumbnails does not set a lower bound for the Pillow requirement. In practice this can mean that any old version of Pillow might be used together with easy-thumbnails. These new constants have been introduced recently, and do not exist on older versions. I think some sort of compatibility shim should be in place.

jrief commented 2 years ago

@dnazymok in which version did Pillow introduce the new constants Image.Resampling.LANCZOS and Image.Transpose.…?

I then would also like to see a minimum requirement constraint here: https://github.com/SmileyChris/easy-thumbnails/blob/bc39d7ec3f4c72b000a82f7838eb3c16bcaa86c7/setup.py#L36

dnazymok commented 2 years ago

@dnazymok in which version did Pillow introduce the new constants Image.Resampling.LANCZOS and Image.Transpose.…?

I then would also like to see a minimum requirement constraint here:

https://github.com/SmileyChris/easy-thumbnails/blob/bc39d7ec3f4c72b000a82f7838eb3c16bcaa86c7/setup.py#L36

As I found out, these constants were added in the new version 9.1.0, so I added some compatibility in the last commit

dnazymok commented 2 years ago

@jrief can you look at the last commit, it solves the compatibility problem

sHooPmyWooP commented 1 year ago

Any update on this? I'd really like to get rid of the Warnings.