Skip to content

Commit c414ef0

Browse files
authored
Merge pull request #2689 from francoisgn/round3a-integration
Round 3a integration: 42 PRs of #2580, built and tested locally
2 parents 23f5480 + 3eca6ed commit c414ef0

178 files changed

Lines changed: 13103 additions & 1102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!--
2+
Title: start with the checklist id or the issue, as the commits do:
3+
`LR-IMP-FORMATS: folder import finds Sony SR2 and SRF files`, or `Issue #123: …` when there is no checklist row.
4+
5+
One change per pull request. Unrelated fixes and clean-ups (clippy, formatting, a second feature) go in their own:
6+
small ones land fast, bundles get sent back to be split. The rules are in AGENTS.md.
7+
8+
Delete the sections and lines that don't apply, and these comments. A translation or a one-line fix needs only the
9+
first three sections.
10+
-->
11+
12+
Fixes #
13+
14+
<!-- `Part of #123` when this does only part of the issue. Built on another open pull request? Say so here
15+
(`Stacked on #123`) and name the commits that are this one's own. -->
16+
17+
## Problem
18+
19+
<!-- What is wrong or missing, as a person using the app meets it. For a bug: the cause. -->
20+
21+
## Change
22+
23+
<!-- What you changed and where. -->
24+
25+
**Not in this PR:** <!-- what you left out on purpose, and known limits -->
26+
27+
## How it was checked
28+
29+
- [ ] `cargo xtask ci` passes on this branch, rebased on current `main`
30+
- [ ] A test that fails without this change (for a crash fix: a regression test that panicked before it)
31+
- [ ] User-visible change: ran the app and looked at the result
32+
33+
<!-- Numbers, when it changes rendering, decoding or speed: before and after, on more than one photo or camera
34+
(ΔE against the reference, `cargo xtask bench`, `/usr/bin/time`, memory). Name the files or corpus entries used. -->
35+
36+
## Screenshots
37+
38+
<!-- For a visible change: before and after, labelled. Never a screenshot of an Adobe app. -->
39+
40+
## Merging
41+
42+
<!-- Pull requests land in batches, merged together. This is what the person merging can't see in the diff. -->
43+
44+
- **Overlap:** <!-- open pull requests that fix the same issue or change the same functions, by number, and how
45+
this one differs. Search the open pull requests for the issue number and checklist id first. "none found" is fine. -->
46+
- **Existing edits and libraries:** <!-- does any photo already edited render differently, or any saved setting,
47+
preset, sort order or default change? Then it goes behind a new process version (docs/process-versions.md) or is a
48+
setting that is off by default, with a line in docs/whats-new.md. "unchanged" is fine. -->
49+
- **Shared numbers taken:** <!-- catalog format `VERSION` (crates/catalog/src/journal.rs), `RENDER_CACHE_VERSION`,
50+
`LOOK_VERSION`, process version: the number this takes. If another pull request lands with it first, take one
51+
past main's when you rebase. -->
52+
- **Where it came from:** <!-- for a decoder, camera or lens data, or fitted constants: the public spec, your own
53+
measurements, or observed output, and the files measured. Never GPL / LGPL code (dcraw, LibRaw, rawspeed, darktable,
54+
RawTherapee, lensfun …), text derived from it, or Adobe profiles. -->
55+
- **New dependencies, `unsafe`, build scripts, network access, spawned processes, deleted files, CI or `xtask` gate
56+
changes:** <!-- each with its reason, or "none". Dependencies are pure Rust and use `workspace = true`; actions are
57+
pinned by SHA; downloads are checked against a sha256; nothing leaves the machine unless the person asked. -->
58+
59+
## Checklist
60+
61+
- [ ] No new panic path in non-test code: no `unwrap` / `expect` / `panic!`, no indexing or unchecked arithmetic on a
62+
number from a file, a person or an agent (`get`, `checked_mul`, NaN and char boundaries handled)
63+
- [ ] New text on screen goes through `tr()` and has its key in `crates/ui-egui/locales/*.json`; a new shortcut is
64+
free in `docs/library-shortcuts.md`
65+
- [ ] The feature's rows in `docs/parity-checklist.md` and its entry in `docs/gaps.md` are updated, honestly (🟡 when
66+
it is partial), in the same commit
67+
- [ ] New code has a caller: no command, module or setting that nothing reaches yet
68+
- [ ] Every new image, icon or other asset has its entry in `assets/ATTRIBUTION.md`; no font or media files added
69+
- [ ] Ready to merge (otherwise open it as a draft)

