From a0711ebc8c528e2b79706f4421c6181f1c71cce8 Mon Sep 17 00:00:00 2001 From: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com> Date: Sun, 25 Jul 2021 16:03:13 -0700 Subject: [PATCH] Fix tmp image reuse when exporting different image If two images have identical processing parameters, then sending one to an external editor followed by sending the other one will cause the first temporary image to be reused. This commit associates the image in the editor with the "cached" temporary image so that the temporary image only gets used if the editor image matches. --- rtgui/editorpanel.cc | 3 ++- rtgui/editorpanel.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 5c61e672e..e52dab5db 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1980,11 +1980,12 @@ void EditorPanel::sendToExternal() pparams.icm.outputProfile = rtengine::procparams::ColorManagementParams::NoProfileString; } - if (!cached_exported_filename.empty() && pparams == cached_exported_pparams && Glib::file_test(cached_exported_filename, Glib::FILE_TEST_IS_REGULAR)) { + if (!cached_exported_filename.empty() && cached_exported_image == ipc->getInitialImage() && pparams == cached_exported_pparams && Glib::file_test(cached_exported_filename, Glib::FILE_TEST_IS_REGULAR)) { idle_sentToGimp(nullptr, nullptr, cached_exported_filename); return; } + cached_exported_image = ipc->getInitialImage(); cached_exported_pparams = pparams; cached_exported_filename.clear(); rtengine::ProcessingJob* job = rtengine::ProcessingJob::create (ipc->getInitialImage(), pparams); diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 1e6eaaa1f..1372a2171 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -243,6 +243,7 @@ private: Glib::RefPtr external_editor_info; std::unique_ptr app_chooser_dialog; + rtengine::InitialImage *cached_exported_image; rtengine::procparams::ProcParams cached_exported_pparams; Glib::ustring cached_exported_filename;