darktable-org / darktable-org/darktable

_dev_exposure_proxy_available finds wrong exposure instance?

Open
#19,560 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

no-issue-activity
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Is there an existing issue for this?
  • I checked and did not find my issue in the already reported ones
Describe the bug

This is used by color calibration. However, it does not find the 'main' (first) exposure instance, but rather the last instance, even if it is disabled.

Calibrating from a Color Checker chart, with an instance of exposure enabled:
Image

Same, but with an instance of exposure added (above the previous one), and then disabled:
Image

Maybe modify exposure reading functions like this? In order to avoid repetition, this could be refactored to find the first instance in a separate function, and functions using it could just check if the instance was found, and if yes, call dev->proxy.whatever_function(module).

  if (dt_view_get_current() != DT_VIEW_DARKROOM) return 0.0f;

  // The proxy function pointers are only set if an exposure module has been initialized.
  if (!dev->proxy.exposure.whatever_function) return 0.0f;

  for (GList *l = dev->iop; l; l = g_list_next(l))
  {
    dt_iop_module_t *module = (dt_iop_module_t *)l->data;

    if (module->enabled && dt_iop_module_is(module->so, "exposure"))
    {
      return dev->proxy.whatever_function(module);
    }
  }
Steps to reproduce

See above

Expected behavior

darktable should use the 1st enabled instance (probably)

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

darktable.org / GitHub release

darktable version

684779a88d529 (current master)

What OS are you using?

Linux

What is the version of your OS?

OS-independent

Describe your system

No response

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

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

No response

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 by locating _dev_exposure_proxy_available and the exposure reading functions that use it, then reproduce the Color Checker calibration case with multiple exposure instances, including a disabled one. Trace how the exposure instances are selected and verify that darktable uses the first enabled instance consistently; the issue is done when the reported calibration behavior matches that expectation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.