From 3e4b8152c3250c2ce59d7bef28157b8a3647d072 Mon Sep 17 00:00:00 2001 From: Ingo Date: Sat, 28 Mar 2015 13:12:42 +0100 Subject: [PATCH] Serialze read of tiff files, Issue 2722 --- rtdata/languages/default | 3 +++ rtengine/imageio.cc | 7 ++++++- rtgui/options.cc | 3 +++ rtgui/options.h | 3 ++- rtgui/preferences.cc | 14 ++++++++++++-- rtgui/preferences.h | 3 ++- 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index aefd1be2c..ff2837c3e 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -918,6 +918,9 @@ PREFERENCES_RGBDTL_TOOLTIP;Leave the setting at "0" to automatically use as many PREFERENCES_SELECTFONT;Select font PREFERENCES_SELECTLANG;Select language PREFERENCES_SELECTTHEME;Select theme +PREFERENCES_SERIALIZE_TIFF_READ;Tiff Read Settings +PREFERENCES_SERIALIZE_TIFF_READ_LABEL;Serialize read of tiff files +PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP;When working with folders full of uncompressed tiff files enabling this option can increase performance of thumb generation. PREFERENCES_SET;Set PREFERENCES_SHOWBASICEXIF;Show basic Exif info PREFERENCES_SHOWDATETIME;Show date and time diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index a27e69d99..8662d9093 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -570,7 +570,12 @@ int ImageIO::getTIFFSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, } int ImageIO::loadTIFF (Glib::ustring fname) { - + + static MyMutex thumbMutex; + MyMutex::MyLock lock(thumbMutex); + if(!options.serializeTiffRead) + lock.release(); + #ifdef WIN32 wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (fname.c_str(), -1, NULL, NULL, NULL); TIFF* in = TIFFOpenW (wfilename, "r"); diff --git a/rtgui/options.cc b/rtgui/options.cc index 5d4bf1920..375a282d6 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -373,6 +373,7 @@ void Options::setDefaults () { #endif filledProfile = false; maxInspectorBuffers = 2; // a rather conservative value for low specced systems... + serializeTiffRead = true; showProfileSelector = true; FileBrowserToolbarSingleRow = false; @@ -779,6 +780,7 @@ if (keyFile.has_group ("Performance")) { if (keyFile.has_key ("Performance", "MaxInspectorBuffers")) maxInspectorBuffers = keyFile.get_integer ("Performance", "MaxInspectorBuffers"); if (keyFile.has_key ("Performance", "PreviewDemosaicFromSidecar")) prevdemo = (prevdemo_t)keyFile.get_integer ("Performance", "PreviewDemosaicFromSidecar"); if (keyFile.has_key ("Performance", "Daubechies")) rtSettings.daubech = keyFile.get_boolean ("Performance", "Daubechies"); + if (keyFile.has_key ("Performance", "SerializeTiffRead")) serializeTiffRead = keyFile.get_boolean ("Performance", "SerializeTiffRead"); } if (keyFile.has_group ("GUI")) { @@ -1067,6 +1069,7 @@ int Options::saveToFile (Glib::ustring fname) { keyFile.set_integer ("Performance", "MaxInspectorBuffers", maxInspectorBuffers); keyFile.set_integer ("Performance", "PreviewDemosaicFromSidecar", prevdemo); keyFile.set_boolean ("Performance", "Daubechies", rtSettings.daubech); + keyFile.set_boolean ("Performance", "SerializeTiffRead", serializeTiffRead); keyFile.set_string ("Output", "Format", saveFormat.format); keyFile.set_integer ("Output", "JpegQuality", saveFormat.jpegQuality); diff --git a/rtgui/options.h b/rtgui/options.h index af9c4ea44..e49057f89 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -225,7 +225,8 @@ class Options { int maxInspectorBuffers; // maximum number of buffers (i.e. images) for the Inspector feature int clutCacheSize; bool filledProfile; // Used as reminder for the ProfilePanel "mode" - prevdemo_t prevdemo; // Demosaicing method used for the <100% preview + prevdemo_t prevdemo; // Demosaicing method used for the <100% preview + bool serializeTiffRead; bool menuGroupRank; bool menuGroupLabel; diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 8f2d85aaa..4a55c3759 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -529,6 +529,15 @@ Gtk::Widget* Preferences::getPerformancePanel () { fprevdemo->add (*hbprevdemo); hbprevdemo->set_border_width(4); mainContainer->pack_start (*fprevdemo, Gtk::PACK_SHRINK, 4); + + Gtk::Frame* ftiffserialize = Gtk::manage (new Gtk::Frame (M("PREFERENCES_SERIALIZE_TIFF_READ"))); + Gtk::HBox* htiffserialize = Gtk::manage (new Gtk::HBox (false, 4)); + ctiffserialize = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_SERIALIZE_TIFF_READ_LABEL")) ); + ctiffserialize->set_tooltip_text(M("PREFERENCES_SERIALIZE_TIFF_READ_TOOLTIP")); + htiffserialize->pack_start (*ctiffserialize); + ftiffserialize->add (*htiffserialize); + htiffserialize->set_border_width(4); + mainContainer->pack_start (*ftiffserialize, Gtk::PACK_SHRINK, 4); Gtk::Frame* fclut = Gtk::manage( new Gtk::Frame (M("PREFERENCES_CLUTSCACHE")) ); Gtk::HBox* clutCacheSizeHB = Gtk::manage( new Gtk::HBox () ); @@ -1373,7 +1382,7 @@ void Preferences::storePreferences () { moptions.rtSettings.daubech = cbdaubech->get_active (); moptions.prevdemo = (prevdemo_t)cprevdemo->get_active_row_number (); - + moptions.serializeTiffRead = ctiffserialize->get_active(); if (sdcurrent->get_active ()) moptions.startupDir = STARTUPDIR_CURRENT; else if (sdhome->get_active ()) @@ -1460,7 +1469,8 @@ void Preferences::fillPreferences () { forImageComboChanged(); // update the tooltip dateformat->set_text (moptions.dateFormat); panFactor->set_value (moptions.panAccelFactor); - rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan); + rememberZoomPanCheckbutton->set_active (moptions.rememberZoomAndPan); + ctiffserialize->set_active(moptions.serializeTiffRead); #if !defined(__APPLE__) // monitor profile not supported on apple if (safe_file_test (moptions.rtSettings.monitorProfile, Glib::FILE_TEST_EXISTS)) monProfile->set_filename (moptions.rtSettings.monitorProfile); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index ba39750e9..30d95544f 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -108,7 +108,8 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener { Gtk::Label* waveletTileSizeLabel; Gtk::ComboBoxText* waveletTileSizeCombo; - Gtk::ComboBoxText* cprevdemo; + Gtk::ComboBoxText* cprevdemo; + Gtk::CheckButton* ctiffserialize; Gtk::ComboBoxText* curveBBoxPosC; Gtk::ComboBoxText* theme;