misc: use PIL.Image.Resampling.LANCZOS instead of PIL.Image.LANCZOS (#71899)
PIL.Image.LANCZOS is deprecated.
This commit is contained in:
parent
3fcbe2198c
commit
855bb179b0
|
@ -147,7 +147,12 @@ class ProfileImageField(FileField):
|
|||
box[3] += box[1]
|
||||
|
||||
image = image.crop(box)
|
||||
return image.resize([width, height], PIL.Image.LANCZOS)
|
||||
try:
|
||||
resampling_algorithm = PIL.Image.Resampling.LANCZOS
|
||||
except AttributeError:
|
||||
# can be removed when Pillow < 9.1.0 is not supported anymore
|
||||
resampling_algorithm = PIL.Image.LANCZOS
|
||||
return image.resize([width, height], resampling_algorithm)
|
||||
|
||||
|
||||
class ValidatedEmailField(EmailField):
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -179,6 +179,7 @@ filterwarnings =
|
|||
error:.*please use dns.resolver.resolve:DeprecationWarning:
|
||||
error:.*Passing None for the middleware get_response argument is deprecated.*::
|
||||
error:.*ANTIALIAS is deprecated and will be removed in Pillow 10::
|
||||
error:.*LANCZOS.*Pillow 10::
|
||||
junit_family=xunit2
|
||||
|
||||
[coverage:run]
|
||||
|
|
Loading…
Reference in New Issue