mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
Update document.py
add docx to the mime types, and for extentions lower the case so they can be compared if they came in Upper case Signed-off-by: MoheyElDin Badr <56153924+MoheyEl-DinBadr@users.noreply.github.com>
This commit is contained in:
parent
7c4c356e76
commit
7885c1d751
@ -302,7 +302,7 @@ class _DocumentConversionInput(BaseModel):
|
||||
if ("." in obj.name and not obj.name.startswith("."))
|
||||
else ""
|
||||
)
|
||||
mime = _DocumentConversionInput._mime_from_extension(ext)
|
||||
mime = _DocumentConversionInput._mime_from_extension(ext.lower())
|
||||
if mime is not None and mime.lower() == "application/zip":
|
||||
objname = obj.name.lower()
|
||||
if objname.endswith(".xlsx"):
|
||||
@ -376,6 +376,8 @@ class _DocumentConversionInput(BaseModel):
|
||||
mime = FormatToMimeType[InputFormat.JSON_DOCLING][0]
|
||||
elif ext in FormatToExtensions[InputFormat.PDF]:
|
||||
mime = FormatToMimeType[InputFormat.PDF][0]
|
||||
elif ext in FormatToExtentions[InputFormat.DOCX]:
|
||||
mime = FormatToMimeType[InputFormat.DOCX][0]
|
||||
return mime
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
Reference in New Issue
Block a user