Fix dt_camctl_camera_set_property_float brokenness - #22140
Merged
TurboGit merged 1 commit intoSep 4, 2026
Merged
Conversation
…ed copy and paste errors
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... |
TurboGit
approved these changes
Sep 4, 2026
TurboGit
left a comment
Member
There was a problem hiding this comment.
I would say no release notes needed for this, never complained and this is certainly not a widely used feature. Thanks!
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.
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:
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 fromjob->valuewill 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.