Skip to content

Commit 67c358f

Browse files
tests/: added test_3806().
1 parent 20bc5a2 commit 67c358f

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
191 KB
Loading

tests/resources/test_3806.pdf

6.42 MB
Binary file not shown.

tests/test_pixmap.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,3 +582,21 @@ def test_4445():
582582
wt = pymupdf.TOOLS.mupdf_warnings()
583583
print(f'{wt=}')
584584
assert wt == 'broken xref subsection, proceeding anyway.\nTrailer Size is off-by-one. Ignoring.'
585+
586+
587+
def test_3806():
588+
print()
589+
print(f'{pymupdf.mupdf_version=}')
590+
path = os.path.normpath(f'{__file__}/../../tests/resources/test_3806.pdf')
591+
path_png_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_3806-expected.png')
592+
path_png = os.path.normpath(f'{__file__}/../../tests/test_3806.png')
593+
594+
with pymupdf.open(path) as document:
595+
pixmap = document[0].get_pixmap()
596+
pixmap.save(path_png)
597+
rms = gentle_compare.pixmaps_rms(path_png_expected, pixmap)
598+
print(f'{rms=}')
599+
if pymupdf.mupdf_version_tuple >= (1, 27):
600+
assert rms < 0.1
601+
else:
602+
assert rms > 50

0 commit comments

Comments
 (0)