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

Function test_3072

tests/test_pixmap.py:225–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223 assert 1800000 < s < 2600000, f'Unexpected size of {path}: {s}'
224
225def test_3072():
226 path = os.path.abspath(f'{__file__}/../../tests/resources/test_3072.pdf')
227 out = os.path.abspath(f'{__file__}/../../tests')
228
229 doc = pymupdf.open(path)
230 page_48 = doc[0]
231 bbox = [147, 300, 447, 699]
232 rect = pymupdf.Rect(*bbox)
233 zoom = pymupdf.Matrix(3, 3)
234 pix = page_48.get_pixmap(clip=rect, matrix=zoom)
235 image_save_path = f'{out}/1.jpg'
236 pix.save(image_save_path, jpg_quality=95)
237
238 doc = pymupdf.open(path)
239 page_49 = doc[1]
240 bbox = [147, 543, 447, 768]
241 rect = pymupdf.Rect(*bbox)
242 zoom = pymupdf.Matrix(3, 3)
243 pix = page_49.get_pixmap(clip=rect, matrix=zoom)
244 image_save_path = f'{out}/2.jpg'
245 pix.save(image_save_path, jpg_quality=95)
246 wt = pymupdf.TOOLS.mupdf_warnings()
247 assert wt == (
248 "syntax error: cannot find ExtGState resource 'BlendMode0'\n"
249 "encountered syntax errors; page may not be correct\n"
250 "syntax error: cannot find ExtGState resource 'BlendMode0'\n"
251 "encountered syntax errors; page may not be correct"
252 )
253
254def test_3134():
255 doc = pymupdf.Document()

Callers

nothing calls this directly

Calls 3

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