‎CLAUDE.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ of it. Full standard: `../craftrules/standards/never-crash.md`
6868
`Cancel::No` when the job can't stop. No progress window, panel or progress toast of its own; its tests assert the row.
6969
- **Resolution independence:** settings use normalized image coordinates and relative radii; previews and exports must match.
7070
- **Time goes through `chrono`** (workspace dependency). Never hand-roll UTC/calendar conversion (days-to-date algorithms, leap-year math); a crate owns only its output format string. The one exception is range extension: past the years chrono can represent, shift the date by whole 400-year Gregorian cycles (146,097 days, after which the calendar repeats), let chrono compute the month and day, and add the cycles back to the year (splitting seconds into hours, minutes and seconds is plain arithmetic).
71-
- **Quality gates** before every commit: `cargo xtask ci` (fmt, clippy -D warnings, tests, layers, assets, wasm).
71+
- **Quality gates** before every commit: `cargo xtask ci --quick` (fmt, clippy -D warnings, the changed packages'
72+
tests, layers, assets, and heif / parity / wasm when touched). GitHub runs the full `cargo xtask ci` on every PR
73+
(`.github/workflows/ci.yml`); run the full one locally before merging branches (below) or when `--quick` can't see
74+
the risk. One `ci` runs at a time per machine; others wait their turn (`xtask/src/ci_lock.rs`).
7275
- **Commits:** one task id per commit (`M2.3: local Laplacian highlights/shadows`). Only green states. End messages with the attribution line required by the environment.
7376

7477
## Assets: icons, images, fonts (ABSOLUTE RULE — never violate)

‎Cargo.lock‎

Lines changed: 4 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = ["crates/*", "apps/*", "xtask"]
66
version = "0.13.0"
77
edition = "2024"
88
license = "MIT OR Apache-2.0"
9-
rust-version = "1.90"
9+
rust-version = "1.95"
1010
repository = "https://github.com/storytold/lightcraft"
1111

1212
[workspace.dependencies]
@@ -60,7 +60,7 @@ libc = "0.2" # dev-only: process CPU time in benches
6060
dhat = "0.3" # opt-in heap profiling (lightcraft-cli --features dhat-heap) and heap tests; never in product builds
6161

6262
# formats
63-
quick-xml = "0.38"
63+
quick-xml = "0.41"
6464
miniz_oxide = "0.8"
6565

