mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
10615a7da7
Co-authored-by: nulano <nulano@nulano.eu>
21 lines
560 B
Python
21 lines
560 B
Python
from PIL import ImageQt
|
|
|
|
from .helper import hopper
|
|
from .test_imageqt import PillowQPixmapTestCase
|
|
|
|
if ImageQt.qt_is_installed:
|
|
from PIL.ImageQt import QPixmap
|
|
|
|
|
|
class TestToQPixmap(PillowQPixmapTestCase):
|
|
def test_sanity(self, tmp_path):
|
|
for mode in ("1", "RGB", "RGBA", "L", "P"):
|
|
data = ImageQt.toqpixmap(hopper(mode))
|
|
|
|
assert isinstance(data, QPixmap)
|
|
assert not data.isNull()
|
|
|
|
# Test saving the file
|
|
tempfile = str(tmp_path / f"temp_{mode}.png")
|
|
data.save(tempfile)
|