Add PDF-to-JPEG support in web UI and /convert/pdf endpoint

Web UI now accepts both images and PDFs. Images go through /strip
as before; PDFs go through new /convert/pdf endpoint which renders
all pages via pdftoppm and returns base64 JPEGs. Also updates
page title and layout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 10:01:42 -07:00
parent 5227de3779
commit baa17b0fc7
2 changed files with 161 additions and 25 deletions

View File

@@ -11,9 +11,11 @@ Image/PDF-to-JPEG conversion microservice. Single-file Node.js/Express app (`ser
## Endpoints
- `GET /` — web UI for stripping photo metadata (drag-and-drop, uses `/strip`)
- `GET /health` — health check
- `POST /convert` — image or first PDF page → JPEG
- `POST /convert/pdf`all PDF pagesZIP of JPEGs
- `POST /strip` — strip metadata from image, return clean JPEG + removed metadata (JSON or raw)
- `POST /convert`image or first PDF page → JPEG (resize/quality via headers)
- `POST /convert/pdf` — all PDF pages → JSON array of base64 JPEGs
## Auth