Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed support for Qt 5 #8159

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Tests/test_imageqt.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,13 @@
checkrgb(0, 0, 255)


def test_image() -> None:
modes = ["1", "RGB", "RGBA", "L", "P"]
qt_format = ImageQt.QImage.Format if ImageQt.qt_version == "6" else ImageQt.QImage
if hasattr(qt_format, "Format_Grayscale16"): # Qt 5.13+
modes.append("I;16")

for mode in modes:
im = hopper(mode)
roundtripped_im = ImageQt.fromqimage(ImageQt.ImageQt(im))
if mode not in ("RGB", "RGBA"):
im = im.convert("RGB")
assert_image_similar(roundtripped_im, im, 1)
@pytest.mark.parametrize("mode", ("1", "RGB", "RGBA", "L", "P", "I;16"))
def test_image(mode: str) -> None:
im = hopper(mode)
roundtripped_im = ImageQt.fromqimage(ImageQt.ImageQt(im))
if mode not in ("RGB", "RGBA"):
im = im.convert("RGB")
assert_image_similar(roundtripped_im, im, 1)

Check warning on line 50 in Tests/test_imageqt.py

View check run for this annotation

Codecov / codecov/patch

Tests/test_imageqt.py#L46-L50

Added lines #L46 - L50 were not covered by tests


def test_closed_file() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
elif im.mode == "RGBA":
data = im.tobytes("raw", "BGRA")
format = qt_format.Format_ARGB32
elif im.mode == "I;16" and hasattr(qt_format, "Format_Grayscale16"): # Qt 5.13+
elif im.mode == "I;16":

Check warning on line 155 in src/PIL/ImageQt.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/ImageQt.py#L155

Added line #L155 was not covered by tests
im = im.point(lambda i: i * 256)

format = qt_format.Format_Grayscale16
Expand Down
Loading