Skip to content

Commit

Permalink
sorl/thumbnail/engines/pil_engine.py - Changed code to a more readabl…
Browse files Browse the repository at this point in the history
…e format.
  • Loading branch information
uri-rodberg authored and claudep committed Aug 8, 2022
1 parent 98b71b2 commit d9d9a2b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions sorl/thumbnail/engines/pil_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
import ImageDraw
import ImageMode

ANTIALIAS = Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.ANTIALIAS
if hasattr(Image, 'Resampling'):
ANTIALIAS = Image.Resampling.LANCZOS
else:
ANTIALIAS = Image.ANTIALIAS
# Image.Transpose added in 9.1.0
FLIP_LEFT_RIGHT = (
Image.Transpose.FLIP_LEFT_RIGHT if hasattr(Image, 'Transpose') else Image.FLIP_LEFT_RIGHT
)
FLIP_TOP_BOTTOM = (
Image.Transpose.FLIP_TOP_BOTTOM if hasattr(Image, 'Transpose') else Image.FLIP_TOP_BOTTOM
)
if hasattr(Image, 'Transpose'):
FLIP_LEFT_RIGHT = Image.Transpose.FLIP_LEFT_RIGHT
FLIP_TOP_BOTTOM = Image.Transpose.FLIP_TOP_BOTTOM
else:
FLIP_LEFT_RIGHT = Image.FLIP_LEFT_RIGHT
FLIP_TOP_BOTTOM = Image.FLIP_TOP_BOTTOM
EXIF_ORIENTATION = 0x0112


Expand Down

0 comments on commit d9d9a2b

Please sign in to comment.