Skip to content

Commit

Permalink
fix: Pillow ANTIALIAS deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dulmandakh authored and claudep committed May 24, 2022
1 parent f62c617 commit 8d7bd40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sorl/thumbnail/engines/pil_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import ImageDraw
import ImageMode

ANTIALIAS = Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.ANTIALIAS
EXIF_ORIENTATION = 0x0112


Expand Down Expand Up @@ -230,7 +231,7 @@ def _entropy_crop(self, image, geometry_width, geometry_height, image_width, ima
_get_image_entropy = staticmethod(histogram_entropy)

def _scale(self, image, width, height):
return image.resize((width, height), resample=Image.ANTIALIAS)
return image.resize((width, height), resample=ANTIALIAS)

def _crop(self, image, width, height, x_offset, y_offset):
return image.crop((x_offset, y_offset,
Expand Down

0 comments on commit 8d7bd40

Please sign in to comment.