feat(photos): keep M1 mask/axis/measure on calibration pick (#61)
Document single-source M1 path after pickCalibration: Mask/Axis/Measure/ Calculate use the chosen Source only; batch siblings stay draft-untouched until #62 apply. Tag encode-fallback inventory Blob as image/png (CAPTURE.md).
This commit is contained in:
@@ -405,6 +405,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
|
||||
void persist();
|
||||
},
|
||||
|
||||
// #61: enter M1 Mask on the chosen calibration Source only — never loop batch.
|
||||
pickCalibration(index: number) {
|
||||
if (state.k !== 'pickCalibration') return;
|
||||
if (index < 0 || index >= state.photos.length) return;
|
||||
@@ -434,6 +435,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
|
||||
runPass();
|
||||
},
|
||||
|
||||
// #61: Axis uses the same calibration source; draft.batch siblings stay untouched.
|
||||
approveMask() {
|
||||
if (state.k !== 'mask' || !state.overlay || state.overlay.slabPx === 0) return;
|
||||
teardownWorker();
|
||||
@@ -471,6 +473,7 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
|
||||
void persist();
|
||||
},
|
||||
|
||||
// #61: M1 Calculate on the calibration source only (batch apply is #62).
|
||||
async calculate() {
|
||||
if (state.k !== 'measure') return;
|
||||
const { source, approvedMask, axis, lengthEighths, thicknessEighths } = state;
|
||||
@@ -487,7 +490,8 @@ export function createCaptureSession(opts: SessionOpts = {}): CaptureSession {
|
||||
pngBlob = r.blob;
|
||||
belowFloor = r.sourceBelowFloor;
|
||||
} catch {
|
||||
pngBlob = new Blob();
|
||||
// CAPTURE.md: inventory is image/png even when encode is unavailable.
|
||||
pngBlob = new Blob([], { type: 'image/png' });
|
||||
}
|
||||
bitmap.close();
|
||||
if (pngUrl) URL.revokeObjectURL(pngUrl);
|
||||
|
||||
Reference in New Issue
Block a user