Skip to content

Commit c4a83ea

Browse files
tests/: added test_4699() for upstream bug fixed with mupdf master.
1 parent 090e23e commit c4a83ea

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tests/resources/test_4699.pdf

798 KB
Binary file not shown.

tests/resources/test_4699.png

88.9 KB
Loading

tests/test_pixmap.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,3 +631,22 @@ def test_4388():
631631
assert rms == 0
632632
else:
633633
assert rms >= 10
634+
635+
636+
def test_4699():
637+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_4699.pdf')
638+
path_png_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_4699.png')
639+
path_png_actual = os.path.normpath(f'{__file__}/../../tests/test_4699.png')
640+
with pymupdf.open(path) as document:
641+
page = document[0]
642+
pixmap = page.get_pixmap()
643+
pixmap.save(path_png_actual)
644+
print(f'Have saved to {path_png_actual=}.')
645+
rms = gentle_compare.pixmaps_rms(path_png_expected, pixmap)
646+
print(f'test_4699(): {rms=}')
647+
if pymupdf.mupdf_version_tuple >= (1, 27):
648+
assert rms == 0
649+
else:
650+
wt = pymupdf.TOOLS.mupdf_warnings()
651+
assert 'syntax error: cannot find ExtGState resource' in wt
652+
assert rms > 20

0 commit comments

Comments
 (0)