Repository navigation
rawprepare: fall back to full range when white point is not above black - #22890
Merged
TurboGit merged 2 commits intoNov 2, 2026
Merged
Conversation
Collaborator
|
Please have a look at the dev-doc about thread sharing gui data :-) You also will find examples in other modules ... |
jenshannoschwalm
approved these changes
Nov 2, 2026
Collaborator
|
Squash both commits and then it's good. |
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.
If a raw reader reports a white point at or below the black level,
commit_params()in rawprepare computesdiv = white - black <= 0. The image then renders black or inverted, and nothing tells you why. This happened with LibRaw on the Canon EOS R50 V (white 90 or 148, black 2047; upstream fix in LibRaw/LibRaw#875).As suggested in #22597, this adds a cheap check in rawprepare's
commit_params():raw_white_point <= max(raw_black_level_separate[]), the module usesUINT16_MAXfor the scaling and for the white point it passes downstream, so the image is dark but not inverted_image_set_rawcrops()so it can't wipe the existing crop-parameter messageThis doesn't touch camera support. The R50 V modelMap entry from the issue is left out on purpose, per the discussion there.
Tested on macOS (Apple Silicon, Homebrew, no OpenMP):
-Werror(rawprepare.c clean); ctest 40/40 passdarktable-clionmire1.cr2with the rawprepare white point set to 100 (black 1030): before, the image is essentially black (mean 0.0003) with no message. After, it renders darker but not inverted (mean 0.18 against 0.41 normally) and logsTrouble: [raw black/white point] 'white point not above black level, using maximum'AI disclosure: the change was drafted with AI assistance (Claude Code + an OpenCode model) and reviewed by me.
Related: #22597