refactor: allow loading of truncated images and increase max pixel limit in common_handle.py

--bug=1057749 --user=刘瑞斌 【知识库】qa问答对文档中带图片,导入后图片未显示 https://www.tapd.cn/62980211/s/1723700
This commit is contained in:
CaptainB 2025-07-04 15:53:37 +08:00
parent d7b4f90798
commit cb40d62162

View File

@ -22,6 +22,9 @@ from openpyxl.xml.constants import SHEET_DRAWING_NS, REL_NS, SHEET_MAIN_NS
from common.utils.logger import maxkb_logger
from knowledge.models import File
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
PILImage.MAX_IMAGE_PIXELS = None
def parse_element(element) -> {}:
data = {}