Skip to content

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

Merge main into fix/issue-107-web-safety

Brandon Thomas7bbdbc03ef56
diff --cc apps/lightcraft-web/src/web.rs
index 01c400e68,56b2868b3..6d0483a94
--- a/apps/lightcraft-web/src/web.rs
+++ b/apps/lightcraft-web/src/web.rs
@@@ -394,25 -306,22 +395,29 @@@ impl WebApp
r.replayed
),
Err(e) => {
- // the stored library is left untouched; say plainly that nothing here is saved
- notice(format!(
- "The library stored in this browser could not be opened ({e}). This is a temporary session: nothing you do now is saved. \
- The stored library has not been changed."
- ));
- session = Session::with_demo();
+ // never a silent demo session (issue #100): an empty one, and the window says why
+ log::error!("opening the library failed: {e}");
+ session = Session::new();
originals.install(&mut session);
+ problem = Some(lightcraft_ui_egui::panels::library_problem::LibraryProblem {
+ can_retry: false,
+ ..lightcraft_ui_egui::panels::library_problem::LibraryProblem::new(
+ "the browser's storage for this page",
+ format!("{e}. Reload the page to try again."),
+ )
+ });
}
}
+ if backend.is_some() {
+ notice(
+ "LightCraft in the browser is experimental. Your library is kept in this browser's storage: keep your original photos \
+ elsewhere and back up with File ▸ Back Up Library….",
+ );
+ }
// previews are large (≤ 2560 px, f32): keep few in a 32-bit address space
session.media.preview_capacity = 3;
- let mut app = LightcraftApp::new(session, services(originals.clone(), backend.clone(), cc.egui_ctx.clone()));
+ let frozen = Rc::new(Cell::new(false));
+ let mut app = LightcraftApp::new(session, services(originals.clone(), backend.clone(), files.clone(), frozen.clone(), cc.egui_ctx.clone()));
let ui_written = files.get("ui.json").unwrap_or_default();
if let Ok(ui) = serde_json::from_slice::<UiState>(&ui_written) {
app.ui = ui;
diff --cc docs/parity.md
index af5a27eaf,ac62ea34c..b4721b146
--- a/docs/parity.md
+++ b/docs/parity.md
@@@ -44,13 -44,13 +44,13 @@@ and prints the summary; `cargo xtask pa
| U. Map & location (MAP) | 0 | 1 | 1 | 0 | — | 0/1 (0%) |
| V. Preferences (PREF) | 5 | 0 | 3 | 3 | 1/1 (100%) | 4/4 (100%) |
| W. Cloud & AI infrastructure (CLOUD / AI) | 1 | 0 | 1 | 2 | — | — |
-| X. Cross-cutting behaviours (BEHAV) | 15 | 2 | 2 | 1 | 8/8 (100%) | 6/7 (86%) |
+| X. Cross-cutting behaviours (BEHAV) | 15 | 3 | 2 | 1 | 8/8 (100%) | 6/8 (75%) |
| Y. Menus | 81 | 0 | 4 | 8 | 47/47 (100%) | 23/23 (100%) |
| Z. Keyboard shortcuts (desktop) | 74 | 3 | 3 | 1 | 49/52 (94%) | 22/23 (96%) |
- | Lightroom Classic extras | 30 | 9 | 40 | 9 | — | 20/21 (95%) |
- | **Total** | 386 | 29 | 91 | 37 | 194/200 (97%) | 138/148 (93%) |
+ | Lightroom Classic extras | 31 | 9 | 40 | 9 | — | 21/22 (95%) |
-| **Total** | 387 | 28 | 91 | 37 | 194/200 (97%) | 139/148 (94%) |
++| **Total** | 387 | 29 | 91 | 37 | 194/200 (97%) | 139/149 (93%) |
- Weighted completion (✅ = 1, 🟡 = ½, 🚫 left out): **79.2%** of 506 in-scope rows — P0 98.5% of 200 · P1 95.6% of 148 · P2 39.2% of 158.
-Weighted completion (✅ = 1, 🟡 = ½, 🚫 left out): **79.2%** of 506 in-scope rows — P0 98.5% of 200 · P1 95.9% of 148 · P2 39.2% of 158.
++Weighted completion (✅ = 1, 🟡 = ½, 🚫 left out): **79.2%** of 507 in-scope rows — P0 98.5% of 200 · P1 95.6% of 149 · P2 39.2% of 158.
<!-- /parity:summary -->
## Top gaps
diff --cc docs/whats-new.md
index d0c19b487,ce7cd6c1b..daf6ebdea
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@@ -10,12 -10,38 +10,44 @@@
- 23 new built-in presets: Portrait, Landscape, Urban, Food, Seasons, Vintage and B&W toners.
### Reliability
+ - Exports and renders never write over a photo's original (issue #93): exporting into the photo's own folder with
+ the same name and "Overwrite" (or Export with Previous repeating it), an exact output path from the control
+ channel or MCP, a merge preview path or `lightcraft-cli render IMG.jpg -o IMG.jpg` is refused with a clear
+ message, and the original is left byte for byte. Ordinary earlier exports are still overwritten when asked.
+ Exported files are written to a temp file, synced and then renamed into place, so a full disk or an unplugged
+ drive never leaves a truncated file; the XMP sidecar of an "Original" export follows the "If file exists"
+ choice too.
+ - Convert to DNG, Copy as DNG, Photo Merge and smart previews no longer write straight to the final file (issue
+ #106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its
+ name (never replacing a file), and only then is the photo relinked or the raw copy removed — a failed write
+ leaves no DNG and keeps the raw. Smart previews are written the same way; a damaged one (cut short by a crash or
+ a full drive) no longer counts as built and Build Smart Previews replaces it.
+ - Import ▸ Copy verifies every copy, like Move (issue #96): each file is written as a new file, synced to disk and
+ compared byte for byte with the card. A copy that fails or differs is removed and reported as a failed import —
+ so "import complete" means the copies are good before you format the card — and a name that is taken gets -1,
+ -2… instead of being replaced.
+ - Saving metadata to an XMP sidecar another application wrote no longer replaces it (issue #92): LightCraft merges its
+ fields in and keeps the rest — e.g. that application's develop settings and edit history — byte for byte. A
+ sidecar that isn't valid XMP is copied to `<name>.xmp.bak-<time>` first. With the default stem naming, a raw and a
+ JPEG with the same name (`IMG_0001.CR3` + `IMG_0001.JPG`) no longer share one sidecar: the raw keeps `IMG_0001.xmp`,
+ the JPEG uses `IMG_0001.JPG.xmp`.
+ - A save that fails part-way (a full disk, a network share that drops) no longer looks like a damaged catalog
+ afterwards (issue #101): the partial write is cut off before LightCraft retries, so the next launch replays every
+ change. Catalogs already holding such a fragment load in full. Quitting while the catalog log can't be written
+ still saves your queued changes in the closing snapshot.
+ - The catalog has a format version (issue #102). Opening a library from an older LightCraft upgrades it; a library
+ written by a newer LightCraft is refused with "this library was written by a newer version of LightCraft" and left
+ untouched — older versions no longer read part of it as a damaged log. Once this version has opened a library,
+ LightCraft 0.2.0 and older refuse it ("unsupported format … v2").
+ - The control port (`--control`) closes a connection as soon as it receives anything that isn't a JSON request
+ (issue #94): an HTTP request from a web page can no longer carry a command in its body. Lines are capped at
+ 4 MiB and connections at 16.
+- Browser version (experimental), keeping a library safe (issue #107): File ▸ Back Up Library… downloads the catalog
+ and every imported photo as one zip, and File ▸ Restore Library from Backup… brings it back (the current library
+ is kept). A failed save (storage full) now shows the unsaved warning and is retried, a photo that can't be stored
+ isn't added, a second tab shows a message instead of overwriting the first, `?reset` asks first, and the page says
+ when the browser may evict the library. Hosting: the sample cache headers no longer mark the (unhashed) files
+ immutable, and HOSTING.md describes the actual build.
- Canon CR2 photos from the EOS 7D, 50D, 60D, 550D, 600D, 1200D, 1300D, 5D Mark II and 1D Mark IV (and other
models whose sensor starts on a green-blue row) no longer come out magenta (issue #85): the colour-filter
layout is read from each file instead of assumed.