MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / test_4388

Function test_4388

tests/test_pixmap.py:608–633  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

606
607
608def test_4388():
609 print()
610 path_BOZ1 = os.path.normpath(f'{__file__}/../../tests/resources/test_4388_BOZ1.pdf')
611 path_BUL1 = os.path.normpath(f'{__file__}/../../tests/resources/test_4388_BUL1.pdf')
612 path_correct = os.path.normpath(f'{__file__}/../../tests/resources/test_4388_BUL1.pdf.correct.png')
613 path_test = os.path.normpath(f'{__file__}/../../tests/resources/test_4388_BUL1.pdf.test.png')
614
615 with pymupdf.open(path_BUL1) as bul:
616 pixmap_correct = bul.load_page(0).get_pixmap()
617 pixmap_correct.save(path_correct)
618
619 pymupdf.TOOLS.store_shrink(100)
620
621 with pymupdf.open(path_BOZ1) as boz:
622 boz.load_page(0).get_pixmap()
623
624 with pymupdf.open(path_BUL1) as bul:
625 pixmap_test = bul.load_page(0).get_pixmap()
626 pixmap_test.save(path_test)
627
628 rms = gentle_compare.pixmaps_rms(pixmap_correct, pixmap_test)
629 print(f'{rms=}')
630 if pymupdf.mupdf_version_tuple >= (1, 26, 6):
631 assert rms == 0
632 else:
633 assert rms >= 10
634
635
636def test_4699():

Callers

nothing calls this directly

Calls 4

load_pageMethod · 0.80
store_shrinkMethod · 0.80
get_pixmapMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…