diff --git a/static/index.html b/static/index.html index dbafdcd..fa695af 100644 --- a/static/index.html +++ b/static/index.html @@ -2649,7 +2649,14 @@ if (ocrEl) ocrEl.innerHTML = '❌ No machine ID detected. '; } } catch (ocrErr) { - if (ocrEl) ocrEl.textContent = '❌ OCR failed: ' + ocrErr.message; + if (ocrEl) { + const msg = ocrErr.message || ''; + if (msg.includes('unknown error') || msg === 'Client OCR failed: ') { + ocrEl.innerHTML = '❌ Photo format not supported by browser OCR. Use the 📸 live camera instead.'; + } else { + ocrEl.textContent = '❌ OCR failed: ' + msg; + } + } } // Extract GPS from EXIF @@ -3445,7 +3452,8 @@ result = await Promise.race([ocrPromise, timeoutPromise]); } catch (e) { updateOcrProgress({ status: 'error' }); - throw new Error('Client OCR failed: ' + (e.message || 'unknown error')); + const reason = (e && e.message) ? e.message : (e ? String(e) : 'image format not supported by browser'); + throw new Error('Client OCR failed: ' + reason); } updateOcrProgress({ status: 'done' });