You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An .xlsx picture below the last text row and past row 10 is uploaded but never indexed #45181
I confirm that I am using English to submit this report, otherwise it will be closed.
【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
Please do not modify this template :) and fill in all the required fields.
Dify version
main (dca4024e57)
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
Upload an .xlsx to a knowledge base where a picture sits in a table column below the last row that has text, past row 10. For example, a sheet whose last text row is 2, with a picture anchored at C12 under an Image header:
A B C
1 Question Answer Image
2 Q1 A1
...
12 [picture]
api/core/rag/extractor/excel_extractor.py uploads embedded images first (_extract_images_from_sheet), then walks rows with:
Without max_row, openpyxl stops at sheet.max_row. A row that holds only a picture has no cells, so it is never visited. Rows up to 10 survive only by accident: the header scan (_find_header_and_columns) calls iter_rows(max_row=10), which makes openpyxl create empty cells for rows 1 to 10 and raises max_row to 10.
✔️ Expected Behavior
Each picture-only row becomes a document with its markdown image, as it does for rows up to 10:
Only the first line is indexed. The picture is still saved to storage with an UploadFile row, but no document references it, so it cannot be retrieved.
Found while testing #44849. A fix with a real-workbook test follows.
One boundary to preserve in the follow-up workbook test: _extract_images_from_sheet() only returns anchors after the header and in recognized header columns. If row coverage is extended, deriving its extent from the returned image map rather than every worksheet drawing preserves those exclusions. Pairing the C12 inclusion case with above-header and unrecognized-column exclusion cases would help keep that behavior. This is a static check at the reported revision; I haven't run the workbook test.
Activity
xz567001-afk commentedon Oct 31, 2026
One boundary to preserve in the follow-up workbook test:
_extract_images_from_sheet()only returns anchors after the header and in recognized header columns. If row coverage is extended, deriving its extent from the returned image map rather than every worksheet drawing preserves those exclusions. Pairing the C12 inclusion case with above-header and unrecognized-column exclusion cases would help keep that behavior. This is a static check at the reported revision; I haven't run the workbook test.