SystemError: returned a result with an exception set (original) (raw)
Description of the bug
when i use the api page.get_image_rects,there is a SystemError: returned a result with an exception set
How to reproduce the bug
pdf file:
https://drive.google.com/file/d/1yCwGVTOwRSXvHCzNC0C0dsVJLQI-p2ZM/view
page_id:115(page_id start from 0)
pdf_docs = fitz.open("pdf", pdf_bytes)
for page_id, page in enumerate(pdf_docs):
page_imgs = page.get_images()
for img in page_imgs:
recs = page.get_image_rects(img, transform=True)
my code like this demo
recs = page.get_image_rects(img, transform=True)
│ │ └ (2052, 0, 1895, 1248, 8, 'DeviceRGB', '', 'Im0', 'DCTDecode')
│ └ <function get_image_rects at 0x0000027B025F5E40>
└ page 115 of <memory, doc# 1>
infos = page.get_image_info(hashes=True)
│ └ <function get_image_info at 0x0000027B025F5DA0>
└ page 115 of <memory, doc# 1>
imginfo = tp.extractIMGINFO(hashes=hashes)
│ │ └ True
│ └ <function TextPage.extractIMGINFO at 0x0000027B025E3D80>
└ <fitz.fitz.TextPage; proxy of <Swig Object of type 'TextPage *' at 0x0000027B027579F0> >
return _fitz.TextPage_extractIMGINFO(self, hashes)
│ │ │ └ True
│ │ └ <fitz.fitz.TextPage; proxy of <Swig Object of type 'TextPage *' at 0x0000027B027579F0> >
│ └ <built-in function TextPage_extractIMGINFO>
└ <module 'fitz._fitz' from
there is stack when i meet this error
PyMuPDF version
1.23.7
Operating system
Windows
Python version
3.11