Skip to content

Commit ca865c7

Browse files
tests/: added test_5001().
Checks #5001. Fails with pymupdf-1.27.2.3. Passes with current mupdf branch master.
1 parent 65985cc commit ca865c7

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

tests/resources/test_5001.pdf

961 KB
Binary file not shown.
179 KB
Loading

tests/test_pixmap.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,3 +667,26 @@ def test_4699():
667667
wt = pymupdf.TOOLS.mupdf_warnings()
668668
assert 'syntax error: cannot find ExtGState resource' in wt
669669
assert rms > 20
670+
671+
672+
def test_5001():
673+
'''
674+
#5001 is fixed with mupdf>=1.28.
675+
'''
676+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_5001.pdf')
677+
path_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_5001_expected.png')
678+
path_out = os.path.normpath(f'{__file__}/../../tests/test_5001_out.png')
679+
with pymupdf.open(path) as document:
680+
page = document[0]
681+
zoom = 0.3
682+
pixmap = page.get_pixmap(matrix=pymupdf.Matrix(zoom, zoom))
683+
pixmap.save(path_out)
684+
rms = gentle_compare.pixmaps_rms(path_expected, pixmap)
685+
print()
686+
print(f'test_5001(): {rms=}')
687+
if pymupdf.mupdf_version_tuple >= (1, 28):
688+
assert rms == 0
689+
else:
690+
assert rms != 0
691+
wt = pymupdf.TOOLS.mupdf_warnings()
692+
assert wt

0 commit comments

Comments
 (0)