Repository navigation
LR-IMP-FORMATS: decode table-less Nikon 34713 NEFs stored as packed 12/14-bit data - #671
Conversation
431d2eb to
10f765f
Compare
|
Thanks, the packed-layout analysis is careful work. This needs a rebase. #727 (compressed NEFs probed from their headers) is landing now and restructures the same strip-decode path in While you're in there:
Generated by Claude Code |
… under 34713 The Coolpix P330, P7700 and P7800 NRWs carry compression 34713 with no maker note 0x0096 table, 12 bits, one sample per pixel and a single strip of exactly width * height * 2 bytes. The strip is one big-endian 16-bit word per pixel, row-major with no header or padding; the sample is the word >> 4. The layout was found by black-box analysis of the CC0 raw.pixls.us files (strip byte-count identity, same-colour smoothness, correlation with the embedded JPEG), not from any other converter's code. The group is tried after the other packed layouts, so it cannot take a strip they handle. Black level: these files have no 0x003d and no NRW block and no masked pixels, so it is 200 (the floor of the P7800 frame is 201; the other Coolpix NRWs state 200), never above the darkest sample. White comes from the data. Other Nikon NEF/NRW files decode identically (278 checked). Bumps RENDER_CACHE_VERSION to 52.
…s and strip bounds
10f765f to
781e612
Compare
|
Rebased onto main’s current Nikon reader. Packed decodes now follow Raw tests, all-target raw Clippy and raw wasm checks pass. Full CI stops at the same |
|
The table-less packed-strip reader now requires the entire declared strip range to be present before either a Header probe or a Full decode succeeds. The shared TIFF helper can return a clipped slice at EOF, so checking only that a slice exists was insufficient. The regression relocates the strip after all intact metadata, then removes its tail. It fails with the length guard disabled and passes with the guard enabled, for both probe modes. Valid packed files retain their existing decoded samples. This changes malformed-input rejection and does not add another render-cache version bump. Credit: @radialmonster. |
…E5700 CYGM, E8400, E8800) Only the PR's own commits on top of storytold/lightcraft#671 (table-less 34713 NEFs, which the fork already decodes: fork issue emmertex#769). Thanks @radialmonster Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…4:2:2 luma/chroma Only the PR's own commits on top of storytold/lightcraft#671 (already in the fork, issue emmertex#769); the small-raw path sits beside the fork's table-less packed decoder. Thanks @radialmonster Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers packed NEF/NRW layouts, including the Z 6II geometry reported in #769.
Some NEFs labelled compression 34713 contain packed samples rather than a compressed stream, with no linearization table. This extends the existing Nikon reader to select the layout from bit depth, dimensions and complete strip length: LSB-packed rows, 16-byte padded rows, D100 groups and big-endian 16-bit NRW words. High Efficiency codestream detection and the current compressed decoder stay in the same routing chain.
Rebased onto main’s
Mode/MASK_ROWSimplementation. Header probes decode only the needed prefix; header/full geometry agrees. Width/bit/stride arithmetic is checked and strips outside the file are rejected. Render-cache version is 65.Raw tests, all-target raw Clippy and raw wasm checks pass. Together with stacked #673, a fresh comparison covers 86 CC0 Nikon raws and controls: 22 newly decode (all 20 known packed-layout files and two small-RAW files from #673), and the other 64 retain identical decoded sensor samples. Synthetic regressions cover layout geometry, overflow, truncated strips and bounded header probes.
The packed reader validates the complete declared strip range before both Header and Full behavior. A strip clipped at EOF is corrupt even when all metadata is intact. A metadata-first tail-truncation regression fails with the guard disabled; valid decoded samples remain unchanged.
Validation limitation:
cargo xtask cipasses formatting, then stops at the unchangedtests_export.rsClippydrop_non_droperror reproduced on main. The full workspace baseline also has Windows export-path and folder-drop test failures. Only 62 of the 447 pinned corpus files are available here; unavailable cases are skipped.Credit: @radialmonster.