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

Function test_3994

tests/test_pixmap.py:388–397  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386
387
388def test_3994():
389 path = os.path.normpath(f'{__file__}/../../tests/resources/test_3994.pdf')
390 with pymupdf.open(path) as document:
391 page = document[0]
392 txt_blocks = [blk for blk in page.get_text('dict')['blocks'] if blk['type']==0]
393 for blk in txt_blocks:
394 pix = page.get_pixmap(clip=pymupdf.Rect([int(v) for v in blk['bbox']]), colorspace=pymupdf.csRGB, alpha=False)
395 percent, color = pix.color_topusage()
396 wt = pymupdf.TOOLS.mupdf_warnings()
397 assert wt == 'premature end of data in flate filter\n... repeated 2 times...'
398
399
400def test_3448():

Callers

nothing calls this directly

Calls 4

color_topusageMethod · 0.80
mupdf_warningsMethod · 0.80
get_textMethod · 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…