6666
# codecs

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,17 @@ cargo run --release -p lightcraft -- --control 7980 # with the automation ch
405405
cargo xtask web --serve # the same app in the browser: http://127.0.0.1:8080/
406406
cargo run --release -p lightcraft-cli -- render photo.jpg -o out.jpg --set light.exposure=0.5
407407
cargo xtask ci # fmt, clippy, HEIF, tests, parity, layers, assets, WASM
408+
cargo xtask ci --quick # only what your branch's changes can break (minutes)
408409
```
409410

411+
`cargo xtask ci --quick` compares with the merge base of `origin/main` (`--base REF` for another)
412+
and runs fmt, clippy, the tests of the changed packages, layers and assets, plus HEIF, parity and
413+
the wasm check when the changes touch them; a change to `Cargo.toml`, `Cargo.lock` or the lint
414+
config tests everything. GitHub runs the full `cargo xtask ci` on every pull request
415+
(`.github/workflows/ci.yml`). Only one `ci` runs at a time per machine: a second one, from another
416+
worktree say, waits for the first and names it, since several at once take longer in total than in
417+
turn. `LIGHTCRAFT_CI_SLOTS=2` allows two; `LIGHTCRAFT_CI_LOCK=off` skips the lock.
418+
410419
CI defaults to line-table debug information and one build job per 1.5 GB of RAM
411420
available when it starts (at most one per CPU; 4 if memory can't be read), so an
412421
8 GB machine with 6 GB free builds with 4, and a busy machine with little free

‎README.zh-hans.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,18 @@ lightcraft --control 7980 ~/Pictures/trip
298298

299299
## Feature status
300300

301-
LightCraft 很年轻,而且进展很快。**我们如实所处的位置**(细节见[路线图](ROADMAP.md#where-we-stand)):
301+
LightCraft 很年轻,而且进展很快。**我们如实所处的位置**(细节见[路线图](ROADMAP.md)):
302302

303303
- **按功能数量算,我们达到了约 79%**(核心功能 98%),逐行记录在
304-
[docs/parity.md](docs/parity.md)。
304+
[docs/parity-checklist.md](docs/parity-checklist.md)。
305305
- **作为日常使用的工具,我们更接近 60–70%。** 在单台机器上处理 JPEG/DNG 以及大多数尼康/索尼/
306306
较老佳能的 raw 都很出色。
307307
- **最大的缺口:**
308308
- **相机色彩校准:** 索尼、尼康、松下、富士和佳能 CR3 的 raw 会从各自的相机 JPEG 得到受保护的估计值,内置 ILCA-99M2、ILCE-7CR、ILCE-7M4、X-H2S、X-T4、尼康 Z 6II、Z 8 和 D5300 配置文件;实测校准仍然缺失,其他 raw 或被拒绝的拟合会保留中性矩阵;
309309
- **压缩的奥林巴斯 raw 和不受支持的 CR3 变体:** 这些在有内嵌 JPEG 预览时使用预览。富士无损/有损压缩 RAF 现在能解码传感器数据;[验证与已有图库重新加载说明](docs/raf-compression.md);
310310
- **AI 蒙版与降噪:** 主体和天空选择目前是经典启发式算法;
311311
- **屏幕上的 HDR 显示、视频,以及经典版式中的打印/画册/地图模块。**
312-
- **接下来做什么:** 见[我们要去往哪里](ROADMAP.md#where-were-going)。
312+
- **接下来做什么:** 见[我们要去往哪里](ROADMAP.md#upcoming)。
313313

314314
| 领域 | 状态 |
315315
|---|---|
@@ -333,7 +333,7 @@ LightCraft 很年轻,而且进展很快。**我们如实所处的位置**(
333333
| 镜头校正(畸变、暗角、自动 + 手动色差、去边、DNG 文件内嵌的镜头校正以及松下/徕卡 RW2/RWL 畸变数据)、几何(变换、限制裁剪)、垂直校正(自动/水平/垂直/完整/引导式) | ✅ · 相机镜头配置文件(我们自己的)⬜ |
334334
| 照片合并:HDR(自动对齐、去重影)、全景(球面/圆柱/透视、边界变形、自动裁剪)、HDR 全景 → DNG | ✅ |
335335
| GPU 管线(wgpu 计算,与 CPU 一致到 1/255 以内)、设备限制/出错时回退到 CPU | ✅ · 浏览器中的 WebGPU 🚧 |
336-
| AI:分割蒙版、AI 降噪、超分辨率、人脸;视频 | ⬜(见[路线图](ROADMAP.md#where-were-going)) |
336+
| AI:分割蒙版、AI 降噪、超分辨率、人脸;视频 | ⬜(见[路线图](ROADMAP.md#upcoming)) |
337337
| 网页版(通过 WASM 在浏览器中使用同一界面):图库持久化在 OPFS/IndexedDB、Web Worker 渲染、导出下载 | ✅ · WebGPU、Safari/Firefox 测试 🚧 |
338338

339339
<sub>✅ 现已可用 · 🚧 进行中 · ⬜ 尚未开始</sub>

‎ROADMAP.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Stage: alpha** · next: beta, ~14 points and ~340–600 h away
44

5-
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-16 · **Change:** minor (Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; German catalog 91% → 97%: interface strings and What's New lines translated) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
5+
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-22 · **Change:** minor (Print: Japanese photo and postcard paper sizes — L判, 2L判, KG判, はがき, 往復はがき, 六切, 四切, 名刺; Minolta MRW decoded, 6 bodies verified; RAW: 83% of Adobe's models decode, 38% verified after the camera-coverage sweep #1327; German catalog 91% → 97%: interface strings and What's New lines translated) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
66
77
One-page summary of how close LightCraft is to Adobe Lightroom. Agents: read this, then pick work
88
from [docs/gaps.md](docs/gaps.md). The full assessment, method and evidence are in
@@ -114,6 +114,11 @@ Ranked toward beta; detail in [docs/roadmap.md](docs/roadmap.md), gaps in [docs/
114114

115115
## Progress log
116116

117+
- 2026-10-22: Print page setup and PDF output gain the Japanese photo and postcard papers — L判
118+
(89 × 127 mm), 2L判 (127 × 178), KG判 (102 × 152), はがき (100 × 148), 往復はがき (148 × 200),
119+
六切 (203 × 254), 四切 (254 × 305) and 名刺 (55 × 91) — at their exact metric sizes. The Print dialog
120+
and `print.set` take their customary names, and names are matched case-, space- and
121+
punctuation-insensitively (`L判`, `l`, `L-size` are one paper).
117122
- 2026-10-14: Camera-coverage sweep verifies 30 more models on 40 CC0 files, with file and sensor
118123
hashes pinned (`docs/raw/coverage.py`: 515 → 545 verified). Eleven candidates excluded after rechecking
119124
identity, provenance and camera-image agreement. Phone and drone DNG tone differences remain tracked in #1277.
@@ -186,6 +191,7 @@ Ranked toward beta; detail in [docs/roadmap.md](docs/roadmap.md), gaps in [docs/
186191

187192
| Date | Change | Summary |
188193
|---|---|---|
194+
| 2026-10-22 | minor | Print: Japanese photo and postcard paper sizes (L判, 2L判, KG判, はがき, 往復はがき, 六切, 四切, 名刺) in the page setup, Print dialog and PDF output; headline numbers unchanged |
189195
| 2026-10-19 | minor | Indonesian interface (`id`): every plain and formats message, plus 69 command labels, locale, menu command and tests; What's New left in English; Localization ~55% → ~64% (mean of the 12 key languages), 8 of 12 present |
190196
| 2026-10-12 | minor | Italian interface (`it`, #1192): 2,201 of 2,398 messages, locale, menu command and tests; headline numbers unchanged |
191197
| 2026-10-13 | minor | Sony ILCA-99M2 camera colour profile in the log; numbers unchanged |
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//! The page's automation entry point, `lightcraft.command(id, params)` (see `web.rs`): what the
2+
//! params text means. Plain Rust, so it is tested natively.
3+
4+
use serde_json::Value;
5+
6+
/// The command parameters in `text`: a JSON object, or `{}` when the text is empty or blank (or
7+
/// `null`). Anything else is an error, never `{}`: a command run without its params acts on the
8+
/// selection or with defaults, so a typo such as `{ids: [3]}` must not delete or reset the
9+
/// selected photos. The control channel and MCP refuse such params the same way.
10+
pub fn params(text: &str) -> Result<Value, String> {
11+
let text = text.trim();
12+
if text.is_empty() {
13+
return Ok(Value::Object(Default::default()));
14+
}
15+
match serde_json::from_str::<Value>(text) {
16+
Ok(Value::Null) => Ok(Value::Object(Default::default())),
17+
Ok(v @ Value::Object(_)) => Ok(v),
18+
Ok(_) => Err("params must be a JSON object, e.g. {\"ids\": [3]}".into()),
19+
Err(e) => Err(format!("params are not valid JSON ({e}); nothing was run")),
20+
}
21+
}
22+
23+
#[cfg(test)]
24+
mod tests {
25+
use super::*;
26+
use serde_json::json;
27+
28+
#[test]
29+
fn blank_or_null_params_are_an_empty_object() {
30+
for text in ["", " ", "\n", "null", " null "] {
31+
assert_eq!(params(text), Ok(json!({})), "{text:?}");
32+
}
33+
}
34+
35+
#[test]
36+
fn an_object_is_passed_through() {
37+
assert_eq!(params(r#"{"ids": [3], "rating": 5}"#), Ok(json!({"ids": [3], "rating": 5})));
38+
}
39+
40+
/// Before, any of these ran the command with `{}`: `photo.delete` then removed the selection.
41+
#[test]
42+
fn invalid_json_or_a_non_object_is_refused() {
43+
for text in ["{ids: [3]}", "{\"ids\": [3]", "ids=3", "[3]", "3", "\"{}\"", "true"] {
44+
assert!(params(text).is_err(), "{text:?} must not run the command");
45+
}
46+
assert!(params("{ids: [3]}").unwrap_err().contains("nothing was run"));
47+
}
48+
}

‎apps/lightcraft-web/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![forbid(unsafe_code)]
1717
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
1818

19+
pub mod automation;
1920
pub mod backup;
2021
pub mod bench;
2122
pub mod files;

0 commit comments

Comments
 (0)