Skip to content

Commit

Permalink
tests/test_2904.py: update to match fixed mupdf master.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Dec 21, 2023
1 parent f49700b commit e6eacea
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/test_2904.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ def test_2904():
e = ee
if page_id == 75:
print(f'{fitz.mupdf_version_tuple=}: {page_id=} {i=} {e=} {img=}:')
if fitz.mupdf_version_tuple >= (1, 24):
# 2023-12-20: current mupdf master has a bug here that causes
# one corrupt image to provoke errors for all images on the
# same page.
if page_id == 75:
assert e
else:
if page_id == 75 and i==3:
assert e
if hasattr(fitz, 'mupdf') and fitz.mupdf_version_tuple >= (1, 23, 7):
assert str(e) == 'code=4: Failed to read JPX header'
if page_id == 75 and i==3:
assert e
if hasattr(fitz, 'mupdf'):
# rebased.
if fitz.mupdf_version_tuple >= (1, 24):
assert str(e) == 'code=8: Failed to read JPX header'
else:
assert str(e) == 'Failed to read JPX header'
assert str(e) == 'code=4: Failed to read JPX header'
else:
assert not e
# classic
assert str(e) == 'Failed to read JPX header'
else:
assert not e

0 comments on commit e6eacea

Please sign in to comment.