Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iop/lens: pass right parameters to method commit_params #12796

Merged
merged 1 commit into from
Nov 6, 2022

Conversation

sgotti
Copy link
Contributor

@sgotti sgotti commented Nov 6, 2022

Params can be reset to defaults inside the main commit_params but on specific method commit_param[lf|md] call the source one were passed.

Should really fix #12758

@TurboGit TurboGit self-requested a review November 6, 2022 15:51
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

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

Please help me... The code I see seems to be fully equivalent... So it should change nothing, no?

Params can be reset to defaults inside the main commit_params but on
specific method _commit_param_[lf|md] call the source one were passed.
@sgotti
Copy link
Contributor Author

sgotti commented Nov 6, 2022

@TurboGit it's tricky and I missed it after looking at it many times...

in commit_params if p->modified == 0 the p pointer is set to self->default_params,

darktable/src/iop/lens.cc

Lines 1966 to 1973 in 64a61e5

if(p->modified == 0)
{
/*
* user did not modify anything in gui after autodetection - let's
* use current default_params as params - for presets and mass-export
*/
p = (dt_iop_lens_params_t *)self->default_params;
}

but before this PR the source p1 instead of p was passed to _commit_params_[lf|md].

@TurboGit
Copy link
Member

TurboGit commented Nov 6, 2022

@TurboGit it's tricky and I missed it after looking at it many times...

I see, p is set again to point to the default params. Indeed, not clear at first sight :) Thanks.

@TurboGit TurboGit added this to the 4.2 milestone Nov 6, 2022
@TurboGit TurboGit added the bugfix pull request fixing a bug label Nov 6, 2022
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

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

Thanks!

@TurboGit TurboGit merged commit a4f9518 into darktable-org:master Nov 6, 2022
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.

New lens correction not working when auto-applied
2 participants