gallery: increase server OCR timeout to 20s

- 6s was too short for 13MB DNG upload on mobile
- Bumped to 20s to handle large RAW photos
- Added 'Uploading to server OCR...' status message during upload
- Server OCR handles DNG correctly (tested via curl), so the
  timeout was the root cause of gallery upload failures
This commit is contained in:
2026-05-21 14:55:13 -04:00
parent 0cf5dddf83
commit 28f1a33a2d
+2 -1
View File
@@ -2641,8 +2641,9 @@
// Try server OCR first (handles more formats like DNG/RAW)
let ocrData = null;
try {
if (ocrEl) ocrEl.textContent = '⏳ Uploading to server OCR...';
const controller = new AbortController();
const t = setTimeout(() => controller.abort(), 6000);
const t = setTimeout(() => controller.abort(), 20000);
const fd = new FormData();
fd.append('file', file, file.name || 'sticker.jpg');
const res = await fetch('/api/ocr', {