diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 8c19a8e9a..387d7892f 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -4748,21 +4748,22 @@ void RawImageSource::getRAWHistogram(LUTu & histRedRaw, LUTu & histGreenRaw, LUT } // 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]; } } 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; } diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index d970c78f3..fb1a7f670 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -789,8 +789,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));