MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / test_3448

Function test_3448

tests/test_pixmap.py:400–415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398
399
400def test_3448():
401 path = os.path.normpath(f'{__file__}/../../tests/resources/test_3448.pdf')
402 with pymupdf.open(path) as document:
403 page = document[0]
404 pixmap = page.get_pixmap(alpha=False, dpi=150)
405 path_out = f'{path}.png'
406 pixmap.save(path_out)
407 print(f'Have written to: {path_out}')
408 path_expected = os.path.normpath(f'{__file__}/../../tests/resources/test_3448.pdf-expected.png')
409 pixmap_expected = pymupdf.Pixmap(path_expected)
410 rms = gentle_compare.pixmaps_rms(pixmap, pixmap_expected)
411 diff = gentle_compare.pixmaps_diff(pixmap_expected, pixmap)
412 path_diff = os.path.normpath(f'{__file__}/../../tests/test_3448-diff.png')
413 diff.save(path_diff)
414 print(f'{rms=}')
415 assert rms == 0
416
417
418def test_3854():

Callers

nothing calls this directly

Calls 2

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…