mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-01 11:43:17 +03:00
Relax roundtrip check
This commit is contained in:
parent
698951e19e
commit
e76fa1674e
|
@ -6,7 +6,7 @@ with warnings.catch_warnings():
|
||||||
warnings.simplefilter("ignore", category=DeprecationWarning)
|
warnings.simplefilter("ignore", category=DeprecationWarning)
|
||||||
from PIL import ImageQt
|
from PIL import ImageQt
|
||||||
|
|
||||||
from .helper import assert_image_equal, assert_image_equal_tofile, hopper
|
from .helper import assert_image_equal_tofile, assert_image_similar, hopper
|
||||||
|
|
||||||
if ImageQt.qt_is_installed:
|
if ImageQt.qt_is_installed:
|
||||||
from PIL.ImageQt import QPixmap
|
from PIL.ImageQt import QPixmap
|
||||||
|
@ -48,7 +48,7 @@ if ImageQt.qt_is_installed:
|
||||||
def roundtrip(expected):
|
def roundtrip(expected):
|
||||||
result = ImageQt.fromqpixmap(ImageQt.toqpixmap(expected))
|
result = ImageQt.fromqpixmap(ImageQt.toqpixmap(expected))
|
||||||
# Qt saves all pixmaps as rgb
|
# Qt saves all pixmaps as rgb
|
||||||
assert_image_equal(result, expected.convert("RGB"))
|
assert_image_similar(result, expected.convert("RGB"), 0.3)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not ImageQt.qt_is_installed, reason="Qt bindings are not installed")
|
@pytest.mark.skipif(not ImageQt.qt_is_installed, reason="Qt bindings are not installed")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user