From d3ad55637facf68ddb51508c80a30bbbce6a9e3d Mon Sep 17 00:00:00 2001 From: eliets2 <287273517+eliets2@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:05:37 +0300 Subject: [PATCH] Reset the profile section to the default profile A photo that was given a creative or film profile cannot get back to its neutral look through the Profile section's reset, which is what the report describes as edits that refuse to go back to zero. Make reset_section restore the whole profile (id and amount) when the Profile section is reset, so the section really returns to its default state. Test: resetting_the_profile_section_restores_the_default_profile failed before the change and passes after. --- crates/develop/src/lib.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/develop/src/lib.rs b/crates/develop/src/lib.rs index 4631e5e49..f27aa9c23 100644 --- a/crates/develop/src/lib.rs +++ b/crates/develop/src/lib.rs @@ -145,7 +145,8 @@ impl DevelopSettings { } } - /// Reset every control in `section` to its default. + /// Reset every control in `section` to its default, and the settings of the section that are not + /// controls (the creative profile, the curve, the white balance mode). pub fn reset_section(&mut self, section: Section) { for c in controls::in_section(section) { controls::set(self, c.id, c.default); @@ -157,6 +158,8 @@ impl DevelopSettings { } Section::Color => self.wb.mode = WbMode::AsShot, Section::Detail => self.enhance.denoise_on = None, + // the creative profile is not a control: the chosen look goes back to the default one + Section::Profile => self.profile.id = Profile::default().id, _ => {} } } @@ -316,6 +319,17 @@ mod tests { assert!(s.is_unedited()); } + #[test] + fn resetting_the_profile_section_restores_the_default_profile() { + // the chosen creative profile is not a control, so resetting the section must restore it too + let mut s = DevelopSettings::default(); + s.profile.id = "lc.muted.matte-soft".into(); + s.profile.amount = 40.0; + s.reset_section(Section::Profile); + assert_eq!(s.profile.id, "lc.color", "the creative profile survives a Profile reset"); + assert_eq!(s.profile.amount, 100.0); + } + #[test] fn section_toggles() { let mut s = DevelopSettings::default();