From 8cfc4e33af5b4720f50865a8270ecd904829a954 Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 26 Feb 2020 15:22:28 +0100 Subject: [PATCH 1/4] partial fixed wrong old WB auto --- rtengine/improccoordinator.cc | 9 +++------ rtengine/procparams.cc | 23 ++++++++++++++++++++--- rtgui/ppversion.h | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 0ed8b1f97..108dac114 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -37,6 +37,7 @@ #include "procparams.h" #include "refreshmap.h" #include "guidedfilter.h" +#include "../rtgui/version.h" #include "../rtgui/options.h" @@ -238,7 +239,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) // Check if any detail crops need high detail. If not, take a fast path short cut if (!highDetailNeeded) { for (size_t i = 0; i < crops.size(); i++) { - if (crops[i]->get_skip() == 1) { // skip=1 -> full resolution + if (crops[i]->get_skip() == 1) { // skip=1 -> full resolution highDetailNeeded = true; break; } @@ -255,10 +256,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) RAWParams rp = params->raw; ColorManagementParams cmp = params->icm; LCurveParams lcur = params->labCurve; - if (settings->verbose) { - printf("metwb2=%s \n", params->wb.method.c_str()); - } - + if (!highDetailNeeded) { // if below 100% magnification, take a fast path if (rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::NONE) && rp.bayersensor.method != RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::MONO)) { @@ -424,7 +422,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) if (settings->verbose) { printf("automethod=%s \n", params->wb.method.c_str()); } - if (todo & (M_INIT | M_LINDENOISE | M_HDR)) { MyMutex::MyLock initLock(minit); // Also used in crop window diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 7d83b50d2..fe3766287 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -1305,6 +1305,8 @@ bool WBParams::operator !=(const WBParams& other) const const std::vector& WBParams::getWbEntries() { + + static const std::vector wb_entries = { {"Camera", WBEntry::Type::CAMERA, M("TP_WBALANCE_CAMERA"), 0, 1.f, 1.f, 0.f}, // {"Auto", WBEntry::Type::AUTO, M("TP_WBALANCE_AUTO"), 0, 1.f, 1.f, 0.f}, @@ -1349,7 +1351,6 @@ const std::vector& WBParams::getWbEntries() // Should remain the last one {"Custom", WBEntry::Type::CUSTOM, M("TP_WBALANCE_CUSTOM"), 0, 1.f, 1.f, 0.f} }; - return wb_entries; } @@ -4164,10 +4165,26 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) assignFromKeyfile(keyFile, "Vibrance", "PastSatTog", pedited, vibrance.pastsattog, pedited->vibrance.pastsattog); assignFromKeyfile(keyFile, "Vibrance", "SkinTonesCurve", pedited, vibrance.skintonescurve, pedited->vibrance.skintonescurve); } - if (keyFile.has_group("White Balance")) { assignFromKeyfile(keyFile, "White Balance", "Enabled", pedited, wb.enabled, pedited->wb.enabled); - assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); + if (keyFile.has_key("White Balance", "Setting")) { +// if(ppVersion < 349) { + Glib::ustring prov = keyFile.get_string("White Balance", "Setting"); +// printf("Prov=%s\n", prov.c_str()); + if(prov == "Auto") { + printf("OK Auto\n"); + prov = "autold"; + wb.method = prov; + keyFile.set_string("White Balance", "Setting",wb.method ); + if (pedited) { + pedited->wb.method = true; + } + assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); + + } else { + assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); + } + } assignFromKeyfile(keyFile, "White Balance", "Temperature", pedited, wb.temperature, pedited->wb.temperature); assignFromKeyfile(keyFile, "White Balance", "Green", pedited, wb.green, pedited->wb.green); assignFromKeyfile(keyFile, "White Balance", "Equal", pedited, wb.equal, pedited->wb.equal); diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 89f93ed44..3a4019b36 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,7 +1,7 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 346 +#define PPVERSION 349 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /* From 4863c7a372ee8acb006d62addb28e902176c7e2f Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 26 Feb 2020 15:37:49 +0100 Subject: [PATCH 2/4] clean unused changes --- rtengine/improccoordinator.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 108dac114..1115fa4fc 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -37,7 +37,6 @@ #include "procparams.h" #include "refreshmap.h" #include "guidedfilter.h" -#include "../rtgui/version.h" #include "../rtgui/options.h" From 13e2bc41521f18c3bfbb425e431b7d855b18c4e8 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 26 Feb 2020 18:32:32 +0100 Subject: [PATCH 3/4] White balance shows wrong method when opening a file which was set to Auto in 5.8, #5668 --- rtengine/procparams.cc | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index fe3766287..88178d0e0 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -4167,23 +4167,9 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) } if (keyFile.has_group("White Balance")) { assignFromKeyfile(keyFile, "White Balance", "Enabled", pedited, wb.enabled, pedited->wb.enabled); - if (keyFile.has_key("White Balance", "Setting")) { -// if(ppVersion < 349) { - Glib::ustring prov = keyFile.get_string("White Balance", "Setting"); -// printf("Prov=%s\n", prov.c_str()); - if(prov == "Auto") { - printf("OK Auto\n"); - prov = "autold"; - wb.method = prov; - keyFile.set_string("White Balance", "Setting",wb.method ); - if (pedited) { - pedited->wb.method = true; - } - assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); - - } else { - assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); - } + assignFromKeyfile(keyFile, "White Balance", "Setting", pedited, wb.method, pedited->wb.method); + if (wb.method == "Auto") { + wb.method = "autold"; } assignFromKeyfile(keyFile, "White Balance", "Temperature", pedited, wb.temperature, pedited->wb.temperature); assignFromKeyfile(keyFile, "White Balance", "Green", pedited, wb.green, pedited->wb.green); From d7234c5aacbbf3e68665b0e5b3a51d1e1e5e204b Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 27 Feb 2020 08:08:33 +0100 Subject: [PATCH 4/4] reinitialize ppversion --- rtgui/ppversion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/ppversion.h b/rtgui/ppversion.h index 3a4019b36..89f93ed44 100644 --- a/rtgui/ppversion.h +++ b/rtgui/ppversion.h @@ -1,7 +1,7 @@ #pragma once // This number has to be incremented whenever the PP3 file format is modified or the behaviour of a tool changes -#define PPVERSION 349 +#define PPVERSION 346 #define PPVERSION_AEXP 301 //value of PPVERSION when auto exposure algorithm was modified /*