Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.81k stars 318 forks source link

Adjustments in Batch Edit sometimes clear the HaldCLUT combo box #4720

Closed sguyader closed 6 years ago

sguyader commented 6 years ago

I've encountered this issue recently, and it happened again today with a fresh RT build (Version: 5.4-650-gc9e6a18fb, on Linux Manjaro): on a selection of files with a HaldCLUT set, if I switch to the Batch Edit vertical tab and modify some setting (for example, changing the Sharpening method), the HaldCLUT combo gets cleared (no HaldCLUT is selected anymore). It doesn't happen everytime, but it has happened several times for me.

sguyader commented 6 years ago

It just happened once more. This time, I was changing the bounding box size of in the Resize filter for a batch of 64 files.

sguyader commented 6 years ago

The bug happened again today on a different set of images. When I checked the pp3 files after the bug, the ClutFilename= field was emptied. It's not consistently reproducible, meaning that sometimes I can edit in Batch Edit without triggering the bug. It happened this morning soon after starting the session from yesterday. In the meantime, I had cleared the cache and processing profiles from Preferences. It's quite annoying, as I don't always use the same Clut files in a session, it depends on the images, and it's not easy to remember which Clut I chose for each image.

PS: in the console window, I don't see any particular message when the bug is triggered

heckflosse commented 6 years ago

I can confirm the issue. Trying to find a way to reproduce now...

heckflosse commented 6 years ago

To reproduce:

Create a folder. Copy two images into that folder. Assign a Black & White Clut and enable Clut for one of the images. Close RT Start RT Select both images and enable Sharpening in Batch mode => Both Images are displayed in colours, while the one with the Black & White Clut should stay Black & White

sguyader commented 6 years ago

Glad you were able to reproduce. In my case it happened with all images in the folder set to a Clut, sometimes all used the same Clut, sometimes different Cluts according to the image.

sguyader commented 6 years ago

I don't know if it's related, but I see another strange behaviour in Batch Edit regarding the HaldCLUT combo box. If I have an image with a set HaldCLUT and another image with no set HaldCLUT, when in the file browser I click on the first thumbnail, I see the correct HaldCLUT name appearing in the Batch Edit tab, but when I click on the second thumbnail, it shows the name of the HaldCLUT of the previous image's HaldCLUT whereas it should not show anything in the combo box.

sguyader commented 6 years ago

I opened a folder today and realized I had again lost all my preset HaldCLUTs... I don't know if it's also related to the way HaldCLUTs are managed in the history, but today I worked on some images, setting a new custom HaldCLUT I had just made. When I switched to the folder with lost HaldCLUTs, I saw that the name of my previous HaldCLUT was still appearing in the combobox while it was not actually used.

heckflosse commented 6 years ago

@sguyader This patch fixes it:

diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc
index ba8f6740b..1c84bf324 100644
--- a/rtgui/filmsimulation.cc
+++ b/rtgui/filmsimulation.cc
@@ -249,7 +249,7 @@ void ClutComboBox::setBatchMode(bool yes)
     if (batchMode != yes) {
         batchMode = yes;
         set_model(m_model());
-        if (batchMode && options.multiDisplayMode) {
+        if (batchMode) {
             updateUnchangedEntry();
         }
     }
heckflosse commented 6 years ago

Enhanced patch:

diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc
index ba8f6740b..73e35b2f8 100644
--- a/rtgui/filmsimulation.cc
+++ b/rtgui/filmsimulation.cc
@@ -135,6 +135,8 @@ void FilmSimulation::read( const rtengine::procparams::ProcParams* pp, const Par
                 : pp->filmSimulation.clutFilename
         );
         m_oldClutFilename = m_clutComboBox->getSelectedClut();
+    } else {
+        m_clutComboBox->set_active(-1);
     }

     m_strength->setValue(pp->filmSimulation.strength);
@@ -249,7 +251,7 @@ void ClutComboBox::setBatchMode(bool yes)
     if (batchMode != yes) {
         batchMode = yes;
         set_model(m_model());
-        if (batchMode && options.multiDisplayMode) {
+        if (batchMode) {
             updateUnchangedEntry();
         }
     }
@@ -270,7 +272,6 @@ void ClutComboBox::updateUnchangedEntry()
         if (c.size() > 0) {
             Gtk::TreeModel::Row row = c[c.size()-1];
             if (row[m_columns().clutFilename] == "NULL") {
-                std::cout << "  removing " << ((void *)this) << std::endl;
                 m_model()->erase(row);
             }
         }

also fixes the following case (SETM):

1) on File 1 apply a b&w (for easier visibility) clut and enable film simulation 2) on File 2 don't apply a clut but enable filmsimulation 3) open File 1 4) open File 2, enable or disable sharpening => File 2 is still not monochrome 5) open File 1 6) open File 2 => monochrome because b&w clut from File 1 is applied => bug

sguyader commented 6 years ago

@heckflosse Thank you Ingo, I didn't have time to try your patch, but I'm sure the commit is fine.

sguyader commented 6 years ago

@heckflosse Unfortunately the patch doesn't seem to be the cure. The bug just happened a moment ago while working on set of images with a HaldCLUT applied to some of them, and was triggered while trying to turn off Highlight reconstruction in batch mode. It was with RT version 5.4-873-gbf13654a6 (one commit after the one supposed to fix this bug)

heckflosse commented 6 years ago

@sguyader Damn. I hoped my changes fixed it completely. At least it should be fixed partially. Do you have some more details to reprocuce?

heckflosse commented 6 years ago

@sguyader Please give as much informations as possible. For example, are you using SETM, METM or MEOW mode?

sguyader commented 6 years ago

I'm using METM mode, as often I need to have 2 files open at the same time so I can switch between them for comparison. I was working from a folder containing 127 Fuji X-T2 raw files. I think I had already done some changes in batch mode in the same session before the bug was triggered. Unfortunately there's no particular message in the console when it happens. I have no other details.

heckflosse commented 6 years ago

@sguyader ok. I will take a look again

heckflosse commented 6 years ago

@sguyader I tried a lot, but I'm not able to reproduce the issue. Without being able to reproduce there's nothing I can do :(

sguyader commented 6 years ago

@heckflosse I know Ingo, today I worked on the same images, played (with a bit of fear) in the batch mode but nothing bad happened this time. However, I switched to MEOW mode to experiment in this mode. I'll let you know if it happens again.