소스 검색

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)
tags/v0.18.0
Kevin Hu 6 달 전
부모
커밋
14a3efd756
No account linked to committer's email address
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4
    1
      rag/app/naive.py

+ 4
- 1
rag/app/naive.py 파일 보기

@@ -44,7 +44,10 @@ class Docx(DocxParser):
if not img:
return None
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]
try:
image_blob = related_part.image.blob

Loading…
취소
저장