Open a photograph with the edit it already carries, when DarkRoom has none

The library's DNGs carry the photographer's earlier develop settings
in their embedded XMP — the house style their photographs were made
with. A photograph opened with no edit of DarkRoom's now starts from
that earlier edit, translated (HSL bands, highlights, blacks and the
rest), as one undoable step named "Earlier Edit"; from there it is an
ordinary edit, saved with the photograph. Export does the same, so a
photograph never opened exports as opening it would show.

Only on positive evidence that there is no DarkRoom edit: a local file
with no sidecar beside it, or a server that answered "no such file"
with nothing in the cache. The stored-edit fetch now says which
(FetchedSidecar::absent). Offline, unreachable or unreadable never
counts — the earlier edit would otherwise be saved over a real edit
that merely failed to arrive.
This commit is contained in:
2026-10-03 14:22:49 -04:00
parent 013596e1bd
commit e12783da9f
6 changed files with 222 additions and 79 deletions
+10 -5
View File
@@ -1293,15 +1293,15 @@ fn render_from_library(
}
};
let sidecar = match wait_for(&sidecar_rx, cancel) {
Waited::Got(sidecar) => sidecar,
let fetched = match wait_for(&sidecar_rx, cancel) {
Waited::Got(fetched) => fetched,
Waited::Cancelled => return None,
// An unedited photograph has no sidecar and a fetch that died looks
// identical from here. Exporting at defaults is what opening it would
// A fetch that died. Exporting at defaults is what opening it would
// do, and refusing the image over a missing edit it may never have had
// would fail the common case.
Waited::Silent => None,
Waited::Silent => crate::library::FetchedSidecar::default(),
};
let sidecar = fetched.sidecar;
let (meta, mut session) = match open_for_export(gpu, request.decoder, &bytes) {
Ok(opened) => opened,
@@ -1318,6 +1318,11 @@ fn render_from_library(
.and_then(dr_pipeline::Sidecar::default_version)
{
session.apply_version(version);
} else if fetched.absent {
// TRACES: FR-DEV-6
// No edit of DarkRoom's, by the server's word: export what opening it
// would show — the photograph's earlier edit, where it carries one.
session.adopt_earlier_edit();
}
// The last cheap place to stop. Everything past here is a full-resolution