Add PDF/HEIC/image upload support and improve receipt extraction

- Add backend image conversion endpoint (POST /api/convert-image) supporting
  PDF, HEIC, PNG, WebP via Pillow, PyMuPDF, and pillow-heif
- Add separate "Upload file" button in UI while keeping camera-first behavior
  for the photo area and + button
- Improve Haiku extraction prompt for hotel receipts (parenthesized total)
- Increase max image resolution from 1024px to 2048px for better OCR accuracy
- Add libheif-dev system dependency in Dockerfile

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 01:20:23 -06:00
parent fde6fcb724
commit a5c6996219
4 changed files with 113 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN apt-get update && apt-get install -y --no-install-recommends libheif-dev && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py receipts.html api-key ./