@@ -87,7 +87,7 @@ typedef struct dt_iop_exposure_gui_data_t
8787 GtkLabel * deflicker_used_EC ;
8888 GtkWidget * compensate_exposure_bias ;
8989 GtkWidget * compensate_hilite_preserv ;
90- volatile float effective_exposure ; // Caches the final computed exposure
90+ volatile float effective_exposure ; // used to cache the final computed exposure
9191 float deflicker_computed_exposure ;
9292
9393 GtkWidget * spot_mode ;
@@ -628,7 +628,6 @@ void commit_params(dt_iop_module_t *self,
628628
629629 d -> deflicker = 0 ;
630630
631- // Cache the final effective exposure value for proxy access.
632631 if (self -> gui_data )
633632 {
634633 ((dt_iop_exposure_gui_data_t * )self -> gui_data )-> effective_exposure = d -> params .exposure ;
@@ -823,14 +822,8 @@ static float _exposure_proxy_get_black(dt_iop_module_t *self)
823822static float _exposure_proxy_get_effective_exposure (dt_iop_module_t * self )
824823{
825824 dt_iop_exposure_gui_data_t * g = self -> gui_data ;
826- if (g )
827- {
828- return g -> effective_exposure ;
829- }
830- // Fallback for headless mode: recalculate. This won't be perfect if deflicker is on,
831- // but it's the best we can do without a GUI struct.
832- const dt_iop_exposure_params_t * p = self -> params ;
833- return p -> exposure - (p -> compensate_exposure_bias ? _get_exposure_bias (self ) : 0.0f ) + (p -> compensate_hilite_pres ? _get_highlight_bias (self ) : 0.0f );
825+ // should not be invoked when not in GUI mode
826+ return g ? g -> effective_exposure : 0.f ;
834827}
835828
836829static void _exposure_proxy_handle_event (gpointer controller ,
0 commit comments