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

Function test_extract_image

tests/test_extractimage.py:12–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_extract_image():
13 doc = pymupdf.open(filename)
14
15 image_count = 1
16 for xref in range(1, doc.xref_length() - 1):
17 if doc.xref_get_key(xref, "Subtype")[1] != "/Image":
18 continue
19 img = doc.extract_image(xref)
20 if isinstance(img, dict):
21 image_count += 1
22
23 assert image_count == known_image_count # this number is know about the file
24
25def test_2348():
26

Callers

nothing calls this directly

Calls 3

xref_lengthMethod · 0.80
xref_get_keyMethod · 0.80
extract_imageMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…