Skip to content

Fix dt_camctl_camera_set_property_float brokenness - #22140

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
victoryforce:dt_camctl_camera_set_property_float
Sep 4, 2026
Merged

Fix dt_camctl_camera_set_property_float brokenness#22140
TurboGit merged 1 commit into
darktable-org:masterfrom
victoryforce:dt_camctl_camera_set_property_float

Conversation

@victoryforce

Copy link
Copy Markdown
Collaborator

The issue was caused by undetected copy-paste errors. dt_camctl_camera_set_property_float() looks like copy of the _int variant, in which not all the necessary changes have been made. Allocation was used size of wrong struct, fortunately their sizes was the same (as int and float both is 4 bytes on most modern architectures).

The direct cause of the buggy behavior is the following assignment:

job->type = _JOB_TYPE_SET_PROPERTY_INT;

This type is used to select an option in the switch in the _camera_process_job() function. Because of this erroneous type, an execution path for an integer type will be chosen there, in which case the value from job->value will eventually be assigned to the int variable.

As a result, the fractional part will be discarded (not mathematical rounded, BTW), and the number will be stored as an integer. This means that the fractional properties of the camera will be significantly distorted.

@victoryforce

Copy link
Copy Markdown
Collaborator Author

@TurboGit - As for the release notes, I don't use camera tethering myself. Also, I'm currently working on Windows, where I don't want to bother with tethering support tricks. So I can't see how exactly this bug manifests itself in the UI yet (I didn't encounter it while working with darktable, I found it while reading the code). If someone checks and reports it, I could add this wording to the release notes...

@ralfbrown ralfbrown added the bugfix pull request fixing a bug label Sep 4, 2026
@TurboGit TurboGit added this to the 5.8 milestone Sep 4, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say no release notes needed for this, never complained and this is certainly not a widely used feature. Thanks!

@TurboGit
TurboGit merged commit 1a9ab7d into darktable-org:master Sep 4, 2026
6 checks passed
@victoryforce
victoryforce deleted the dt_camctl_camera_set_property_float branch September 4, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants