Skip to content

Only a scan you split can be a diptych - #875

Merged
marcinz606 merged 1 commit into
mainfrom
fix/half-frame-explicit
Aug 17, 2026
Merged

Only a scan you split can be a diptych#875
marcinz606 merged 1 commit into
mainfrom
fix/half-frame-explicit

Conversation

@marcinz606

Copy link
Copy Markdown
Owner

Follow-up to #874. That PR fixed two ways a frame got stuck as a half-frame diptych; this removes the cause both shared.

The problem

_mark_diptychs declared a whole scan a diptych purely because a <hash>#1 or <hash>#2 settings row existed:

a["diptych"] = half_hash(a["hash"], 1) in found or half_hash(a["hash"], 2) in found

Those rows are keyed by content hash, so they outlive the folder, the session and Half Frame being on. Any frame whose hash was worked on as two halves once came back split for good, at half width, with a disabled controls panel. #874 closed two ways such a row appears (composites, auto-metering); the inference itself stood.

The change

Discovery records the base hashes it actually splits with Half Frame on, in a half_frame_scans global setting, and both readers require that record. diptych_configs rejects an unrecorded hash, and _mark_diptychs flags every unrecorded, composite or half-suffixed scan diptych = False so the lookup is skipped later too.

Existing pairs are deliberately not backfilled, because a backfill reproduces the stale claim. Such a scan renders whole again, keeps both halves' edits, and returns as a diptych the next time it is split.

Docs: the half-frame section says which scans come back as diptychs, and its prose lost the em dashes it had picked up.

Verification

  • New tests: half edits alone do not make a diptych, at both the diptych_configs and the _mark_diptychs / diptych_pair level, plus the split-scan set write path.
  • make lint, make type clean; 4173 tests pass. Two failures in tests/scanners/test_backend_registry.py are pre-existing here (pyopticfilm not installed), confirmed by stashing.

A whole scan was declared a diptych on the sole evidence that a `<hash>#1` or
`<hash>#2` settings row existed. The row is keyed by content hash, so it outlives
the folder, the session and the mode being on, and any frame whose hash was ever
worked on as two halves came back split, at half width, with a dead controls panel.

Discovery now records the base hashes it actually splits with Half Frame on, and
both readers require that record. Existing pairs are deliberately not backfilled,
since a backfill reproduces the stale claim: those scans render whole again, keep
both halves' edits, and return as diptychs the next time they are split.
@marcinz606
marcinz606 merged commit 480af38 into main Aug 17, 2026
1 check passed
@marcinz606
marcinz606 deleted the fix/half-frame-explicit branch August 17, 2026 05:50
activexray pushed a commit to activexray/NegPy that referenced this pull request Aug 17, 2026
A whole scan was declared a diptych on the sole evidence that a `<hash>marcinz606#1` or
`<hash>marcinz606#2` settings row existed. The row is keyed by content hash, so it outlives
the folder, the session and the mode being on, and any frame whose hash was ever
worked on as two halves came back split, at half width, with a dead controls panel.

Discovery now records the base hashes it actually splits with Half Frame on, and
both readers require that record. Existing pairs are deliberately not backfilled,
since a backfill reproduces the stale claim: those scans render whole again, keep
both halves' edits, and return as diptychs the next time they are split.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant