Repository navigation
Pair JPEG+DNG twins as one catalog photo - #21
Merged
Merged
Conversation
Camera dumps often include a developed JPEG and a matching DNG raw file with the same stem. Index both as a single Photo row: the JPEG is the primary path shown in the grid, with raw_relpath pointing at the DNG kept on disk. - Add raw_relpath column with migration on catalog open - Skip standalone DNG indexing when a JPEG twin exists (mirrors Live Photo MOV skip) - Exclude edited sidecar stems from pairing - Delete/copy/cut/paste move DNG companions with the shown still - Unit tests for pairing, indexing, delete, and clipboard Co-authored-by: Maurice Wipf <mauricewipf@users.noreply.github.com>
Gate dng_twin_for_still on is_jpeg_dng_still so a lone DNG is not treated as its own RAW companion. Add regression tests for orphan.DNG. Co-authored-by: Maurice Wipf <mauricewipf@users.noreply.github.com>
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
Problem
Camera dumps land as JPEG+DNG twins with the same stem. Hallward indexed both as separate stills, so the album grid showed two cells per shot.
Solution
Pair matching JPEG+DNG files as one catalog
Photowith two paths:relpath) — the developed JPEG shown in the grid, thumbs, and viewerraw_relpath) — the DNG twin kept on disk and in catalog identity, but not indexed as its own grid cellThis mirrors the existing Live Photo pattern (still indexed,
.MOVskipped) but stores the RAW attachment in SQLite because both files are stills.Indexing
raw_relpathset when a DNG twin existsraw_relpathso adding/removing a twin triggers re-index*-edited,*-edited-N) are excluded from pairingFile operations
Delete, copy, cut, and paste treat the DNG companion like a Live Photo
.MOV: it moves/deletes with the shown JPEG.Schema
Adds nullable
raw_relpath TEXTtophotos, migrated automatically on catalog open.Out of scope (per issue)
Test plan
cargo test --locked— all 188 tests greenmediapairing detection, edited-sidecar exclusion, standalone DNG/JPEGindex::jpeg_dng_twins_index_as_one_photo— one row, correctraw_relpathraw_relpath