Fix: presentation parsing & Embedding encode exception handling (#11933)

### What problem does this PR solve?

Fix: presentation parsing #11920
Fix: Embeddin encode exception handling
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Magicbook1108
2025-12-13 11:37:42 +08:00
committed by GitHub
parent 6be0338aa0
commit 7d23c3aed0
2 changed files with 31 additions and 5 deletions

View File

@ -227,8 +227,9 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
for pn, (txt, img) in enumerate(sections):
d = copy.deepcopy(doc)
pn += from_page
if img:
d["image"] = img
if not isinstance(img, Image.Image):
img = None
d["image"] = img
d["page_num_int"] = [pn + 1]
d["top_int"] = [0]
d["position_int"] = [(pn + 1, 0, img.size[0] if img else 0, 0,