Skip to content

fix(raw): safely open Samsung linear DNG files#1380

Open
VailElla wants to merge 5 commits into
CyberTimon:mainfrom
VailElla:codex/fix-samsung-linear-dng
Open

fix(raw): safely open Samsung linear DNG files#1380
VailElla wants to merge 5 commits into
CyberTimon:mainfrom
VailElla:codex/fix-samsung-linear-dng

Conversation

@VailElla

@VailElla VailElla commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fix Samsung linear DNG decoding and development for #777 and #884 while keeping the DNG exposure path bounded. The decoder pin now includes strict restart-segment truncation and undeclared-marker checks, and thumbnail cache schema v2 prevents stale pre-fix previews from surviving the rendering change.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Pin rawler to ee86c32e3d85ff6057fdc8b3c3eed38923712d91, including repeated black-level handling, lossless-JPEG restart decoding, and strict rejection of truncated restart entropy and undeclared restart markers. This is a temporary downstream pin while the upstream fix is reviewed in dnglab/dnglab#810; after that PR is merged and this fork is synchronized, the lockfile will be refreshed to the synchronized revision.
  • Apply BaselineExposure and BaselineExposureOffset together in linear light, with the effective value bounded to ±16 EV.
  • Read only root-IFD tags 50730 and 51109 through a bounded classic-TIFF scalar parser, avoiding broad metadata/profile/private-data cloning.
  • Add thumbnail cache schema v2 so images cached before the rendering fix are regenerated automatically.
  • Add regression coverage for little- and big-endian DNG metadata, SRATIONAL/RATIONAL exposure tags, malformed/truncated IFDs, invalid rational denominators, and cache-version invalidation.

Screenshots/Videos

N/A — no UI surface changed. The public issue fixtures were used locally and no test photos or screenshot assets are included in this branch.

Testing

  • I have tested these changes locally and confirmed that they work as expected without issues

Test Configuration:

  • OS: macOS 26.5.2
  • Hardware: Apple Silicon (arm64)

Validation performed:

  • cargo +1.96.1 fmt --manifest-path src-tauri/Cargo.toml --check
  • cargo +1.96.1 check --locked --manifest-path src-tauri/Cargo.toml -p RapidRAW
  • cargo +1.96.1 test --locked --manifest-path src-tauri/Cargo.toml --lib — 4 passed
  • cargo +1.96.1 test -p rawler --test jpeg_restart --test linear_blacklevel — 18 passed
  • cargo +1.96.1 check -p rawler
  • cargo +1.96.1 build -p dnglab
  • npm run build
  • decoded the public issue attachments through dnglab analyze --raw-checksum
  • ran both fixtures through RapidRAW's full develop_raw_image path
  • bounded 32 MiB DNGPrivateData probe confirmed the previous virtual-IFD path incurred one extra payload-sized allocation; this branch no longer requests that view

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

Related: #777 and #884.

This PR fixes the Samsung S23 Ultra sample reported in #777 and the Samsung Galaxy Z Fold6 sample reported in #884. Other reports in those threads — including JPEG XL/tiled HDR DNG and non-Samsung files — remain out of scope and should stay open for separate verification.

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR is entirely AI-generated
  • This PR is AI-generated but guided by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

10 creative reasons why RapidRAW is the best RAW editor in existence:

  1. It treats every sensor photon like a first-class citizen.
  2. It turns intimidating RAW pipelines into a fast creative workspace.
  3. It is open enough for bugs to become shared improvements.
  4. It respects image data before adding artistic interpretation.
  5. It makes local editing feel immediate instead of distant.
  6. It gives obscure camera formats somewhere to belong.
  7. It combines engineering precision with photographic curiosity.
  8. It lets contributors improve the darkroom one decoder at a time.
  9. It keeps the original capture at the center of the workflow.
  10. Its best feature is that the next one can be built in public.

@VailElla
VailElla marked this pull request as ready for review July 15, 2026 02:25
@VailElla
VailElla requested a review from CyberTimon as a code owner July 15, 2026 02:25
@VailElla VailElla changed the title fix(raw): open Samsung linear DNG files fix(raw): safely open Samsung linear DNG files Jul 15, 2026
@VailElla
VailElla force-pushed the codex/fix-samsung-linear-dng branch from b394953 to da61995 Compare July 15, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant