Files
OCR/openspec/changes/simplify-frontend-ocr-config/proposal.md
egg cfe65158a3 feat: enable document orientation detection for scanned PDFs
- Enable PP-StructureV3's use_doc_orientation_classify feature
- Detect rotation angle from doc_preprocessor_res.angle
- Swap page dimensions (width <-> height) for 90°/270° rotations
- Output PDF now correctly displays landscape-scanned content

Also includes:
- Archive completed openspec proposals
- Add simplify-frontend-ocr-config proposal (pending)
- Code cleanup and frontend simplification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 17:13:46 +08:00

1.5 KiB
Raw Blame History

Change: 簡化前端 OCR 配置選項

Why

OCR track 已改為使用 simple OCR 模式不再需要前端的複雜配置選項如表格偵測模式、OCR 預設、進階參數等)。這些配置增加了使用者的認知負擔,且不再影響實際處理結果。

What Changes

  • BREAKING 移除前端的 OCR 處理預設選擇器 (OCRPresetSelector)
  • BREAKING 移除前端的表格偵測配置選擇器 (TableDetectionSelector)
  • BREAKING 移除前端相關的 TypeScript 類型定義 (OCRPreset, OCRConfig, TableDetectionConfig, TableParsingMode 等)
  • 保留版面模型選擇功能 (LayoutModelSelector): chinese | default | cdla
  • 保留影像前處理配置功能 (PreprocessingSettings): auto/manual/disabled 模式及相關參數
  • 簡化後端 API 的 ProcessingOptions,移除不再使用的參數

Impact

  • Affected specs: ocr-processing
  • Affected code:
    • 前端需刪除的檔案:
      • frontend/src/components/OCRPresetSelector.tsx
      • frontend/src/components/TableDetectionSelector.tsx
    • 前端需修改的檔案:
      • frontend/src/types/apiV2.ts - 移除未使用的類型定義
      • frontend/src/pages/ProcessingPage.tsx - 移除已註解的相關 import 和邏輯
    • 後端需修改的檔案:
      • backend/app/schemas/task.py - 移除 ProcessingOptions 中的 ocr_preset, ocr_config, table_detection 欄位
      • backend/app/routers/tasks.py - 清理對應的參數處理邏輯