mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-19 04:30:01 +08:00
Fix: docx image exceptions. (#6839)
### What problem does this PR solve? Close #6784 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
d64c6870bb
commit
14a3efd756
@ -44,7 +44,10 @@ class Docx(DocxParser):
|
|||||||
if not img:
|
if not img:
|
||||||
return None
|
return None
|
||||||
img = img[0]
|
img = img[0]
|
||||||
embed = img.xpath('.//a:blip/@r:embed')[0]
|
embed = img.xpath('.//a:blip/@r:embed')
|
||||||
|
if not embed:
|
||||||
|
return None
|
||||||
|
embed = embed[0]
|
||||||
related_part = document.part.related_parts[embed]
|
related_part = document.part.related_parts[embed]
|
||||||
try:
|
try:
|
||||||
image_blob = related_part.image.blob
|
image_blob = related_part.image.blob
|
||||||
|
Loading…
x
Reference in New Issue
Block a user