Repository navigation
Raw decoder: dnglab (rawler) as a third per-camera decoder - #1836
Merged
Merged
Conversation
Adds lcc-dnglab, a small wrapper over dnglab's rawler crate (pure Rust, LGPL-2.1, crates.io 0.8), and wires it into the per-camera raw decoder choice beside Auto, lcc-raw and LibRaw. Choosing dnglab reads the mosaic with rawler and falls back to lcc-raw when it fails; Auto now tries LibRaw, then dnglab, for files lcc-raw refuses as unsupported. The app still demosaics and develops the picture itself. rawler's output is checked as hostile input (sizes, CFA, black grid re-anchored at the image area, levels, matrix), panics are caught, and its default crop is used when lcc-raw's header probe sees another image area. On by default in the desktop app and CLI (`dnglab` feature); not in the web build (panic = abort there). Checked on six real raws (20D/7D CR2, R6 CR3, A7R III and RX100 VII ARW): same mosaic as lcc-raw bit for bit on CR2/CR3 and uncompressed ARW, mean difference 0.75 DN on lossy-compressed ARW; final crops match. Sources: rawler 0.8 (https://github.com/dnglab/dnglab), used as a dependency, unmodified; NOTICE and licence text in crates/dnglab. Manual: reference/settings (Raw decoder) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VFDreSrZaZSYHG2uVG77A
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VFDreSrZaZSYHG2uVG77A
rawler declares the deprecated SPDX id `LGPL-2.1` (= LGPL-2.1-only, already allowed); cargo deny matches ids literally. `cargo deny check licenses sources` was rejected, now ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VFDreSrZaZSYHG2uVG77A
rawler doesn't build for wasm32 (its uuid needs a randomness source), and the xtask wasm check builds every crate there. rawler is now a non-wasm32 dependency; on the web decode() says dnglab isn't part of that version (the web build never enables the feature anyway). cargo clippy -p lcc-dnglab --target wasm32-unknown-unknown -D warnings: ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VFDreSrZaZSYHG2uVG77A
emmertex
enabled auto-merge
December 2, 2026 12:02
Owner
Author
|
PR steward review at 6447c87: looks good — rawler output is checked as hostile input (sizes, CFA, black grid, levels, matrix) with a catch_unwind guard and hostile-bytes tests; licence/NOTICE/deny/license-status, layers, all fork locales, manual and whats-new/changelog entries are in place; new deps are all crates.io. Required check is green and auto-merge is on, but merge is blocked by the code-owner review rule, which the PR author can't satisfy; left for a maintainer to merge. |
clydecbrown
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Andrew · project thread
Problem
The per-camera raw decoder choice offered only the built-in decoder (lcc-raw) and LibRaw. dnglab's decoder library (rawler, pure Rust) is a third mature decoder worth having, for comparing decoders and as a fallback for files the others can't read.
Change
crates/dnglab(lcc-dnglab, L0): wrapsrawler0.8 and turns its output into the app's terms. Everything rawler reports is checked as hostile input: sizes, CFA (RGB only; 4-colour sensors are refused), the black grid re-anchored from the data origin to the image area, the clip level, as-shot multipliers, the D65 matrix. Panics are caught. Its default crop is passed on (relative to the image area).lcc_engine::raw_decoder:Decoder::Dnglab(iddnglab, also typedrawler), a dnglab backend slot built in with the engine's newdnglabfeature (install_dnglab,dnglab_name,dnglab_built_in),Used::Dnglab, and the backends' names in the cache key.Framegains an optionalcrop, used only when lcc-raw's header probe sees another image area.library.preferencesacceptsdecoder: "dnglab"and reportsdnglab(the built-in name, or null).Not in this PR: Android enablement; rawler's own camera colour matrices are used only as a last resort (same rule as LibRaw's); rawler's lens/opcode data is not taken (lcc-raw's header probe supplies it when it agrees on the sensor area).
How it was checked
cargo xtask ci --quick --base origin/staging: fmt, brand, docs, notes, i18n, windows, clippy, heif, stamp pass; test step fails only onlcc-catalogtests_v4::an_older_store_that_cant_be_marked_is_refused_untouched, which relies on file permissions and can't pass when the container runs as root (unrelated).cargo xtask layers,assets,paritypass.cargo test -p lcc-engine --features dnglab --lib raw_decoder(14 pass, incl. the real rawler reading the synthetic DNG to the same mosaic as lcc-raw) andcargo test -p lcc-dnglab(hostile bytes, black-grid shift, patterns, levels).Real files (Andrew's own raws, compared rawler vs lcc-raw mosaic):
Decode times were within 2x of lcc-raw either way (release build).
Merging
crates/dnglab/;docs/license-status.mdupdated.rawler(LGPL-2.1, indeny.toml's allow-list) and its new transitive crates (libflate, toml 0.8, winnow, adler32, dary_heap, enumn, rle-decode-fast; MIT/Apache/Zlib). Nounsafein our code; no build scripts, network or processes.Checklist
tr()and has its key in every fork catalogManual: reference/settings (Raw decoder)
Generated by Claude Code