Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge PR #1613

Brandon Thomas5b3856ba2b9b
diff --cc crates/engine/src/camera_preview.rs
index c5d0a1956,77fe8f6ef..60c0bd556
--- a/crates/engine/src/camera_preview.rs
+++ b/crates/engine/src/camera_preview.rs
@@@ -121,27 -119,13 +121,30 @@@ pub(crate) fn starting_colour_tags(raw
if lightcraft_raw::color::has_matrix(&raw.color) {
return None;
}
+ // the white the source shows, decided before `starting_colour` may fill in measured matrices
+ let scale = crate::files::WbScaleOf::new(raw.format, &raw.color, raw.wb_multipliers, &raw.metadata);
+ let white = scale.dng_white(&raw.color, lightcraft_raw::color::as_shot_white_xy(raw));
let (_, t, look) = starting_colour(raw, bytes);
- dng_colour(&raw.color, &t, look.as_ref())
+ dng_colour(&raw.color, &white, &t, look.as_ref())
}
+/// Give a raw about to be written as a DNG of its own (Export as DNG, Convert / Copy as DNG) the colour it opens
+/// with, when the file has no colour matrices (issue #1745: a Z 9 NEF's DNG had no `ColorMatrix1`, and other raw
+/// converters refused it). The lens corrections stay in the DNG; only the fit sees the raw without them, as when
+/// the photo opens.
+pub(crate) fn with_starting_colour(raw: &mut RawImage, bytes: &[u8]) {
+ if lightcraft_raw::color::has_matrix(&raw.color) {
+ return;
+ }
+ let list3 = raw.opcodes.list3.clone();
+ raw.opcodes.list3.retain(|op| !op.is_lens_correction());
+ let tags = starting_colour_tags(raw, bytes);
+ raw.opcodes.list3 = list3;
+ if let Some(tags) = tags {
+ raw.color = tags;
+ }
+}
+
/// DNG tags that render white-balanced camera RGB at its as-shot white as `t` with `look` on top does: one forward
/// matrix (with a colour matrix and as-shot neutral that agree with it at that white), the look's hue/saturation
/// table as `ProfileHueSatMap` and its tone curve as `ProfileToneCurve`. Not quite the same render: a DNG table
diff --cc docs/whats-new.md
index a61a6f059,06993f1c6..19570b7dc
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@@ -95,35 -6,14 +95,41 @@@
- A spot with Feather at 0 no longer draws black pixels exactly on its radius. This also fixes spots at 0% Opacity
changing pixels along their edge. The hard edge now leaves pixels on the radius unchanged.
+ ### HDR merges keep the white balance
+ - An HDR merged from raws that LightCraft colours from the camera's JPEG (CR2, NEF, ARW…) now opens at the same
+ As Shot temperature and tint as its photos, and changing the white balance no longer turns it green. Sony ARW
+ merges used to open at about 7000 K / +115 where the photos show 4000–5300 K / +8. HDRs merged before this keep
+ their old white balance; merge them again.
+
## 2026-10-13
+### Edits keep up in a large library
+- A small edit (a keyword, a rating, a flag, a slider) no longer has the grid's list worked out again from every
+ photo: only the photos the edit touched are asked about again and put at their place in the order. In a library of
+ 67,000 photos that step went from 37 ms to under 1 ms. Still worked out whole: an edit to more than 256 photos, a
+ change to an album, a stack or the keyword list, an album shown in its own order, Recently Added, Missing Photos,
+ and a view that asks about "the last N days".
+- With no filter set, the count of the source is taken from the list instead of from a second pass over the library.
+- The side panels keep a tally an edit cannot have changed: a rating or a slider changes none of the folders,
+ keywords, dates, people and counts; a keyword leaves the folders, the dates and the counts as they are. With both
+ side panels open, the frame after a keyword went from about 156 ms to about 54 ms in that library (2 ms with the
+ panels closed, from 71 ms).
+- The count beside each smart album in the left panel follows an edit the same way: the album asks only the photos
+ the edit touched, where it asked every photo of the library after each edit (about 25 ms an album in that library).
+ With that, the frame after a keyword is at about 29 ms there. New rules, a change to an album or the keyword list,
+ an edit to more than 256 photos, and each new minute for an album that asks about "the last N days" are still
+ counted from every photo.
+- Still tallied from every photo on each edit: the filter bar's lists of cameras, lenses and keywords.
+
+### A view can hold its photos until you refresh it
+- View ▸ Hold View Until Refreshed (off unless you turn it on; kept with the library). With it on, an edit that makes
+ a photo stop matching the view keeps it in the view: a keyword given in a smart album of photos without keywords,
+ a flag taken off in Picks, a rating that falls under the filter bar's. With it off, as before, the photo leaves the
+ grid at once and every photo after it moves up. View ▸ Refresh View (also in the sort menu while the hold is on),
+ Reshuffle, another source, filter or sort, or new rules for the smart album shows what matches now.
+- Photos that start matching still appear at once, and deleting a photo or taking it out of the album or folder
+ shown still takes it out of the view.
+
### HDR merges keep the lens correction
- An HDR made with Photo ▸ Photo Merge ▸ HDR now keeps the lens correction the photos carry (Sony's, Panasonic's
and Leica's, and the one some DNGs carry, e.g. from drones): Optics ▸ Enable Lens Corrections straightens it as it