mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +03:00
Merge pull request #3147 from fozcode/fix-fillcolor
Fix transform fill color for alpha images
This commit is contained in:
commit
be29d02652
|
@ -109,6 +109,19 @@ class TestImageRotate(PillowTestCase):
|
|||
im = im.rotate(45, fillcolor='white')
|
||||
self.assert_image_equal(im, target)
|
||||
|
||||
def test_alpha_rotate_no_fill(self):
|
||||
# Alpha images are handled differently internally
|
||||
im = Image.new('RGBA', (10, 10), 'green')
|
||||
im = im.rotate(45, expand=1)
|
||||
corner = im.getpixel((0,0))
|
||||
self.assertEqual(corner, (0, 0, 0, 0))
|
||||
|
||||
def test_alpha_rotate_with_fill(self):
|
||||
# Alpha images are handled differently internally
|
||||
im = Image.new('RGBA', (10, 10), 'green')
|
||||
im = im.rotate(45, expand=1, fillcolor=(255, 0, 0, 255))
|
||||
corner = im.getpixel((0,0))
|
||||
self.assertEqual(corner, (255, 0, 0, 255))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user