mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Disable fastpath when using center or translate
This commit is contained in:
parent
f286d8bb34
commit
fed4b52171
20
PIL/Image.py
20
PIL/Image.py
|
@ -1582,15 +1582,17 @@ class Image(object):
|
||||||
|
|
||||||
angle = angle % 360.0
|
angle = angle % 360.0
|
||||||
|
|
||||||
# Fast paths regardless of filter
|
# Fast paths regardless of filter, as long as we're not
|
||||||
if angle == 0:
|
# translating or changing the center.
|
||||||
return self.copy()
|
if not (center or translate):
|
||||||
if angle == 180:
|
if angle == 0:
|
||||||
return self.transpose(ROTATE_180)
|
return self.copy()
|
||||||
if angle == 90 and expand:
|
if angle == 180:
|
||||||
return self.transpose(ROTATE_90)
|
return self.transpose(ROTATE_180)
|
||||||
if angle == 270 and expand:
|
if angle == 90 and expand:
|
||||||
return self.transpose(ROTATE_270)
|
return self.transpose(ROTATE_90)
|
||||||
|
if angle == 270 and expand:
|
||||||
|
return self.transpose(ROTATE_270)
|
||||||
|
|
||||||
# Calculate the affine matrix. Note that this is the reverse
|
# Calculate the affine matrix. Note that this is the reverse
|
||||||
# transformation (from destination image to source) because we
|
# transformation (from destination image to source) because we
|
||||||
|
|
Loading…
Reference in New Issue
Block a user