From d1bfbc7967ed9c7aac61dd40ce6209c012cba95c Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sun, 14 May 2017 12:36:19 +0200 Subject: [PATCH] Override system camcons.json raw_crop with one from users camconst.json, fixes #3873 --- rtengine/camconst.cc | 13 +++++++++++++ rtengine/camconst.h | 1 + 2 files changed, 14 insertions(+) diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index 5a155e051..2449a1cd1 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -418,6 +418,18 @@ CameraConst::update_Levels(const CameraConst *other) // } } +void +CameraConst::update_Crop(CameraConst *other) +{ + if (!other) { + return; + } + + if (other->has_rawCrop()) { + other->get_rawCrop(raw_crop[0], raw_crop[1], raw_crop[2], raw_crop[3]); + } +} + bool CameraConst::get_Levels(struct camera_const_levels & lvl, int bw, int iso, float fnumber) { @@ -668,6 +680,7 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_) existingcc->update_dcrawMatrix(cc->get_dcrawMatrix()); // deleting all the existing levels, replaced by the new ones existingcc->update_Levels(cc); + existingcc->update_Crop(cc); if (settings->verbose) { printf("Merging camera constants for \"%s\"\n", make_model.c_str()); diff --git a/rtengine/camconst.h b/rtengine/camconst.h index b57c3fee9..713936bf8 100644 --- a/rtengine/camconst.h +++ b/rtengine/camconst.h @@ -43,6 +43,7 @@ public: int get_BlackLevel(int idx, int iso_speed); int get_WhiteLevel(int idx, int iso_speed, float fnumber); void update_Levels(const CameraConst *other); + void update_Crop(CameraConst *other); }; class CameraConstantsStore