Open sguyader opened 5 years ago
I'll take a look tonight..
5.4-861-g
e50b68208 works fine here @sguyader
Are you sure the "raw histogram" is not toggled? It happened once to me that I also thought the histogram was broken when I was viewing a non-raw file with the raw histogram enabled.
Ok, I just compiled 5.4-861-ge50b682
and at first it didn't change. I had to delete my options
file to get the histogram back for rasters. Sorry about that, I should have done that before reporting a bug.
I guess you can close the issue.
Edit: I feel so ashamed... In fact I had "raw histogram" enabled... That's why I saw no histogram for jpeg's... But then, maybe there should be a fallback to regular histogram when a raster image is loaded?
@Beep6581 @heckflosse Is there an easy way to check what the type of the loaded image is?
@Thanatomanic
When an image is loaded, a function named imageTypeChanged
is called. Maybe you can use it?
@sguyader There might have been some cross interference from this c365337
@Thanatomanic maybe, but I'm pretty sure it was just my dumbness forgetting to revert to RGB histogram after I had checked raw histogram for some raw files.
Can we close this issue?
Well, there is still an open issue... When raw mode is set, and a non-raw image is opened, there should be a fallback to the regular histogram. I just haven't gotten to making a fix for this.
So, I've tried to understand the mechanics of the listener and where to trigger the change. This seemed a reasonable place to start:
diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc
index 938048169..65de0fb0c 100644
--- a/rtengine/improccoordinator.cc
+++ b/rtengine/improccoordinator.cc
@@ -1917,6 +1917,11 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
hist_lrgb_dirty = vectorscope_hc_dirty = vectorscope_hs_dirty = waveform_dirty = true;
if (hListener) {
+
+ if (!imgsrc->isRAW() && options.histogramScopeType == Options::ScopeType::HISTOGRAM_RAW) {
+ options.histogramScopeType = Options::ScopeType::HISTOGRAM;
+ }
+
if (hListener->updateHistogram()) {
updateLRGBHistograms();
}
When you open a raw file, set the histogram to raw and then open a jpeg/tiff/png it does trigger the change in ScopeType
. Because if you close RT and reopen, the regular histogram is selected.
Where I fail to properly understand how to handle this situation, is how to trigger the GUI update. For example, by calling void EditorPanel::scopeTypeChanged(ScopeType new_type)
or void HistogramPanel::rgbv_toggled ()
.
Maybe @Lawrence37 can help out here?
@Thanatomanic
You'll want to update the buttons' states as well. I think the best way to handle this is to introduce a signal that the histogram panel listens to. When a new image is loaded, trigger this signal. In the histogram panel, call the set_active()
function for the regular histogram button. This should trigger the GUI update as well.
https://github.com/Beep6581/RawTherapee/blob/a749a1abb1bfb968429b2f0bcb4badb8515d34eb/rtgui/histogrampanel.h#L284
When an raster image (Jpeg, Tiif or PNG) is opened in RT, the histogram is totally flat, whatever the kind is toggled (log or linear). Bug present in current dev in Linux (but was present already in previous build from several days ago):