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

Function test_3848

tests/test_pixmap.py:368–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366
367
368def test_3848():
369 if os.environ.get('PYMUPDF_RUNNING_ON_VALGRIND') == '1':
370 # Takes 40m on Github.
371 print(f'test_3848(): not running on valgrind because very slow.', flush=1)
372 return
373 if platform.python_implementation() == 'GraalVM':
374 print(f'test_3848(): Not running because slow on GraalVM.')
375 return
376 path = os.path.normpath(f'{__file__}/../../tests/resources/test_3848.pdf')
377 with pymupdf.open(path) as document:
378 for i in range(len(document)):
379 page = document.load_page(i)
380 print(f'{page=}.')
381 for annot in page.get_drawings():
382 if page.get_textbox(annot['rect']):
383 rect = annot['rect']
384 pixmap = page.get_pixmap(clip=rect)
385 color_bytes = pixmap.color_topusage()
386
387
388def test_3994():

Callers

nothing calls this directly

Calls 6

load_pageMethod · 0.80
get_drawingsMethod · 0.80
color_topusageMethod · 0.80
getMethod · 0.45
get_textboxMethod · 0.45
get_pixmapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…