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

Function test_2369

tests/test_pixmap.py:131–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 assert isinstance( samples, int)
130
131def test_2369():
132
133 width, height = 13, 37
134 image = pymupdf.Pixmap(pymupdf.csGRAY, width, height, b"\x00" * (width * height), False)
135
136 with pymupdf.Document(stream=image.tobytes(output="pam"), filetype="pam") as doc:
137 test_pdf_bytes = doc.convert_to_pdf()
138
139 with pymupdf.Document(stream=test_pdf_bytes) as doc:
140 page = doc[0]
141 img_xref = page.get_images()[0][0]
142 img = doc.extract_image(img_xref)
143 img_bytes = img["image"]
144 pymupdf.Pixmap(img_bytes)
145
146def test_page_idx_int():
147 doc = pymupdf.open(pdf)

Callers

nothing calls this directly

Calls 4

tobytesMethod · 0.95
convert_to_pdfMethod · 0.80
get_imagesMethod · 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…