mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Check if installed Qt version supports Format_Grayscale16
This commit is contained in:
parent
b1cc094f57
commit
e87745d9ec
|
@ -42,8 +42,11 @@ def test_rgb():
|
|||
|
||||
|
||||
def test_image():
|
||||
for mode in ("1", "RGB", "RGBA", "L", "P", "I;16"):
|
||||
for mode in ("1", "RGB", "RGBA", "L", "P"):
|
||||
ImageQt.ImageQt(hopper(mode))
|
||||
qt_format = ImageQt.QImage.Format if ImageQt.qt_version == "6" else ImageQt.QImage
|
||||
if hasattr(qt_format, "Format_Grayscale16"): # Qt 5.13+
|
||||
ImageQt.ImageQt(hopper("I;16"))
|
||||
|
||||
|
||||
def test_closed_file():
|
||||
|
|
|
@ -167,7 +167,7 @@ def _toqclass_helper(im):
|
|||
elif im.mode == "RGBA":
|
||||
data = im.tobytes("raw", "BGRA")
|
||||
format = qt_format.Format_ARGB32
|
||||
elif im.mode == "I;16":
|
||||
elif im.mode == "I;16" and hasattr(qt_format, "Format_Grayscale16"): # Qt 5.13+
|
||||
format = qt_format.Format_Grayscale16
|
||||
else:
|
||||
if exclusive_fp:
|
||||
|
|
Loading…
Reference in New Issue
Block a user