Remove capture=environment from manual photo input — plain file picker preserves EXIF
- manPhotoInput now uses accept=image/* without capture attribute -> opens gallery/file picker which gives raw file bytes (EXIF preserved) - Camera shortcut preserved via openManualCamera() creates a temp capture=environment input for quick field capture (no EXIF but available) - Label updated: 'Tap to take photo' -> 'Tap to choose photo' - Manual photo capture row references openManualCamera() instead
This commit is contained in:
+13
-3
@@ -994,12 +994,12 @@
|
|||||||
<div id="manPhotoArea" class="camera-area" style="aspect-ratio:4/3;margin-bottom:8px;">
|
<div id="manPhotoArea" class="camera-area" style="aspect-ratio:4/3;margin-bottom:8px;">
|
||||||
<div id="manPhotoPlaceholder" class="camera-placeholder" onclick="document.getElementById('manPhotoInput').click()">
|
<div id="manPhotoPlaceholder" class="camera-placeholder" onclick="document.getElementById('manPhotoInput').click()">
|
||||||
<span class="cam-icon">📸</span>
|
<span class="cam-icon">📸</span>
|
||||||
<div class="cam-hint" style="margin-top:4px;">Tap to take photo</div>
|
<div class="cam-hint" style="margin-top:4px;">Tap to choose photo</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="file" id="manPhotoInput" accept="image/*" capture="environment" style="display:none;" onchange="handleManualPhotoFile(event)">
|
<input type="file" id="manPhotoInput" accept="image/*" style="display:none;" onchange="handleManualPhotoFile(event)">
|
||||||
</div>
|
</div>
|
||||||
<div id="manPhotoCaptureRow" style="display:none;justify-content:center;margin-bottom:8px;">
|
<div id="manPhotoCaptureRow" style="display:none;justify-content:center;margin-bottom:8px;">
|
||||||
<button class="ocr-capture-btn" onclick="document.getElementById('manPhotoInput').click()" title="Capture" style="position:static;width:48px;height:48px;font-size:18px;">📸</button>
|
<button class="ocr-capture-btn" onclick="openManualCamera()" title="Capture" style="position:static;width:48px;height:48px;font-size:18px;">📸</button>
|
||||||
</div>
|
</div>
|
||||||
<img id="manPhotoPreview" style="display:none;width:100%;border-radius:var(--radius-sm);">
|
<img id="manPhotoPreview" style="display:none;width:100%;border-radius:var(--radius-sm);">
|
||||||
<button id="manPhotoRetake" class="btn btn-outline btn-sm" style="display:none;margin-top:6px;width:100%;" onclick="retakeManualPhoto()">🔄 Retake</button>
|
<button id="manPhotoRetake" class="btn btn-outline btn-sm" style="display:none;margin-top:6px;width:100%;" onclick="retakeManualPhoto()">🔄 Retake</button>
|
||||||
@@ -2608,6 +2608,16 @@
|
|||||||
manualPhotoBlob = null; // reuse existing declaration
|
manualPhotoBlob = null; // reuse existing declaration
|
||||||
let manualPhotoGps = null;
|
let manualPhotoGps = null;
|
||||||
|
|
||||||
|
function openManualCamera() {
|
||||||
|
// Camera shortcut — EXIF won't survive but quick for field use
|
||||||
|
const inp = document.createElement('input');
|
||||||
|
inp.type = 'file';
|
||||||
|
inp.accept = 'image/*';
|
||||||
|
inp.capture = 'environment';
|
||||||
|
inp.onchange = handleManualPhotoFile;
|
||||||
|
inp.click();
|
||||||
|
}
|
||||||
|
|
||||||
async function handleManualPhotoFile(event) {
|
async function handleManualPhotoFile(event) {
|
||||||
const file = event.target.files?.[0];
|
const file = event.target.files?.[0];
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user