T2: Photo gallery picker with preview

2026-05-21 11:21:46 -04:00
parent 15ee983a97
commit 12da1d44b2
+11
@@ -12,6 +12,17 @@ Mobile-first web app for tracking physical assets via barcode scanning, OCR stic
- Username: `admin`
- Password: `Brett85!@`
### T2 Photo Gallery Picker — May 2026
- **Hidden file input**: `<input type="file" id="photoPicker" accept="image/*" capture="environment">` in Add Asset tab
- **"📱 Pick from Gallery" button** in mode toggles bar alongside Barcode/OCR/Manual
- **Photo preview card**: Dark-themed card (matching app theme) with rounded corners and shadow, displays picked image
- **Toolbar buttons**: [🔍 OCR this photo] [📍 Extract GPS] [ Create Asset]
- **EXIF data**: File name, size, type, last modified date in styled rows
- **Clear button**: Resets picker and hides preview
- **Manual mode integration**: " Create Asset" loads photo into Manual form with pre-filled image
- JS functions: `handlePickedPhoto(file)`, `clearPickedPhoto()`, `extractExifData()`, `formatFileSize()`, `ocrPickedPhoto()`, `extractGpsFromPicked()`, `createAssetFromPicked()`
- Commit: f895bf9
### T1 Tesseract.js Client-Side OCR Fallback — May 2026
- **CDN**: `tesseract.js@5` added to `<head>`
- **Server-first, client-fallback**: `captureOcr()` tries `/api/ocr` with 8s AbortController timeout; on failure/timeout, falls back to `ocrImageClient()` using Tesseract.js (WASM-based, in-browser)