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

Function test_image_bbox

tests/test_imagebbox.py:18–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def test_image_bbox():
19 page = doc[0]
20 imglist = page.get_images(True)
21 bbox_list = []
22 for item in imglist:
23 bbox_list.append(page.get_image_bbox(item, transform=False))
24 infos = page.get_image_info(xrefs=True)
25 match = False
26 for im in infos:
27 bbox1 = im["bbox"]
28 match = False
29 for bbox2 in bbox_list:
30 abs_bbox = (bbox2 - bbox1).norm()
31 if abs_bbox < 1e-4:
32 match = True
33 break
34 assert match
35
36
37def test_bboxlog():

Callers

nothing calls this directly

Calls 5

get_imagesMethod · 0.80
get_image_bboxMethod · 0.80
get_image_infoMethod · 0.80
appendMethod · 0.45
normMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…