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

Function test_4445

tests/test_pixmap.py:561–587  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

559
560
561def test_4445():
562 if os.environ.get('PYODIDE_ROOT'):
563 print('test_4445(): not running on Pyodide - cannot run child processes.')
564 return
565 print()
566 # Test case is large so we download it instead of having it in PyMuPDF
567 # git. We put it in `cache/` directory do it is not removed by `git clean`
568 # (unless `-d` is specified).
569 import util
570 path = util.download(
571 'https://github.com/user-attachments/files/19738242/ss.pdf',
572 'test_4445.pdf',
573 size=2671185,
574 )
575 with pymupdf.open(path) as document:
576 page = document[0]
577 pixmap = page.get_pixmap()
578 print(f'{pixmap.width=}')
579 print(f'{pixmap.height=}')
580 assert (pixmap.width, pixmap.height) == (792, 612)
581 if 0:
582 path_pixmap = f'{path}.png'
583 pixmap.save(path_pixmap)
584 print(f'Have created {path_pixmap=}')
585 wt = pymupdf.TOOLS.mupdf_warnings()
586 print(f'{wt=}')
587 assert wt == 'broken xref subsection, proceeding anyway.\nTrailer Size is off-by-one. Ignoring.'
588
589
590def test_3806():

Callers

nothing calls this directly

Calls 4

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