mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
17 lines
506 B
Python
17 lines
506 B
Python
from .helper import PillowTestCase, hopper
|
|
from .test_imageqt import PillowQPixmapTestCase
|
|
|
|
from PIL import ImageQt
|
|
|
|
|
|
class TestFromQPixmap(PillowQPixmapTestCase, PillowTestCase):
|
|
|
|
def roundtrip(self, expected):
|
|
result = ImageQt.fromqpixmap(ImageQt.toqpixmap(expected))
|
|
# Qt saves all pixmaps as rgb
|
|
self.assert_image_equal(result, expected.convert('RGB'))
|
|
|
|
def test_sanity(self):
|
|
for mode in ('1', 'RGB', 'RGBA', 'L', 'P'):
|
|
self.roundtrip(hopper(mode))
|