Skip to content

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

Merge PR #265

Claude69384ad4305c
diff --cc README.md
index ecca1aae1,2f12cf174..72e36509c
--- a/README.md
+++ b/README.md
@@@ -353,22 -352,9 +353,22 @@@ CRAFT_FONTS_DIR=../craft-fonts cargo ru
Without it LightCraft builds and runs the same, but Chinese and Japanese text have no glyphs. Fonts are never committed to this
repo; see [craftrules `standards/fonts.md`](https://github.com/storytold/craftrules/blob/main/standards/fonts.md).
- **Interface language:** **Edit → Language** (English, 简体中文, 繁體中文(台灣), 日本語) or **Settings → General →
+ **Interface language:** **Edit → Language** (English, 简体中文, 繁體中文(台灣), 日本語, Português (Brasil), Deutsch) or **Settings → General →
Language**; the choice applies immediately and persists. See [docs/localization.md](docs/localization.md).
+**Logs:** the desktop app writes its log to standard error and to `logs/lightcraft.log` in its settings folder
+(Linux `$XDG_CONFIG_HOME/lightcraft/logs/`, by default `~/.config/lightcraft/logs/`; macOS
+`~/Library/Application Support/LightCraft/logs/`; Windows `%APPDATA%\LightCraft\logs\`), never in the library. A
+launch from a desktop menu or the Dock has no terminal, so attach this file to a bug report. Each start moves the
+previous log to `lightcraft.1.log` and that one to `lightcraft.2.log`, so the log of a run that crashed survives the
+next start; the file stops growing at 16 MiB, `--version` and `--help` write none, and runs with
+`LIGHTCRAFT_NO_PREFS` log to standard error only. By default LightCraft's own crates log at `info` and everything else
+at `warn`. `LIGHTCRAFT_LOG=info` or `debug` works as before (that level for LightCraft's own crates, warnings and
+errors from the rest; any other value: warnings and errors only) and wins over `RUST_LOG`, which otherwise replaces
+the default with env_logger-style directives such as `RUST_LOG=debug` or `RUST_LOG=warn,lightcraft_pipeline=trace` (a
+directive ending in `*` covers every target starting with it, as in `lightcraft*=debug`). Panics are recorded there
+too, and still in `lightcraft-panics.log` in the temp folder. The logger is `apps/lightcraft/src/logging.rs`.
+
The web build needs the `wasm32-unknown-unknown` target and the matching `wasm-bindgen` CLI
(`cargo xtask web` prints the exact install command); see [docs/web.md](docs/web.md).
diff --cc crates/ui-egui/locales/ja-formats.json
index f5d7f284a,edf0a76f8..a1ef877f9
--- a/crates/ui-egui/locales/ja-formats.json
+++ b/crates/ui-egui/locales/ja-formats.json
@@@ -122,5 -119,58 +122,59 @@@
"{weekday}, {day}": "{day}日({weekday})",
"{weekday}, {day} {month} {year}": "{year}年{month}月{day}日({weekday})",
"{year}": "{year}年",
- "Remove “{name}” and its {count} photo{} from the library?": "「{name}」と写真{count}枚をライブラリから除去しますか?{:.0}"
++ "Remove “{name}” and its {count} photo{} from the library?": "「{name}」と写真{count}枚をライブラリから除去しますか?{:.0}",
+ " ({unsure} with several look-alike files: use Locate)": " ({unsure} with several look-alike files: use Locate)",
+ " · {:.0}% clipped": " · {:.0}% clipped",
+ " · {failed} couldn't be rendered": " · {failed} couldn't be rendered",
+ " · {} original{} left at the source": " · {} original{} left at the source",
+ " — not carried over: {}{}": " — not carried over: {}{}",
+ "+{} more": "+{} more",
+ "; {kept} already had a location": "; {kept} already had a location",
+ "; {outside} outside its time range": "; {outside} outside its time range",
+ "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}": "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}",
+ "Added {what} to {name}": "Added {what} to {name}",
+ "Auto Import: added {} photo{}": "Auto Import: added {} photo{}",
+ "Building previews for {} photos…": "Building previews for {} photos…",
+ "Couldn't open the editor: {e}": "Couldn't open the editor: {e}",
+ "Creates {} stacks from {} of {scope}": "Creates {} stacks from {} of {scope}",
+ "Done ({what}): {done} photo{plural}": "Done ({what}): {done} photo{plural}",
+ "Focus {:.0}": "Focus {:.0}",
+ "Folder “{}” (and its subfolders)": "Folder “{}” (and its subfolders)",
+ "Found {n} missing photo{}; {left} still missing{unsure}": "Found {n} missing photo{}; {left} still missing{unsure}",
+ "Import failed: {e}": "Import failed: {e}",
+ "Imported {profiles} profile{} (Profile browser ▸ their groups)": "Imported {profiles} profile{} (Profile browser ▸ their groups)",
+ "Insert at the cursor (also written {})": "Insert at the cursor (also written {})",
+ "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.",
+ "Painting “{k}”: click photos to add or remove it · Esc stops": "Painting “{k}”: click photos to add or remove it · Esc stops",
+ "Previews ready for {done} photo{plural}": "Previews ready for {done} photo{plural}",
+ "Removed {what} from {name}": "Removed {what} from {name}",
+ "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.": "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.",
+ "Replace {} with:": "Replace {} with:",
+ "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).": "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).",
+ "Tagged {n} photo{} from the tracklog": "Tagged {n} photo{} from the tracklog",
+ "The SAM 3 download failed: {e}": "The SAM 3 download failed: {e}",
+ "Unknown tag{s} {} stay{} as typed (see Tags)": "Unknown tag{s} {} stay{} as typed (see Tags)",
+ "Virtual copy “{name}” of {of}": "Virtual copy “{name}” of {of}",
+ "Working on {what} for {} photos…": "Working on {what} for {} photos…",
+ "{label} {index} of {n}": "{label} {index} of {n}",
+ "{name} opened for editing; it is stacked with the original": "{name} opened for editing; it is stacked with the original",
+ "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.": "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.",
+ "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry": "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry",
+ "{pid} (missing)": "{pid} (missing)",
+ "{{date:…}} directives: {}": "{{date:…}} directives: {}",
+ "{} contributors · {} commits": "{} contributors · {} commits",
+ "{} failed": "{} failed",
+ "{} item{}": "{} item{}",
+ "{} photos · exposures {} EV": "{} photos · exposures {} EV",
+ "{} photos · {} · {:.0}° × {:.0}°": "{} photos · {} · {:.0}° × {:.0}°",
+ "{} sample{}": "{} sample{}",
+ "{} sec": "{} sec",
+ "{} — show their photos": "{} — show their photos",
+ "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.": "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.",
+ "Filtered: {label}": "Filtered: {label}",
+ "{n} similar photo{} · View ▸ Clear Filters to see all": "{n} similar photo{} · View ▸ Clear Filters to see all",
+ "Moved; {} photo(s) relinked": "Moved; {} photo(s) relinked",
+ "{} label (click more labels to show any of them)": "{} label (click more labels to show any of them)",
+ ", {} star{}": ", {} star{}",
+ ", {} label": ", {} label"
}
diff --cc crates/ui-egui/locales/zh-hans-formats.json
index b87d35fd2,ef2b3e70b..3de7c2707
--- a/crates/ui-egui/locales/zh-hans-formats.json
+++ b/crates/ui-egui/locales/zh-hans-formats.json
@@@ -122,5 -119,58 +122,59 @@@
"{month} {year}": "{year}年{month}月",
"{weekday}, {day}": "{day}日 {weekday}",
"{weekday}, {day} {month} {year}": "{year}年{month}月{day}日 {weekday}",
- "Remove “{name}” and its {count} photo{} from the library?": "要将“{name}”及其 {count} 张照片从图库中移除吗?{:.0}"
++ "Remove “{name}” and its {count} photo{} from the library?": "要将“{name}”及其 {count} 张照片从图库中移除吗?{:.0}",
+ " ({unsure} with several look-alike files: use Locate)": " ({unsure} with several look-alike files: use Locate)",
+ " · {:.0}% clipped": " · {:.0}% clipped",
+ " · {failed} couldn't be rendered": " · {failed} couldn't be rendered",
+ " · {} original{} left at the source": " · {} original{} left at the source",
+ " — not carried over: {}{}": " — not carried over: {}{}",
+ "+{} more": "+{} more",
+ "; {kept} already had a location": "; {kept} already had a location",
+ "; {outside} outside its time range": "; {outside} outside its time range",
+ "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}": "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}",
+ "Added {what} to {name}": "Added {what} to {name}",
+ "Auto Import: added {} photo{}": "Auto Import: added {} photo{}",
+ "Building previews for {} photos…": "Building previews for {} photos…",
+ "Couldn't open the editor: {e}": "Couldn't open the editor: {e}",
+ "Creates {} stacks from {} of {scope}": "Creates {} stacks from {} of {scope}",
+ "Done ({what}): {done} photo{plural}": "Done ({what}): {done} photo{plural}",
+ "Focus {:.0}": "Focus {:.0}",
+ "Folder “{}” (and its subfolders)": "Folder “{}” (and its subfolders)",
+ "Found {n} missing photo{}; {left} still missing{unsure}": "Found {n} missing photo{}; {left} still missing{unsure}",
+ "Import failed: {e}": "Import failed: {e}",
+ "Imported {profiles} profile{} (Profile browser ▸ their groups)": "Imported {profiles} profile{} (Profile browser ▸ their groups)",
+ "Insert at the cursor (also written {})": "Insert at the cursor (also written {})",
+ "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.",
+ "Painting “{k}”: click photos to add or remove it · Esc stops": "Painting “{k}”: click photos to add or remove it · Esc stops",
+ "Previews ready for {done} photo{plural}": "Previews ready for {done} photo{plural}",
+ "Removed {what} from {name}": "Removed {what} from {name}",
+ "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.": "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.",
+ "Replace {} with:": "Replace {} with:",
+ "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).": "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).",
+ "Tagged {n} photo{} from the tracklog": "Tagged {n} photo{} from the tracklog",
+ "The SAM 3 download failed: {e}": "The SAM 3 download failed: {e}",
+ "Unknown tag{s} {} stay{} as typed (see Tags)": "Unknown tag{s} {} stay{} as typed (see Tags)",
+ "Virtual copy “{name}” of {of}": "Virtual copy “{name}” of {of}",
+ "Working on {what} for {} photos…": "Working on {what} for {} photos…",
+ "{label} {index} of {n}": "{label} {index} of {n}",
+ "{name} opened for editing; it is stacked with the original": "{name} opened for editing; it is stacked with the original",
+ "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.": "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.",
+ "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry": "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry",
+ "{pid} (missing)": "{pid} (missing)",
+ "{{date:…}} directives: {}": "{{date:…}} directives: {}",
+ "{} contributors · {} commits": "{} contributors · {} commits",
+ "{} failed": "{} failed",
+ "{} item{}": "{} item{}",
+ "{} photos · exposures {} EV": "{} photos · exposures {} EV",
+ "{} photos · {} · {:.0}° × {:.0}°": "{} photos · {} · {:.0}° × {:.0}°",
+ "{} sample{}": "{} sample{}",
+ "{} sec": "{} sec",
+ "{} — show their photos": "{} — show their photos",
+ "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.": "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.",
+ "Filtered: {label}": "Filtered: {label}",
+ "{n} similar photo{} · View ▸ Clear Filters to see all": "{n} similar photo{} · View ▸ Clear Filters to see all",
+ "Moved; {} photo(s) relinked": "Moved; {} photo(s) relinked",
+ "{} label (click more labels to show any of them)": "{} label (click more labels to show any of them)",
+ ", {} star{}": ", {} star{}",
+ ", {} label": ", {} label"
}
diff --cc crates/ui-egui/locales/zh-hant-formats.json
index fa975732d,c79d29feb..07a05feba
--- a/crates/ui-egui/locales/zh-hant-formats.json
+++ b/crates/ui-egui/locales/zh-hant-formats.json
@@@ -122,5 -119,58 +122,59 @@@
" ({} in Recently Deleted)": "(其中 {} 張在「最近刪除」中)",
"Already in the library: {} photo{} selected in All Photos": "已在照片庫中:已在「所有照片」中選取 {} 張照片{:.0}",
"Already in the library, in Recently Deleted: {} photo{} selected · right-click ▸ Restore, or Delete Permanently to import afresh": "已在照片庫的「最近刪除」中:已選取 {} 張照片{:.0} · 按右鍵 ▸ 還原,或永久刪除後重新匯入",
- "Remove “{name}” and its {count} photo{} from the library?": "要將「{name}」及其 {count} 張照片從照片庫移除嗎?{:.0}"
++ "Remove “{name}” and its {count} photo{} from the library?": "要將「{name}」及其 {count} 張照片從照片庫移除嗎?{:.0}",
+ " ({unsure} with several look-alike files: use Locate)": " ({unsure} with several look-alike files: use Locate)",
+ " · {:.0}% clipped": " · {:.0}% clipped",
+ " · {failed} couldn't be rendered": " · {failed} couldn't be rendered",
+ " · {} original{} left at the source": " · {} original{} left at the source",
+ " — not carried over: {}{}": " — not carried over: {}{}",
+ "+{} more": "+{} more",
+ "; {kept} already had a location": "; {kept} already had a location",
+ "; {outside} outside its time range": "; {outside} outside its time range",
+ "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}": "@{}: {} PRs, {} commits, +{} / −{} lines (Δ {}), +{} / −{} binary assets, {} – {}",
+ "Added {what} to {name}": "Added {what} to {name}",
+ "Auto Import: added {} photo{}": "Auto Import: added {} photo{}",
+ "Building previews for {} photos…": "Building previews for {} photos…",
+ "Couldn't open the editor: {e}": "Couldn't open the editor: {e}",
+ "Creates {} stacks from {} of {scope}": "Creates {} stacks from {} of {scope}",
+ "Done ({what}): {done} photo{plural}": "Done ({what}): {done} photo{plural}",
+ "Focus {:.0}": "Focus {:.0}",
+ "Folder “{}” (and its subfolders)": "Folder “{}” (and its subfolders)",
+ "Found {n} missing photo{}; {left} still missing{unsure}": "Found {n} missing photo{}; {left} still missing{unsure}",
+ "Import failed: {e}": "Import failed: {e}",
+ "Imported {profiles} profile{} (Profile browser ▸ their groups)": "Imported {profiles} profile{} (Profile browser ▸ their groups)",
+ "Insert at the cursor (also written {})": "Insert at the cursor (also written {})",
+ "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.",
+ "Painting “{k}”: click photos to add or remove it · Esc stops": "Painting “{k}”: click photos to add or remove it · Esc stops",
+ "Previews ready for {done} photo{plural}": "Previews ready for {done} photo{plural}",
+ "Removed {what} from {name}": "Removed {what} from {name}",
+ "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.": "Renames “{from}” on {n} photo{} (keywords below it too). Use | for levels, e.g. Travel|Italy. An existing name merges the two.",
+ "Replace {} with:": "Replace {} with:",
+ "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).": "Scores {scope} for focus and exposure and finds similar shots taken within seconds of each other (bursts).",
+ "Tagged {n} photo{} from the tracklog": "Tagged {n} photo{} from the tracklog",
+ "The SAM 3 download failed: {e}": "The SAM 3 download failed: {e}",
+ "Unknown tag{s} {} stay{} as typed (see Tags)": "Unknown tag{s} {} stay{} as typed (see Tags)",
+ "Virtual copy “{name}” of {of}": "Virtual copy “{name}” of {of}",
+ "Working on {what} for {} photos…": "Working on {what} for {} photos…",
+ "{label} {index} of {n}": "{label} {index} of {n}",
+ "{name} opened for editing; it is stacked with the original": "{name} opened for editing; it is stacked with the original",
+ "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.": "{n} change{} couldn't be written to disk: {e}\nIf you quit now, {} lost.",
+ "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry": "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry",
+ "{pid} (missing)": "{pid} (missing)",
+ "{{date:…}} directives: {}": "{{date:…}} directives: {}",
+ "{} contributors · {} commits": "{} contributors · {} commits",
+ "{} failed": "{} failed",
+ "{} item{}": "{} item{}",
+ "{} photos · exposures {} EV": "{} photos · exposures {} EV",
+ "{} photos · {} · {:.0}° × {:.0}°": "{} photos · {} · {:.0}° × {:.0}°",
+ "{} sample{}": "{} sample{}",
+ "{} sec": "{} sec",
+ "{} — show their photos": "{} — show their photos",
+ "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.": "LightCraft can't decode this raw variant yet ({}). You're editing the camera's embedded JPEG preview, which already includes the camera's picture style (e.g. Monochrome) and white balance.",
+ "Filtered: {label}": "Filtered: {label}",
+ "{n} similar photo{} · View ▸ Clear Filters to see all": "{n} similar photo{} · View ▸ Clear Filters to see all",
+ "Moved; {} photo(s) relinked": "Moved; {} photo(s) relinked",
+ "{} label (click more labels to show any of them)": "{} label (click more labels to show any of them)",
+ ", {} star{}": ", {} star{}",
+ ", {} label": ", {} label"
}
diff --cc crates/ui-egui/src/lib.rs
index 479825bfa,75ce3b0ae..a76f167fb
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -361,8 -343,15 +363,16 @@@ impl LightcraftApp
(Some((n, e)), false) => {
self.ui.unsaved_seen = true;
let t = ctx.input(|i| i.time);
- let what = if n == 1 { "1 change".to_string() } else { format!("{n} changes") };
- self.ui.toast = Some((format!("{what} saved in memory but not written to disk: {e} — LightCraft will retry"), t + 6.0, None));
+ self.ui.toast = Some((
+ crate::i18n::tr_format!(
+ "{n} change{} saved in memory but not written to disk: {e} — LightCraft will retry",
+ if n == 1 { "" } else { "s" },
+ n = n,
+ e = e
+ ),
+ t + 6.0,
++ None,
+ ));
}
(None, true) => {
self.ui.unsaved_seen = false;
diff --cc crates/ui-egui/src/panels/grid.rs
index 0cbd41199,71145d74b..579be2357
--- a/crates/ui-egui/src/panels/grid.rs
+++ b/crates/ui-egui/src/panels/grid.rs
@@@ -490,14 -483,13 +490,14 @@@ fn cell(app: &mut LightcraftApp, ui: &m
lightcraft_catalog::Flag::None => {}
}
if let Some(l) = photo.label {
- spoken.push_str(&format!(", {} label", app.session.catalog.label_name(l)));
+ spoken.push_str(&crate::i18n::tr_format!(", {} label", crate::i18n::color_label(&app.session.catalog, l)));
}
resp.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::SelectableLabel, true, selected, &spoken));
- let active = app.session.selection.active == Some(id);
+ let active = state == lightcraft_engine::SelectionState::Active;
let p = ui.painter();
let img_rect = if square {
- p.rect_filled(r, 0.0, if selected { t.cell_selected } else { t.cell });
+ let base = if selected { t.cell_selected } else { t.cell };
+ p.rect_filled(r, 0.0, crate::theme::label_background(base, photo.label, selected));
Rect::from_min_max(r.min + vec2(10.0, 24.0), r.max - vec2(10.0, 10.0))
} else {
r
diff --cc docs/parity.md
index 2580ec92b,57c43ad06..6bc9ab6f6
--- a/docs/parity.md
+++ b/docs/parity.md
@@@ -79,11 -75,9 +79,13 @@@ Take the first one nobody is working on
use the same model with fixed prompts; denoise / super-resolution models remain a maintainer decision.
7. **HDR** (Q. HDR, LR-EXP-HDR), **video** (R. Video), **Classic output modules** (Map view, Book, Slideshow module,
Print, publish): large, well understood, lower priority than 1–5.
+8. **LR-VIEW-ZOOM** (P0): pinch zoom and two-finger pan now work, with stable image cursors between gesture events.
+ The whole-image preview is still capped by
+ Settings → Performance → Preview size (2,560 px by default). Render visible regions at native resolution so
+ 100% can reliably show original-pixel detail on larger photos.
+ German UI is available (M16, LR-BEHAV-LOCALIZE); German also translates release notes; remaining localisation gaps are technical errors and other locales.
+
## Shortcuts: conflicts and missing bindings
Compared `plan/lightroom/06-shortcuts.md` (desktop part) with our bindings: command specs in `crates/engine/src/cmd/`,