diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index ccfd16187..bd9fa4b47 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -1136,7 +1136,7 @@ void CLASS lossless_dng_load_raw() fseek (ifp, get4(), SEEK_SET); if (!ljpeg_start (&jh, 0)) break; jwide = jh.wide; - if (filters) jwide *= jh.clrs; + if (filters || (colors == 1 && jh.clrs > 1)) jwide *= jh.clrs; jwide /= MIN (is_raw, tiff_samples); switch (jh.algo) { case 0xc1: diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index 945eaf29f..7d9d080e2 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -5466,7 +5466,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double //now tune hlcompr to bring back rawmax to 65535 - hlcomprthresh = 33; + hlcomprthresh = 0; //this is a series approximation of the actual formula for comp, //which is a transcendental equation float comp = (gain * ((float)whiteclip) / scale - 1.f) * 2.3f; // 2.3 instead of 2 to increase slightly comp diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index af89f99a1..aebc8c047 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -330,7 +330,7 @@ ToneCurveParams::ToneCurveParams() : saturation(0), shcompr(50), hlcompr(0), - hlcomprthresh(33), + hlcomprthresh(0), histmatching(false), fromHistMatching(false), clampOOG(true) diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index 447c9d8af..1e4f4eac8 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -991,8 +991,11 @@ void MyScrolledWindow::get_preferred_height_for_width_vfunc (int width, int &min MyScrolledToolbar::MyScrolledToolbar () { set_policy (Gtk::POLICY_EXTERNAL, Gtk::POLICY_NEVER); - set_propagate_natural_height(true); get_style_context()->add_class("scrollableToolbar"); + + // Works fine with Gtk 3.22, but a a custom made get_preferred_height had to be created as a workaround + // taken from the official Gtk3.22 source code + //set_propagate_natural_height(true); } bool MyScrolledToolbar::on_scroll_event (GdkEventScroll* event) @@ -1032,6 +1035,23 @@ bool MyScrolledToolbar::on_scroll_event (GdkEventScroll* event) return true; } +void MyScrolledToolbar::get_preferred_height (int &minimumHeight, int &naturalHeight) +{ + int currMinHeight = 0; + int currNatHeight = 0; + std::vector childs = get_children(); + minimumHeight = naturalHeight = 0; + + for (auto child : childs) + { + if(child->is_visible()) { + child->get_preferred_height(currMinHeight, currNatHeight); + minimumHeight = rtengine::max(currMinHeight, minimumHeight); + naturalHeight = rtengine::max(currNatHeight, naturalHeight); + } + } +} + MyComboBoxText::MyComboBoxText (bool has_entry) : Gtk::ComboBoxText(has_entry) { minimumWidth = naturalWidth = 70; diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index 89d05bfce..fb627a78a 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -300,6 +300,7 @@ class MyScrolledToolbar : public Gtk::ScrolledWindow { bool on_scroll_event (GdkEventScroll* event); + void get_preferred_height (int &minimumHeight, int &naturalHeight); public: MyScrolledToolbar(); diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc index 2a6d5cad1..755cb9239 100644 --- a/rtgui/saveformatpanel.cc +++ b/rtgui/saveformatpanel.cc @@ -182,7 +182,7 @@ void SaveFormatPanel::formatChanged () int act = format->get_active_row_number(); - if (act < 0 || act > 5) { + if (act < 0 || act > 6) { return; } diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index 30c9dadee..5205d6f18 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -111,7 +111,7 @@ ToneCurve::ToneCurve () : FoldableToolPanel(this, "tonecurve", M("TP_EXPOSURE_LA //----------- Highlight recovery & threshold ------------- hlcompr = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTS"), 0, 500, 1, 0)); pack_start (*hlcompr); - hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 33)); + hlcomprthresh = Gtk::manage (new Adjuster (M("TP_EXPOSURE_COMPRHIGHLIGHTSTHRESHOLD"), 0, 100, 1, 0)); pack_start (*hlcomprthresh); //----------- Black Level & Compression ------------------- @@ -229,9 +229,13 @@ void ToneCurve::read (const ProcParams* pp, const ParamsEdited* pedited) hlcomprthresh->setValue (pp->toneCurve.hlcomprthresh); shcompr->setValue (pp->toneCurve.shcompr); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } brightness->setValue (pp->toneCurve.brightness); contrast->setValue (pp->toneCurve.contrast); @@ -611,7 +615,7 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) } else if (a == black) { listener->panelChanged (EvBlack, costr); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } } else if (a == contrast) { @@ -620,6 +624,10 @@ void ToneCurve::adjusterChanged (Adjuster* a, double newval) listener->panelChanged (EvSaturation, costr); } else if (a == hlcompr) { listener->panelChanged (EvHLCompr, costr); + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } } else if (a == hlcomprthresh) { listener->panelChanged (EvHLComprThreshold, costr); } else if (a == shcompr) { @@ -660,9 +668,13 @@ void ToneCurve::neutral_pressed () hlrbox->hide(); } - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } contrast->setValue(0); //saturation->setValue(0); @@ -733,6 +745,11 @@ void ToneCurve::autolevels_toggled () if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } + } else { listener->panelChanged (EvFixedExp, M("GENERAL_DISABLED")); } @@ -847,9 +864,13 @@ bool ToneCurve::autoExpComputed_ () hlrbox->hide(); } - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue () == 0)); //at black=0 shcompr value has no effect } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } enableListener (); @@ -971,9 +992,13 @@ bool ToneCurve::histmatchingComputed() contrast->setValue(0); black->setValue(0); - if (!black->getAddMode()) { + if (!black->getAddMode() && !batchMode) { shcompr->set_sensitive(!((int)black->getValue() == 0)); } + + if (!hlcompr->getAddMode() && !batchMode) { + hlcomprthresh->set_sensitive(!((int)hlcompr->getValue () == 0)); //at hlcompr=0 hlcomprthresh value has no effect + } if (autolevels->get_active() ) { expcomp->setValue(0);