mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
fix image loading when rotating by 0 deg
This commit is contained in:
parent
4f4c982229
commit
3185262e31
|
@ -1572,7 +1572,7 @@ class Image(object):
|
||||||
|
|
||||||
# Fast paths regardless of filter
|
# Fast paths regardless of filter
|
||||||
if angle == 0:
|
if angle == 0:
|
||||||
return self._new(self.im)
|
return self.copy()
|
||||||
if angle == 180:
|
if angle == 180:
|
||||||
return self.transpose(ROTATE_180)
|
return self.transpose(ROTATE_180)
|
||||||
if angle == 90 and expand:
|
if angle == 90 and expand:
|
||||||
|
|
|
@ -11,11 +11,14 @@ class TestImageRotate(PillowTestCase):
|
||||||
self.assertEqual(out.size, im.size) # default rotate clips output
|
self.assertEqual(out.size, im.size) # default rotate clips output
|
||||||
out = im.rotate(angle, expand=1)
|
out = im.rotate(angle, expand=1)
|
||||||
self.assertEqual(out.mode, mode)
|
self.assertEqual(out.mode, mode)
|
||||||
self.assertNotEqual(out.size, im.size)
|
if angle % 180 == 0:
|
||||||
|
self.assertEqual(out.size, im.size)
|
||||||
|
else:
|
||||||
|
self.assertNotEqual(out.size, im.size)
|
||||||
for mode in "1", "P", "L", "RGB", "I", "F":
|
for mode in "1", "P", "L", "RGB", "I", "F":
|
||||||
im = hopper(mode)
|
im = hopper(mode)
|
||||||
rotate(im, mode, 45)
|
rotate(im, mode, 45)
|
||||||
for angle in 90, 270:
|
for angle in 0, 90, 180, 270:
|
||||||
im = Image.open('Tests/images/test-card.png')
|
im = Image.open('Tests/images/test-card.png')
|
||||||
rotate(im, im.mode, angle)
|
rotate(im, im.mode, angle)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user