Beispiel #1
0
    def test_resize_animated_gif(self):
        with open('tests/images/newtons_cradle.gif', 'rb') as f:
            backend = pillow_backend.PillowBackend.from_file(f)

        pillow_backend.resize(self.backend, 100, 75)

        self.assertFalse(pillow_backend.has_alpha(backend))
        self.assertTrue(pillow_backend.has_animation(backend))
Beispiel #2
0
    def test_resize_transparent_gif(self):
        with open('tests/images/transparent.gif', 'rb') as f:
            backend = pillow_backend.PillowBackend.from_file(f)

        pillow_backend.resize(self.backend, 100, 75)

        self.assertTrue(pillow_backend.has_alpha(backend))
        self.assertFalse(pillow_backend.has_animation(backend))

        # Check that the alpha of pixel 1,1 is 0
        self.assertEqual(backend.image.convert('RGBA').getpixel((1, 1))[3], 0)
Beispiel #3
0
 def test_resize(self):
     pillow_backend.resize(self.backend, 100, 75)
     self.assertEqual(self.backend.image.size, (100, 75))