Skip to content

processing TIFF32 (exported from RAW) causes error #19131

@hqhoang

Description

@hqhoang

Is there an existing issue for this?

  • I checked and did not find my issue in the already reported ones

Describe the bug

I have a Python script that splits the XMP into 2 stages to inject nind-denoise in between, using TIFF32 as the intermediate files between darktable-cli and nind-denoise. A brief documentation of the script:

https://discuss.pixls.us/t/feedback-needed-integrating-nind-denoise-with-darktable/51393

The script has been working fine until I pull from master recently. The TIFF32 exported from RAW are still working fine. But importing the denoised TIFF32 back into darktable exports into garbled TIFF/JPG for some RAWs.

I narrowed the problem down to 2 commits:

2e06432: displays this error then stopped the export on TIFF32
[rawspeed] 2017-06-15_12-44-33_s1_denoised.tiff corrupt: rawspeed::RawImage rawspeed::RawDecoder::decodeRaw(), line 338: std::array<std::byte, rawspeed::BitStreamerTraits<Tag>::MaxProcessBytes> rawspeed::BitStreamerForwardSequentialReplenisher<Tag>::getInput() [with Tag = rawspeed::BitStreamerMSB], line 127: Buffer overflow read in BitStreamer

4ca5775: outputs garbled images from the TIFF32 files (exported from certain RAW files). Occasionally displays the above rawspeed error, doesn't seem to correlate to the garbled output. See attached screenshot.

From my limited samples, TIFF32 exported from CR2, CR3, NEF (D750), RAF are not effected. TIFF32 exported from NEF (D7200, D3500, Z50), ARW, NRW are affected.

A few RAWs that have problem:
https://discuss.pixls.us/t/would-love-to-see-how-you-handle-this-in-dt/50872
https://discuss.pixls.us/t/looking-for-feedback-please-try-editing-my-raw-file-in-darktable/51370
https://discuss.pixls.us/t/raw-editing-with-darktable-an-nikon-z50-ii/51441
https://discuss.pixls.us/t/robin-in-the-apple-blossom/51061

Here's TIFF32 output from nind-denoise. This TIFF32 can be imported into darktable and exported to JPG just fine before those 2 commits, but it's now displayed as garbled in darktable.

https://drive.google.com/file/d/1emk_NfyH0wZ-lXnknEHIMRUz_rzkZT8Z/view?usp=sharing
(RAW is from https://discuss.pixls.us/t/robin-in-the-apple-blossom/51061)

Steps to reproduce

  1. Import the attached denoised TIFF32 file into darktable

Expected behavior

it should display and export the TIFF32 file correctly

Logfile | Screenshot | Screencast

Image

Commit

4ca5775

Where did you obtain darktable from?

darktable.org / GitHub release

darktable version

master

What OS are you using?

Linux

What is the version of your OS?

Ubuntu 24.04

Describe your system

Legion Slim (AMD 7640HS, RTX3060, 32GB RAM)

Are you using OpenCL GPU in darktable?

Yes

If yes, what is the GPU card and driver?

nVidia 575

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions