Skip to content

Commit

Permalink
Merge pull request python-pillow#8512 from radarhere/qtables
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 29, 2024
2 parents 2d1d801 + 80cf740 commit 16372dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/test_file_jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,12 @@ def test_truncated_jpeg_throws_oserror(self) -> None:
@mark_if_feature_version(
pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing"
)
def test_qtables(self, tmp_path: Path) -> None:
def test_qtables(self) -> None:
def _n_qtables_helper(n: int, test_file: str) -> None:
b = BytesIO()
with Image.open(test_file) as im:
f = str(tmp_path / "temp.jpg")
im.save(f, qtables=[[n] * 64] * n)
with Image.open(f) as im:
im.save(b, "JPEG", qtables=[[n] * 64] * n)
with Image.open(b) as im:
assert len(im.quantization) == n
reloaded = self.roundtrip(im, qtables="keep")
assert im.quantization == reloaded.quantization
Expand Down

0 comments on commit 16372dd

Please sign in to comment.