darktable-org / darktable-org/darktable

Add support for Dual Pixel Raw dng files

Open
#4,006 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty: hard feature: new scope: camera support understood: clear
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Describe the bug
A DNG file converted frrom a CR3 file via Adobe DNG Converteer, Dual Pixel Raw) is not being opened in darktable. Rawspeed issue 214 indicates that this is possibly an error from darktable. Thumbnail of the Dng file is not being generated. While opening the file darktable is running into a deadlock.

Error:
void rawspeed::AbstractDngDecompressor::decompress() const, line 208: Too many errors encountered. Giving up. First Error:
rawspeed::LJpegDecompressor::LJpegDecompressor(const rawspeed::ByteStream&, const rawspeed::RawImage&), line 42: Unexpected component count (2)
allocation failed???

Issue 214 rawspeed:
While it is easy to convince rawspeed to load it
diff --git a/src/librawspeed/decompressors/LJpegDecompressor.cpp b/src/librawspeed/decompressors/LJpegDecompressor.cpp
index f5d6d86c..64b2fb2b 100644
--- a/src/librawspeed/decompressors/LJpegDecompressor.cpp
+++ b/src/librawspeed/decompressors/LJpegDecompressor.cpp
@@ -39,6 +39,7 @@ LJpegDecompressor::LJpegDecompressor(const ByteStream& bs, const RawImage& img)
ThrowRDE("Unexpected data type (%u)", mRaw->getDataType());

if (!((mRaw->getCpp() == 1 && mRaw->getBpp() == 2) ||

  •    (mRaw->getCpp() == 2 && mRaw->getBpp() == 4) ||
       (mRaw->getCpp() == 3 && mRaw->getBpp() == 6)))
    
    ThrowRDE("Unexpected component count (%u)", mRaw->getCpp());

Expected behavior
Darktable will show thumbnail in lighttable. Darktable will open DNG file

Screenshots

Platform (please complete the following information):

  • Darktable Version: 3.1.0
  • OS: Ubuntu 19.10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Dual Pixel Raw DNG and the rawspeed error, then inspect src/librawspeed/decompressors/LJpegDecompressor.cpp and rawspeed issue 214. Reproduce thumbnail generation and opening in darktable, and confirm completion when the DNG opens without a deadlock and its lighttable thumbnail is generated.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.