fix: improve Office document processing with Direct track

- Force Office documents (PPTX, DOCX, XLSX) to use Direct track after
  LibreOffice conversion, since converted PDFs always have extractable text
- Fix PDF generator to not exclude text in image regions for Direct track,
  allowing text to render on top of background images (critical for PPT)
- Increase file_type column from VARCHAR(50) to VARCHAR(100) to support
  long MIME types like PPTX
- Remove reference to non-existent total_images metadata attribute

This significantly improves processing time for Office documents
(from ~170s OCR to ~10s Direct) while preserving text quality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
egg
2025-11-30 16:22:04 +08:00
parent 6806fff1d5
commit 87dc97d951
5 changed files with 86 additions and 25 deletions

View File

@@ -1317,8 +1317,6 @@ class DirectExtractionEngine:
doc.close()
if images_added > 0:
current_images = unified_doc.metadata.total_images or 0
unified_doc.metadata.total_images = current_images + images_added
logger.info(f"Added {images_added} inline image regions to document")
except Exception as e: