From 72ec02a98db6680d3f9f5b1a5b702bbecacaed2e Mon Sep 17 00:00:00 2001 From: Oleg Koncevoy Date: Wed, 3 Jan 2018 17:12:36 +0200 Subject: [PATCH 1/3] Added restart required label to Preferences, Color management page. Now it is explicitly stated, that it will be possible to select monitor profile only after restarting rawtherapee. Fixes #4198 modified: rtgui/preferences.cc --- rtgui/preferences.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b53e884f5..8e110e419 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -741,8 +741,12 @@ Gtk::Widget* Preferences::getColorManagementPanel () setExpandAlignProperties (iccdgrid, true, false, Gtk::ALIGN_FILL, Gtk::ALIGN_FILL); iccdgrid->set_column_spacing (4); + Gtk::Label* monProfileRestartNeeded = Gtk::manage ( new Gtk::Label (Glib::ustring (" (") + M ("PREFERENCES_APPLNEXTSTARTUP") + ")") ); + setExpandAlignProperties(monProfileRestartNeeded, false, false, Gtk::ALIGN_START, Gtk::ALIGN_BASELINE); + iccdgrid->attach (*pdlabel, 0, 0, 1, 1); iccdgrid->attach (*iccDir, 1, 0, 1, 1); + iccdgrid->attach (*monProfileRestartNeeded, 2, 0, 1, 1); iccDir->signal_selection_changed ().connect (sigc::mem_fun (this, &Preferences::iccDirChanged)); From 8ee87011416526f311c67e1c2f16acba44537339 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 18 Jan 2018 19:49:05 +0100 Subject: [PATCH 2/3] Detail windows broken at higher zoom levels, #4224 --- rtgui/crophandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/crophandler.cc b/rtgui/crophandler.cc index f6ff83a7d..0abff627b 100644 --- a/rtgui/crophandler.cc +++ b/rtgui/crophandler.cc @@ -426,11 +426,11 @@ bool CropHandler::getWindow (int& cwx, int& cwy, int& cww, int& cwh, int& cskip) cwh = cropH; // hack: if called before first size allocation the size will be 0 - if (cww < 10) { + if (cww == 0) { cww = 10; } - if (cwh < 32) { + if (cwh == 0) { cwh = 32; } From 8622efce00f6f0be7ba77e0ab605a54f3f03f75d Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 18 Jan 2018 19:53:18 +0100 Subject: [PATCH 3/3] Crash opening dng file from hdrmerge, fixes #4313 --- rtengine/rawimagesource.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index a8d94b638..4c777a30e 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -4737,21 +4737,22 @@ void RawImageSource::getRAWHistogram (LUTu & histRedRaw, LUTu & histGreenRaw, LU } // end of critical region } // end of parallel region + constexpr float gammaLimit = 32767.f * 65536.f; // Color::gamma overflows when the LUT is accessed with too large values for(int i = 0; i < 65536; i++) { int idx; - idx = CLIP((int)Color::gamma(mult[0] * (i - (cblacksom[0]/*+black_lev[0]*/)))); + idx = CLIP((int)Color::gamma(std::min(mult[0] * (i - (cblacksom[0]/*+black_lev[0]*/)), gammaLimit))); histRedRaw[idx >> 8] += hist[0][i]; if (ri->get_colors() > 1) { - idx = CLIP((int)Color::gamma(mult[1] * (i - (cblacksom[1]/*+black_lev[1]*/)))); + idx = CLIP((int)Color::gamma(std::min(mult[1] * (i - (cblacksom[1]/*+black_lev[1]*/)), gammaLimit))); histGreenRaw[idx >> 8] += hist[1][i]; if (fourColours) { - idx = CLIP((int)Color::gamma(mult[3] * (i - (cblacksom[3]/*+black_lev[3]*/)))); + idx = CLIP((int)Color::gamma(std::min(mult[3] * (i - (cblacksom[3]/*+black_lev[3]*/)), gammaLimit))); histGreenRaw[idx >> 8] += hist[3][i]; } - idx = CLIP((int)Color::gamma(mult[2] * (i - (cblacksom[2]/*+black_lev[2]*/)))); + idx = CLIP((int)Color::gamma(std::min(mult[2] * (i - (cblacksom[2]/*+black_lev[2]*/)), gammaLimit))); histBlueRaw[idx >> 8] += hist[2][i]; } }