RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
feat: extract images from xlsx parser (#18800)
buua43682e363919d18
diff --git a/internal/ingestion/component/parser.go b/internal/ingestion/component/parser.goindex 836a8d9d9c..a25c5b3d0c 100644--- a/internal/ingestion/component/parser.go+++ b/internal/ingestion/component/parser.go@@ -496,6 +496,7 @@ func (c *ParserComponent) Invoke(ctx context.Context, db *gorm.DB, inputs map[stif dispatched.Err != nil && fileTypeExt != utility.FileTypeOTHER {return nil, dispatched.Err}+ reportParserWarnings(ctx, dispatched.Warnings)// 3. Build the legacy `pages` slice. When the dispatch path// produced a JSON payload, we re-shape it into the page@@ -584,6 +585,12 @@ func (c *ParserComponent) Invoke(ctx context.Context, db *gorm.DB, inputs map[streturn out, nil}+func reportParserWarnings(ctx context.Context, warnings []string) {+ for _, warning := range warnings {+ runtime.ReportProgressMessage(ctx, "Parser", "WARNING: "+warning)+ }+}+// buildPagesFromBytes reshapes already-prepared page bytes into the// schema.Page layout the downstream chunker consumes. The per-page// parse (including any parallelism) now lives in the parser backendsdiff --git a/internal/ingestion/component/parser_dispatch.go b/internal/ingestion/component/parser_dispatch.goindex 50129474f5..e1163634f9 100644--- a/internal/ingestion/component/parser_dispatch.go+++ b/internal/ingestion/component/parser_dispatch.go@@ -54,6 +54,7 @@ type parserDispatchResult struct {Markdown stringText stringHTML string+ Warnings []stringErr error}@@ -179,6 +180,7 @@ func dispatchParse(ctx context.Context, fileType utility.FileType, filename striMarkdown: res.Markdown,Text: res.Text,HTML: res.HTML,+ Warnings: res.Warnings,}}diff --git a/internal/ingestion/component/parser_test.go b/internal/ingestion/component/parser_test.goindex 99769388a4..de1d740e6b 100644--- a/internal/ingestion/component/parser_test.go+++ b/internal/ingestion/component/parser_test.go@@ -28,6 +28,19 @@ import ("ragflow/internal/ingestion/component/schema")+func TestReportParserWarningsAsProgressMessages(t *testing.T) {+ var got []string+ ctx := runtime.WithProgressMessageCallback(t.Context(), func(component, message string) {+ got = append(got, component+": "+message)+ })++ reportParserWarnings(ctx, []string{"sheet \"Summary\": unsupported image extension \"emf\""})++ if len(got) != 1 || got[0] != "Parser: WARNING: sheet \"Summary\": unsupported image extension \"emf\"" {+ t.Fatalf("progress warnings = %v", got)+ }+}+// TestParserComponent_Registered asserts the factory lookup// succeeds for the canonical "Parser" name. This is the contract// the pipeline runner relies on (see plan §4 Phase 0, "category-diff --git a/internal/parser/parser/office_table_render.go b/internal/parser/parser/office_table_render.goindex 43a844417d..bc8153c05d 100644--- a/internal/parser/parser/office_table_render.go+++ b/internal/parser/parser/office_table_render.go@@ -17,6 +17,8 @@package parserimport (+ "encoding/base64"+ "fmt""html""regexp""strconv"@@ -38,6 +40,83 @@ var numericCellRe = regexp.MustCompile(`^[\$\+\-]?[\d,]+(\.\d+)?%?$`)const defaultTableChunkRows = 256+// extractXLSXImages returns the floating and in-cell images anchored to a+// worksheet as structured parser items. Excelize exposes both kinds through+// GetPictureCells/GetPictures; walking the reported anchor cells avoids+// scanning the worksheet's entire coordinate space.+func extractXLSXImages(f *excelize.File, sheet string) ([]map[string]any, []string) {+ cells, err := f.GetPictureCells(sheet)+ if err != nil {+ return nil, []string{fmt.Sprintf("XLSX image discovery failed for sheet %q: %v", sheet, err)}+ }+ if len(cells) == 0 {+ return nil, nil+ }++ items := make([]map[string]any, 0, len(cells))+ warnings := make([]string, 0)+ for _, cell := range cells {+ pictures, err := f.GetPictures(sheet, cell)+ if err != nil {+ warnings = append(warnings, fmt.Sprintf("XLSX image extraction failed for sheet %q cell %s: %v", sheet, cell, err))+ continue+ }+ for _, picture := range pictures {+ if len(picture.File) == 0 {+ continue+ }+ mimeType, ok := xlsxImageMIMEType(picture.Extension)+ if !ok {+ warnings = append(warnings, fmt.Sprintf("XLSX image skipped for sheet %q cell %s: unsupported extension %q", sheet, cell, picture.Extension))+ continue+ }+ encoded := base64.StdEncoding.EncodeToString(picture.File)+ alt := cell+ if picture.Format != nil && picture.Format.AltText != "" {+ alt = picture.Format.AltText+ }+ items = append(items, map[string]any{+ "text": alt,+ "doc_type_kwd": "image",+ "ck_type": "image",+ "image": "data:" + mimeType + ";base64," + encoded,+ "sheet": sheet,+ "cell": cell,+ })+ }+ }+ return items, warnings+}++func xlsxImageMIMEType(extension string) (string, bool) {+ switch strings.TrimPrefix(strings.ToLower(extension), ".") {+ case "jpg", "jpeg":+ return "image/jpeg", true+ case "gif":+ return "image/gif", true+ case "bmp":+ return "image/bmp", true+ case "tif", "tiff":+ return "image/tiff", true+ case "svg":+ return "image/svg+xml", true+ case "png":+ return "image/png", true+ case "emf":+ return "image/x-emf", true+ case "emz":+ return "image/x-emz", true+ case "ico":+ return "image/x-icon", true+ case "wmf":+ return "image/x-wmf", true+ case "wmz":+ return "image/x-wmz", true+ default:+ return "", false+ }+}+// maxMergeExtentCols caps how far a merged range may widen the header row.// excelize's GetRows truncates each row at its last valued cell, so a merged// slave beyond that point is absent and cannot inherit its master's text; we@@ -82,8 +161,12 @@ func buildHeaderRow(row []string) string {// <thead>/<tbody>, so every <table> is one atomic chunk that downstream// chunkers can consume independently.func recordsToHTMLTableChunks(records [][]string, chunkRows int, caption string) string {+ return strings.Join(recordsToHTMLTableChunkList(records, chunkRows, caption), "")+}++func recordsToHTMLTableChunkList(records [][]string, chunkRows int, caption string) []string {if len(records) == 0 {- return "<table><caption>" + html.EscapeString(caption) + "</caption></table>"+ return []string{"<table><caption>" + html.EscapeString(caption) + "</caption></table>"}}// Build the header row once — repeated in every chunk.@@ -93,7 +176,7 @@ func recordsToHTMLTableChunks(records [][]string, chunkRows int, caption string)if nData == 0 {// Only a header row exists.- return "<table><caption>" + html.EscapeString(caption) + "</caption>\n" + headerHTML + "</table>"+ return []string{"<table><caption>" + html.EscapeString(caption) + "</caption>\n" + headerHTML + "</table>"}}if chunkRows <= 0 {@@ -101,7 +184,7 @@ func recordsToHTMLTableChunks(records [][]string, chunkRows int, caption string)}nChunks := (nData + chunkRows - 1) / chunkRows- var b strings.Builder+ chunks := make([]string, 0, nChunks)for ci := 0; ci < nChunks; ci++ {start := ci * chunkRowsend := start + chunkRows@@ -109,6 +192,7 @@ func recordsToHTMLTableChunks(records [][]string, chunkRows int, caption string)end = nData}+ var b strings.Builderb.WriteString("<table><caption>")b.WriteString(html.EscapeString(caption))b.WriteString("</caption>\n")@@ -124,8 +208,9 @@ func recordsToHTMLTableChunks(records [][]string, chunkRows int, caption string)b.WriteString("</tr>\n")}b.WriteString("</table>\n")+ chunks = append(chunks, b.String())}- return b.String()+ return chunks}// ──────────────────────────────────────────────────────────── axis helpers@@ -512,9 +597,13 @@ func decodeChunkRows(setup map[string]any) int {// data into chunkRows-sized atomic tables each repeating the header. An empty// or unreadable sheet yields an empty string.func renderSheetTables(f *excelize.File, sheet string, chunkRows int) string {+ return strings.Join(renderSheetTableChunks(f, sheet, chunkRows), "")+}++func renderSheetTableChunks(f *excelize.File, sheet string, chunkRows int) []string {rows, err := f.GetRows(sheet)if err != nil || len(rows) == 0 {- return ""+ return nil}rows = cleanIllegalControlChars(rows)@@ -544,5 +633,5 @@ func renderSheetTables(f *excelize.File, sheet string, chunkRows int) string {}records = append(records, r)}- return recordsToHTMLTableChunks(records, chunkRows, sheet)+ return recordsToHTMLTableChunkList(records, chunkRows, sheet)}diff --git a/internal/parser/parser/office_table_render_test.go b/internal/parser/parser/office_table_render_test.goindex 1d7453d3b0..a9b0c8c3b8 100644--- a/internal/parser/parser/office_table_render_test.go+++ b/internal/parser/parser/office_table_render_test.go@@ -7,6 +7,50 @@ import ("github.com/xuri/excelize/v2")+func xlsxTableHTML(res ParseResult) string {+ var out strings.Builder+ for _, item := range res.JSON {+ if item["doc_type_kwd"] != "table" {+ continue+ }+ text, _ := item["text"].(string)+ out.WriteString(text)+ }+ return out.String()+}++func TestXLSXImageMIMEType(t *testing.T) {+ tests := []struct {+ extension string+ mime string+ ok bool+ }{+ {extension: ".png", mime: "image/png", ok: true},+ {extension: ".JPG", mime: "image/jpeg", ok: true},+ {extension: ".emf", mime: "image/x-emf", ok: true},+ {extension: ".emz", mime: "image/x-emz", ok: true},+ {extension: ".ico", mime: "image/x-icon", ok: true},+ {extension: ".wmf", mime: "image/x-wmf", ok: true},+ {extension: ".wmz", mime: "image/x-wmz", ok: true},+ {extension: ".unknown", ok: false},+ }+ for _, tc := range tests {+ mime, ok := xlsxImageMIMEType(tc.extension)+ if mime != tc.mime || ok != tc.ok {+ t.Errorf("xlsxImageMIMEType(%q) = (%q, %v), want (%q, %v)", tc.extension, mime, ok, tc.mime, tc.ok)+ }+ }+}++func TestExtractXLSXImagesWarningForInvalidSheet(t *testing.T) {+ f := excelize.NewFile()+ defer f.Close()+ _, warnings := extractXLSXImages(f, "MissingSheet")+ if len(warnings) != 1 || !strings.Contains(warnings[0], "image discovery failed") {+ t.Fatalf("warnings = %v, want image discovery warning", warnings)+ }+}+// newTestXLSX builds an in-memory .xlsx from a cell writer.func newTestXLSX(t *testing.T, fill func(f *excelize.File)) []byte {t.Helper()@@ -119,7 +163,7 @@ func TestXLSXParser_HeaderAndCaption(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- html := res.HTML+ html := xlsxTableHTML(res)if !strings.Contains(html, `<caption>Sheet1</caption>`) {t.Fatalf("want <caption>Sheet1</caption>, got:\n%s", html)}@@ -155,7 +199,7 @@ func TestXLSXParser_MergedHeaderInheritance(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- html := res.HTML+ html := xlsxTableHTML(res)// The merged master text must have propagated into all three <th> slots.if !strings.Contains(html, "<tr><th>Sales Report</th><th>Sales Report</th><th>Sales Report</th></tr>") {t.Fatalf("merged master text not inherited into header <th>, got:\n%s", html)@@ -179,11 +223,11 @@ func TestDetectHeaderRow_ListObject(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<tr><th>Name</th><th>Age</th></tr>") {- t.Fatalf("want ListObject header row detected, got:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<tr><th>Name</th><th>Age</th></tr>") {+ t.Fatalf("want ListObject header row detected, got:\n%s", xlsxTableHTML(res))}- if strings.Contains(res.HTML, "<th>Title</th>") {- t.Fatalf("title row must not be the header:\n%s", res.HTML)+ if strings.Contains(xlsxTableHTML(res), "<th>Title</th>") {+ t.Fatalf("title row must not be the header:\n%s", xlsxTableHTML(res))}}@@ -206,11 +250,11 @@ func TestDetectHeaderRow_Lightweight(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<tr><th>Item</th><th>Count</th></tr>") {- t.Fatalf("want row-2 header detected, got:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<tr><th>Item</th><th>Count</th></tr>") {+ t.Fatalf("want row-2 header detected, got:\n%s", xlsxTableHTML(res))}- if strings.Contains(res.HTML, "<th>100</th>") {- t.Fatalf("numeric row 1 must not be the header:\n%s", res.HTML)+ if strings.Contains(xlsxTableHTML(res), "<th>100</th>") {+ t.Fatalf("numeric row 1 must not be the header:\n%s", xlsxTableHTML(res))}}@@ -228,8 +272,8 @@ func TestXLSXParser_CommonCaseNoRegression(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<tr><th>col_a</th><th>col_b</th></tr>") {- t.Fatalf("common-case header must render as <th>:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<tr><th>col_a</th><th>col_b</th></tr>") {+ t.Fatalf("common-case header must render as <th>:\n%s", xlsxTableHTML(res))}}@@ -256,11 +300,11 @@ func TestDetectHeaderRow_BoldSubtotalNotHeader(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<tr><th>2023</th><th>2024</th></tr>") {- t.Fatalf("numeric row 1 must remain the header:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<tr><th>2023</th><th>2024</th></tr>") {+ t.Fatalf("numeric row 1 must remain the header:\n%s", xlsxTableHTML(res))}- if strings.Contains(res.HTML, "<th>Total</th>") {- t.Fatalf("bold subtotal row must not be promoted to header:\n%s", res.HTML)+ if strings.Contains(xlsxTableHTML(res), "<th>Total</th>") {+ t.Fatalf("bold subtotal row must not be promoted to header:\n%s", xlsxTableHTML(res))}}@@ -289,11 +333,11 @@ func TestDetectHeaderRow_StyledHeaderPastFarMerge(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<th>Name</th><th>Desc</th>") {- t.Fatalf("narrow bold header past far merge must be detected:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<th>Name</th><th>Desc</th>") {+ t.Fatalf("narrow bold header past far merge must be detected:\n%s", xlsxTableHTML(res))}- if strings.Contains(res.HTML, "<th>Sales Report</th>") {- t.Fatalf("wide merged title must not be the header:\n%s", res.HTML)+ if strings.Contains(xlsxTableHTML(res), "<th>Sales Report</th>") {+ t.Fatalf("wide merged title must not be the header:\n%s", xlsxTableHTML(res))}}@@ -319,11 +363,11 @@ func TestDetectHeaderRow_StyledTextHeaderOverNumeric(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if !strings.Contains(res.HTML, "<tr><th>Product</th><th>Units</th></tr>") {- t.Fatalf("styled text header over numeric data must be detected:\n%s", res.HTML)+ if !strings.Contains(xlsxTableHTML(res), "<tr><th>Product</th><th>Units</th></tr>") {+ t.Fatalf("styled text header over numeric data must be detected:\n%s", xlsxTableHTML(res))}- if strings.Contains(res.HTML, "<th>Report Title</th>") {- t.Fatalf("title stub must not be the header:\n%s", res.HTML)+ if strings.Contains(xlsxTableHTML(res), "<th>Report Title</th>") {+ t.Fatalf("title stub must not be the header:\n%s", xlsxTableHTML(res))}}@@ -438,7 +482,7 @@ func TestRenderSheetTables_FarMergeDoesNotBloatDataRows(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- html := res.HTML+ html := xlsxTableHTML(res)if !strings.Contains(html, "<tr><th>Name</th><th>Price</th></tr>") {t.Fatalf("want row-2 header detected, got:\n%s", html)}@@ -477,7 +521,7 @@ func TestRenderSheetTables_MultiSheet(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- html := res.HTML+ html := xlsxTableHTML(res)if !strings.Contains(html, "<caption>Sheet1</caption>") {t.Fatalf("want Sheet1 caption, got:\n%s", html)}@@ -500,7 +544,7 @@ func TestRenderSheetTables_EmptySheet(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult: %v", res.Err)}- if res.HTML != "" {- t.Fatalf("empty sheet must yield empty HTML, got:\n%s", res.HTML)+ if len(res.JSON) != 0 {+ t.Fatalf("empty sheet must yield empty JSON, got:\n%v", res.JSON)}}diff --git a/internal/parser/parser/parse_result.go b/internal/parser/parser/parse_result.goindex a8b9cedd2a..c67c70fe7c 100644--- a/internal/parser/parser/parse_result.go+++ b/internal/parser/parser/parse_result.go@@ -81,6 +81,9 @@ type ParseResult struct {// Err is the failure reason. On non-nil Err, all payload// fields are zero values.Err error++ // Warnings contains non-fatal issues encountered while parsing.+ Warnings []string}// ParseResultProducer is the parser package's single structured-outputdiff --git a/internal/parser/parser/xlsx_parse_method_test.go b/internal/parser/parser/xlsx_parse_method_test.goindex 0f965f8480..2d69f8cf34 100644--- a/internal/parser/parser/xlsx_parse_method_test.go+++ b/internal/parser/parser/xlsx_parse_method_test.go@@ -1,6 +1,7 @@package parserimport (+ "encoding/base64""strings""testing"@@ -39,8 +40,7 @@ func TestNormalizeXLSXParseMethod(t *testing.T) {}// TestXLSXParser_DeepDocParseMethod verifies that both the lowercase "deepdoc"-// and the uppercase "DeepDOC" (as shipped by the ingestion pipeline DSL templates)-// parse_method values produce the default HTML table output.+// and the uppercase "DeepDOC" produce structured spreadsheet output.func TestXLSXParser_DeepDocParseMethod(t *testing.T) {cases := []struct {name string@@ -74,16 +74,88 @@ func TestXLSXParser_DeepDocParseMethod(t *testing.T) {if res.Err != nil {t.Fatalf("ParseWithResult(%s): %v", tc.method, res.Err)}- if got, want := res.OutputFormat, "html"; got != want {+ if got, want := res.OutputFormat, "json"; got != want {t.Fatalf("OutputFormat = %q, want %q", got, want)}- if !strings.Contains(res.HTML, tc.cellValue) {- t.Fatalf("HTML = %q, want it to contain cell content %q", res.HTML, tc.cellValue)+ if len(res.JSON) != 1 {+ t.Fatalf("JSON item count = %d, want 1", len(res.JSON))+ }+ text, _ := res.JSON[0]["text"].(string)+ if !strings.Contains(text, tc.cellValue) {+ t.Fatalf("JSON = %#v, want it to contain cell content %q", res.JSON, tc.cellValue)}})}}+func TestXLSXParser_ExtractsFloatingImages(t *testing.T) {+ const pngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M8AAAMBAQDJ/pLvAAAAAElFTkSuQmCC"++ data := newTestXLSX(t, func(f *excelize.File) {+ mustSetCell(t, f, "Sheet1", "A1", "table content")+ if err := f.AddPictureFromBytes("Sheet1", "C3", &excelize.Picture{+ Extension: ".png",+ File: mustDecodeBase64(t, pngBase64),+ Format: &excelize.GraphicOptions{AltText: "sheet image"},+ }); err != nil {+ t.Fatalf("AddPictureFromBytes: %v", err)+ }+ })++ p, err := NewXLSXParser("")+ if err != nil {+ t.Fatalf("NewXLSXParser: %v", err)+ }+ res := p.ParseWithResult(t.Context(), "with-image.xlsx", data)+ if res.Err != nil {+ t.Fatalf("ParseWithResult: %v", res.Err)+ }+ if len(res.JSON) != 2 {+ t.Fatalf("JSON item count = %d, want table and image", len(res.JSON))+ }+ image := res.JSON[1]+ if image["text"] != "sheet image" || image["doc_type_kwd"] != "image" {+ t.Fatalf("unexpected image item: %#v", image)+ }+ if image["image"] != "data:image/png;base64,"+pngBase64 {+ t.Fatalf("image data = %v, want data URL", image["image"])+ }+}++func TestXLSXParser_ImageWithoutAltTextUsesAnchorCell(t *testing.T) {+ const pngBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M8AAAMBAQDJ/pLvAAAAAElFTkSuQmCC"++ data := newTestXLSX(t, func(f *excelize.File) {+ if err := f.AddPictureFromBytes("Sheet1", "C3", &excelize.Picture{+ Extension: ".png",+ File: mustDecodeBase64(t, pngBase64),+ }); err != nil {+ t.Fatalf("AddPictureFromBytes: %v", err)+ }+ })++ p, err := NewXLSXParser("")+ if err != nil {+ t.Fatalf("NewXLSXParser: %v", err)+ }+ res := p.ParseWithResult(t.Context(), "without-alt.xlsx", data)+ if res.Err != nil {+ t.Fatalf("ParseWithResult: %v", res.Err)+ }+ if len(res.JSON) != 1 || res.JSON[0]["text"] != "C3" {+ t.Fatalf("image item = %#v, want anchor-cell text C3", res.JSON)+ }+}++func mustDecodeBase64(t *testing.T, encoded string) []byte {+ t.Helper()+ data, err := base64.StdEncoding.DecodeString(encoded)+ if err != nil {+ t.Fatalf("DecodeString: %v", err)+ }+ return data+}+// TestCSVParser_DeepDocParseMethod asserts the CSV parser accepts the// default "deepdoc" parse_method and renders the default HTML table.func TestCSVParser_DeepDocParseMethod(t *testing.T) {diff --git a/internal/parser/parser/xlsx_parser.go b/internal/parser/parser/xlsx_parser.goindex b896a1ed37..08c29351a4 100644--- a/internal/parser/parser/xlsx_parser.go+++ b/internal/parser/parser/xlsx_parser.go@@ -125,14 +125,26 @@ func (p *XLSXParser) ParseWithResult(ctx context.Context, filename string, datachunkRows = defaultTableChunkRows}- var html strings.Builder+ items := make([]map[string]any, 0)+ warnings := make([]string, 0)for _, sheet := range sheets {- html.WriteString(renderSheetTables(f, sheet, chunkRows))+ for _, table := range renderSheetTableChunks(f, sheet, chunkRows) {+ items = append(items, map[string]any{+ "text": table,+ "doc_type_kwd": "table",+ "ck_type": "table",+ "sheet": sheet,+ })+ }+ images, imageWarnings := extractXLSXImages(f, sheet)+ items = append(items, images...)+ warnings = append(warnings, imageWarnings...)}return ParseResult{- OutputFormat: "html",+ OutputFormat: "json",File: map[string]any{"name": filename, "format": "xlsx", "sheets": len(sheets)},- HTML: html.String(),+ JSON: items,+ Warnings: warnings,}}