From 25fdf2114e43da652c782f4dc786b3516ff08293 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Sat, 1 Jun 2019 16:56:10 +0200 Subject: [PATCH 1/9] Change thumbnail cache eviction strategy --- rtgui/cachemanager.cc | 70 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index d86f6c41f..d5a42e84b 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -16,18 +16,19 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -#include "cachemanager.h" #include #include #include +#include #include #ifdef WIN32 #include #endif +#include "cachemanager.h" #include "guiutils.h" #include "options.h" #include "procparamchangers.h" @@ -340,66 +341,63 @@ Glib::ustring CacheManager::getCacheFileName (const Glib::ustring& subDir, void CacheManager::applyCacheSizeLimitation () const { // first count files without fetching file name and timestamp. + auto cachedir = opendir(Glib::build_filename(baseDir, "data").c_str()); + if (!cachedir) { + return; + } + std::size_t numFiles = 0; - try { + while (readdir(cachedir)) { + ++numFiles; + } - const auto dirName = Glib::build_filename (baseDir, "data"); - const auto dir = Gio::File::create_for_path (dirName); - - auto enumerator = dir->enumerate_children (""); - - while (numFiles <= options.maxCacheEntries && enumerator->next_file ()) { - ++numFiles; - } - - } catch (Glib::Exception&) {} + closedir(cachedir); + numFiles -= 2; // because . and .. are counted if (numFiles <= options.maxCacheEntries) { return; } using FNameMTime = std::pair; + std::vector files; + files.reserve(numFiles); + constexpr auto md5_size = 32; + // get filenames and timestamps try { + const auto dir = Gio::File::create_for_path(Glib::build_filename(baseDir, "data")); + const auto enumerator = dir->enumerate_children("standard::name,time::modified"); - const auto dirName = Glib::build_filename (baseDir, "data"); - const auto dir = Gio::File::create_for_path (dirName); - - auto enumerator = dir->enumerate_children ("standard::name,time::modified"); - - while (auto file = enumerator->next_file ()) { - files.emplace_back (file->get_name (), file->modification_time ()); + while (const auto file = enumerator->next_file()) { + const auto name = file->get_name(); + if (name.size() >= md5_size + 5) { + files.emplace_back(name, file->modification_time()); + } } } catch (Glib::Exception&) {} - if (files.size () <= options.maxCacheEntries) { + if (files.size() <= options.maxCacheEntries) { + // limit not reached return; } - std::sort (files.begin (), files.end (), [] (const FNameMTime& lhs, const FNameMTime& rhs) + constexpr auto reserve = 0.05f; // reserve 5% free cache space + const size_t toDelete = files.size() - options.maxCacheEntries + options.maxCacheEntries * reserve; + + std::nth_element(files.begin(), files.begin() + toDelete, files.end(), [] (const FNameMTime& lhs, const FNameMTime& rhs) { return lhs.second < rhs.second; }); - auto cacheEntries = files.size (); - - for (auto entry = files.begin (); cacheEntries-- > options.maxCacheEntries; ++entry) { - + for (auto entry = files.begin(); entry < files.begin() + toDelete; ++entry) { const auto& name = entry->first; + const auto name_size = name.size() - md5_size; + const auto fname = name.substr(0, name_size - 5); + const auto md5 = name.substr(name_size - 4, md5_size); - constexpr auto md5_size = 32; - const auto name_size = name.size(); - - if (name_size < md5_size + 5) { - continue; - } - - const auto fname = name.substr (0, name_size - md5_size - 5); - const auto md5 = name.substr (name_size - md5_size - 4, md5_size); - - deleteFiles (fname, md5, true, false); + deleteFiles(fname, md5, true, false); } } From f9c44f2e4757fc8ca56c20121cb0483c09b0fa46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Mon, 3 Jun 2019 09:19:46 +0200 Subject: [PATCH 2/9] Some minor cleanups and optimizations --- rtgui/cachemanager.cc | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index d5a42e84b..2b35e1e7a 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -20,15 +20,16 @@ #include #include -#include #include #include +#include #ifdef WIN32 #include #endif #include "cachemanager.h" + #include "guiutils.h" #include "options.h" #include "procparamchangers.h" @@ -352,7 +353,9 @@ void CacheManager::applyCacheSizeLimitation () const } closedir(cachedir); - numFiles -= 2; // because . and .. are counted + if (numFiles > 2) { + numFiles -= 2; // because . and .. are counted + } if (numFiles <= options.maxCacheEntries) { return; @@ -363,7 +366,7 @@ void CacheManager::applyCacheSizeLimitation () const std::vector files; files.reserve(numFiles); - constexpr auto md5_size = 32; + constexpr std::size_t md5_size = 32; // get filenames and timestamps try { const auto dir = Gio::File::create_for_path(Glib::build_filename(baseDir, "data")); @@ -383,15 +386,19 @@ void CacheManager::applyCacheSizeLimitation () const return; } - constexpr auto reserve = 0.05f; // reserve 5% free cache space - const size_t toDelete = files.size() - options.maxCacheEntries + options.maxCacheEntries * reserve; + const std::size_t toDelete = files.size() - options.maxCacheEntries + options.maxCacheEntries * 100 / 5; // reserve 5% free cache space - std::nth_element(files.begin(), files.begin() + toDelete, files.end(), [] (const FNameMTime& lhs, const FNameMTime& rhs) - { - return lhs.second < rhs.second; - }); + std::nth_element( + files.begin(), + files.begin() + toDelete, + files.end(), + [](const FNameMTime& lhs, const FNameMTime& rhs) -> bool + { + return lhs.second < rhs.second; + } + ); - for (auto entry = files.begin(); entry < files.begin() + toDelete; ++entry) { + for (std::vector::const_iterator entry = files.begin(), end = files.begin() + toDelete; entry != end; ++entry) { const auto& name = entry->first; const auto name_size = name.size() - md5_size; const auto fname = name.substr(0, name_size - 5); From 386ae560b1bfcf3953accb5b9200651fc7f508c8 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 3 Jun 2019 14:32:22 +0200 Subject: [PATCH 3/9] generateTranslationDiffs --- rtdata/languages/Deutsch | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch index a2f33e6fe..7f562d51c 100644 --- a/rtdata/languages/Deutsch +++ b/rtdata/languages/Deutsch @@ -201,10 +201,12 @@ FILEBROWSER_COLORLABEL_TOOLTIP;Farbmarkierung\n\nTaste: Strg + FILEBROWSER_COPYPROFILE;Profil kopieren FILEBROWSER_CURRENT_NAME;Aktueller Name: FILEBROWSER_DARKFRAME;Dunkelbild +FILEBROWSER_DELETEDIALOG_ALL;Möchten Sie wirklich %1 Dateien unwiderruflich löschen? FILEBROWSER_DELETEDIALOG_HEADER;Dateien löschen FILEBROWSER_DELETEDIALOG_SELECTED;Möchten Sie wirklich %1 Datei(en) unwiderruflich löschen? FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;Möchten Sie wirklich %1 Datei(en) unwiderruflich löschen, mit allen aus der Stapelverarbeitung resultierenden zugehörigen Ausgabedateien? FILEBROWSER_EMPTYTRASH;Papierkorb leeren +FILEBROWSER_EMPTYTRASHHINT;Alle Dateien im Papierkorb\nunwiderruflich löschen. FILEBROWSER_EXTPROGMENU;Öffnen mit FILEBROWSER_FLATFIELD;Weißbild FILEBROWSER_MOVETODARKFDIR;In Dunkelbild-Verzeichnis verschieben @@ -2358,9 +2360,3 @@ ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen.\nTaste: Alt + f ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: + ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: - -!!!!!!!!!!!!!!!!!!!!!!!!! -! Untranslated keys follow; remove the ! prefix after an entry is translated. -!!!!!!!!!!!!!!!!!!!!!!!!! - -FILEBROWSER_DELETEDIALOG_ALL;Möchten Sie wirklich %1 Dateien unwiderruflich löschen? -FILEBROWSER_EMPTYTRASHHINT;Alle Dateien im Papierkorb\nunwiderruflich löschen. From cc60ea224807a3057ef71aedab60b4e792ba3581 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Mon, 3 Jun 2019 17:38:50 -0400 Subject: [PATCH 4/9] Fix source comment and misc. typos Found via `codespell -q 3 -I ../rawtherapy-whitelist.txt -S ./rtdata/languages -L hist,fo,reall,bloc,alph` --- rtdata/languages/default | 2 +- rtdata/options/options.lin | 2 +- rtdata/options/options.osx | 2 +- rtdata/options/options.win | 2 +- rtengine/EdgePreservingDecomposition.cc | 2 +- rtengine/color.h | 2 +- rtengine/demosaic_algos.cc | 6 +++--- rtengine/eahd_demosaic.cc | 2 +- rtengine/improcfun.cc | 6 +++--- rtengine/ipretinex.cc | 2 +- rtengine/ipwavelet.cc | 6 +++--- rtgui/myflatcurve.cc | 2 +- rtgui/options.cc | 2 +- rtgui/toolpanelcoord.cc | 4 ++-- win.cmake | 2 +- 15 files changed, 22 insertions(+), 22 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 3b96e1b17..5ea726218 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1429,7 +1429,7 @@ TP_COLORAPP_SURROUND_AVER;Average TP_COLORAPP_SURROUND_DARK;Dark TP_COLORAPP_SURROUND_DIM;Dim TP_COLORAPP_SURROUND_EXDARK;Extremly Dark (Cutsheet) -TP_COLORAPP_SURROUND_TOOLTIP;Changes tones and colors to take into account the viewing conditions of the output device.\n\nAverage: Average light environment (standard). The image will not change.\n\nDim: Dim environment (TV). The image will become slighty dark.\n\nDark: Dark environment (projector). The image will become more dark.\n\nExtremly Dark: Extremly dark environment (cutsheet). The image will become very dark. +TP_COLORAPP_SURROUND_TOOLTIP;Changes tones and colors to take into account the viewing conditions of the output device.\n\nAverage: Average light environment (standard). The image will not change.\n\nDim: Dim environment (TV). The image will become slightly dark.\n\nDark: Dark environment (projector). The image will become more dark.\n\nExtremly Dark: Extremly dark environment (cutsheet). The image will become very dark. TP_COLORAPP_TCMODE_BRIGHTNESS;Brightness TP_COLORAPP_TCMODE_CHROMA;Chroma TP_COLORAPP_TCMODE_COLORF;Colorfulness diff --git a/rtdata/options/options.lin b/rtdata/options/options.lin index 91520dc0e..1d2f9faac 100644 --- a/rtdata/options/options.lin +++ b/rtdata/options/options.lin @@ -6,7 +6,7 @@ [General] # Setting MultiUser to false will use the application's installation directory as cache directory, -# which can be useful if you want to keep the application and all the cache datas in a single place, +# which can be useful if you want to keep the application and all the cache data in a single place, # an external HD for example MultiUser=true diff --git a/rtdata/options/options.osx b/rtdata/options/options.osx index 4decccb6d..11c5da4c8 100644 --- a/rtdata/options/options.osx +++ b/rtdata/options/options.osx @@ -6,7 +6,7 @@ [General] # Setting MultiUser to false will use the application's installation directory as cache directory, -# which can be useful if you want to keep the application and all the cache datas in a single place, +# which can be useful if you want to keep the application and all the cache data in a single place, # an external HD for example MultiUser=true diff --git a/rtdata/options/options.win b/rtdata/options/options.win index 40e73aacc..a4a767bf4 100644 --- a/rtdata/options/options.win +++ b/rtdata/options/options.win @@ -6,7 +6,7 @@ [General] # Setting MultiUser to false will use the application's installation directory as cache directory, -# which can be useful if you want to keep the application and all the cache datas in a single place, +# which can be useful if you want to keep the application and all the cache data in a single place, # an external HD for example MultiUser=true # Windows users should not use the system theme : some composed widget won't be usable diff --git a/rtengine/EdgePreservingDecomposition.cc b/rtengine/EdgePreservingDecomposition.cc index 6505cedab..6bda5d437 100644 --- a/rtengine/EdgePreservingDecomposition.cc +++ b/rtengine/EdgePreservingDecomposition.cc @@ -406,7 +406,7 @@ bool MultiDiagonalSymmetricMatrix::CreateIncompleteCholeskyFactorization(int Max fp = 1; for(int ii = 1; ii < m; ii++) { - fp = rtengine::min(StartRows[ii] - StartRows[ii - 1], MaxFillAbove); //Guarunteed positive since StartRows must be created in increasing order. + fp = rtengine::min(StartRows[ii] - StartRows[ii - 1], MaxFillAbove); //Guaranteed positive since StartRows must be created in increasing order. mic = mic + fp; } diff --git a/rtengine/color.h b/rtengine/color.h index e1ce1c08c..a94302e30 100644 --- a/rtengine/color.h +++ b/rtengine/color.h @@ -1796,7 +1796,7 @@ public: static inline double huelab_to_huehsv2 (float HH) { //hr=translate Hue Lab value (-Pi +Pi) in approximative hr (hsv values) (0 1) [red 1/6 yellow 1/6 green 1/6 cyan 1/6 blue 1/6 magenta 1/6 ] - // with multi linear correspondances (I expect there is no error !!) + // with multi linear correspondences (I expect there is no error !!) double hr = 0.0; //always put h between 0 and 1 diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 3536f1053..dc12bc01a 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1206,10 +1206,10 @@ void RawImageSource::igv_interpolate(int winw, int winh) } for (; col < width; col++, indx += 2) { - dest1[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT datas + dest1[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT data col++; if(col < width) - dest2[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT datas + dest2[indx >> 1] = CLIP(rawData[row][col]); //rawData = RT data } } @@ -1561,7 +1561,7 @@ void RawImageSource::igv_interpolate(int winw, int winh) for (int row = 0; row < height - 0; row++) for (int col = 0, indx = row * width + col; col < width - 0; col++, indx++) { int c = FC(row, col); - rgb[c][indx] = CLIP(rawData[row][col]); //rawData = RT datas + rgb[c][indx] = CLIP(rawData[row][col]); //rawData = RT data } // border_interpolate2(7, rgb); diff --git a/rtengine/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index 4bbf37c69..1663a087d 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -415,7 +415,7 @@ void RawImageSource::eahd_demosaic () } } - // finish H-2th and H-1th row, homogenity value is still valailable + // finish H-2th and H-1th row, homogeneity value is still available for (int i = H - 1; i < H + 1; i++) for (int j = 0; j < W; j++) { int hc = homh[(i - 1) % 3][j]; diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc index f63313126..53d930e1e 100644 --- a/rtengine/improcfun.cc +++ b/rtengine/improcfun.cc @@ -729,7 +729,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw const float hue = params->colorappearance.colorh; const float rstprotection = 100. - params->colorappearance.rstprotection; - // extracting datas from 'params' to avoid cache flush (to be confirmed) + // extracting data from 'params' to avoid cache flush (to be confirmed) const ColorAppearanceParams::TcMode curveMode = params->colorappearance.curveMode; const bool hasColCurve1 = bool (customColCurve1); const bool t1L = hasColCurve1 && curveMode == ColorAppearanceParams::TcMode::LIGHT; @@ -1668,7 +1668,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw -//all this treatments reduce artifacts, but can lead to slighty different results +//all this treatments reduce artifacts, but can lead to slightly different results if (params->defringe.enabled) if (execsharp) { @@ -2231,7 +2231,7 @@ void ImProcFunctions::rgbProc (Imagefloat* working, LabImage* lab, PipetteBuffer const float shoulder = ((65536.0 / max (1.0f, exp_scale)) * (hlcomprthresh / 200.0)) + 0.1; const float hlrange = 65536.0 - shoulder; const bool isProPhoto = (params->icm.workingProfile == "ProPhoto"); - // extracting datas from 'params' to avoid cache flush (to be confirmed) + // extracting data from 'params' to avoid cache flush (to be confirmed) ToneCurveMode curveMode = params->toneCurve.curveMode; ToneCurveMode curveMode2 = params->toneCurve.curveMode2; bool highlight = params->toneCurve.hrenabled;//Get the value if "highlight reconstruction" is activated diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 9d94e9326..309c7073b 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -656,7 +656,7 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e float cdfactor = 32768.f / delta; maxCD = -9999999.f; minCD = 9999999.f; - // coeff for auto "transmission" with 2 sigma #95% datas + // coeff for auto "transmission" with 2 sigma #95% data float aza = 16300.f / (2.f * stddv); float azb = -aza * (mean - 2.f * stddv); float bza = 16300.f / (2.f * stddv); diff --git a/rtengine/ipwavelet.cc b/rtengine/ipwavelet.cc index e6e84bc50..ff7aefa19 100644 --- a/rtengine/ipwavelet.cc +++ b/rtengine/ipwavelet.cc @@ -3004,7 +3004,7 @@ void ImProcFunctions::ContAllL (float *koeLi[12], float *maxkoeLi, bool lipschit if(useChromAndHue) { float modhue = varhue[ii][jj]; modchro = varchrom[ii * 2][jj * 2]; - // hue chroma skin with initial lab datas + // hue chroma skin with initial lab data scale = 1.f; if(skinprot > 0.f) { @@ -3216,7 +3216,7 @@ void ImProcFunctions::ContAllAB (LabImage * labco, int maxlvl, float ** varhue, float LL100 = labco->L[ii * 2][jj * 2] / 327.68f; float modhue = varhue[ii][jj]; float modchro = varchrom[ii * 2][jj * 2]; - // hue chroma skin with initial lab datas + // hue chroma skin with initial lab data float scale = 1.f; if(skinprot > 0.f) { @@ -3252,7 +3252,7 @@ void ImProcFunctions::ContAllAB (LabImage * labco, int maxlvl, float ** varhue, float modchro = varchrom[ii * 2][jj * 2]; if(useSkinControl) { - // hue chroma skin with initial lab datas + // hue chroma skin with initial lab data float LL100 = labco->L[ii * 2][jj * 2] / 327.68f; float modhue = varhue[ii][jj]; diff --git a/rtgui/myflatcurve.cc b/rtgui/myflatcurve.cc index 03ee362a2..29558a22b 100644 --- a/rtgui/myflatcurve.cc +++ b/rtgui/myflatcurve.cc @@ -1621,7 +1621,7 @@ void MyFlatCurve::movePoint(bool moveX, bool moveY, bool pipetteDrag) } } -// Set datas relative to cursor position +// Set data relative to cursor position void MyFlatCurve::getCursorPosition(Gdk::EventType evType, bool isHint, int evX, int evY, Gdk::ModifierType modifierKey) { int tx, ty; diff --git a/rtgui/options.cc b/rtgui/options.cc index 8f601b764..2437f5313 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -44,7 +44,7 @@ // User's settings directory, including images' profiles if used Glib::ustring Options::rtdir; -// User's cached datas' directory +// User's cached data directory Glib::ustring Options::cacheBaseDir; Options options; diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index a595b1b1c..41e25387e 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -768,8 +768,8 @@ rtengine::RawImage* ToolPanelCoordinator::getFF() const rtengine::FramesMetaData *imd = ipc->getInitialImage()->getMetaData(); if (imd) { - // int iso = imd->getISOSpeed(); temporarilly removed because unused - // double shutter = imd->getShutterSpeed(); temporarilly removed because unused + // int iso = imd->getISOSpeed(); temporarily removed because unused + // double shutter = imd->getShutterSpeed(); temporarily removed because unused double aperture = imd->getFNumber(); double focallength = imd->getFocalLen(); std::string maker ( imd->getMake() ); diff --git a/win.cmake b/win.cmake index 9c292b2df..8b1caa12d 100644 --- a/win.cmake +++ b/win.cmake @@ -5,7 +5,7 @@ #set(CMAKE_BUILD_TYPE Release CACHE STRING "Between: None Debug Release RelWithDebInfo MinSizeRel.") set(CMAKE_INSTALL_PREFIX ./${CMAKE_BUILD_TYPE} CACHE PATH "Libraries installation path") -set(DATADIR . CACHE PATH "Datas installation path") +set(DATADIR . CACHE PATH "Data installation path") set(BINDIR . CACHE PATH "Binaries installation path") set(LIBDIR . CACHE PATH "Libraries installation path") set(DOCDIR ./doc CACHE PATH "Documentation installation path") From d46a043add523ee3136f2e897fb67f8be63f4cb7 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 4 Jun 2019 14:17:38 +0200 Subject: [PATCH 5/9] basic support for Fujifilm GFX 100 --- rtengine/camconst.json | 5 +++++ rtengine/dcraw.cc | 2 ++ 2 files changed, 7 insertions(+) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 2492eec28..9e6ec49b6 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -1245,6 +1245,11 @@ Camera constants: "ranges": { "white": 64886 } }, + { // Quality C + "make_model": "FUJIFILM GFX 100", + "raw_crop": [ 0, 2, 11664, 8734 ] + }, + { // Quality B "make_model": "FUJIFILM GFX 50S", "dcraw_matrix": [ 11756,-4754,-874,-3056,11045,2305,-381,1457,6006 ], // DNGv9.9 D65 diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index ceb40f279..68934314e 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -9279,6 +9279,8 @@ void CLASS identify() apply_tiff(); if (!strcmp(model, "X-T3")) { height = raw_height - 2; + } else if (!strcmp(model, "GFX 100")) { + load_flags = 0; } if (!load_raw) { load_raw = &CLASS unpacked_load_raw; From f18724e0166acb369f7c7f16a26bc773cc2794d3 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 4 Jun 2019 16:30:22 +0200 Subject: [PATCH 6/9] Silence some warnings --- rtengine/dcraw.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 68934314e..ae8aefa91 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -4,6 +4,9 @@ #if (__GNUC__ >= 6) #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif +#if (__GNUC__ >= 9) +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #endif /*RT*/#include From a391e256bcf63ab3fcae4568c0525fa3496cdf29 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 4 Jun 2019 16:30:54 +0200 Subject: [PATCH 7/9] Fix possibly uninitialized variable --- rtengine/procparams.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 6d914bb27..c24ee0049 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3965,7 +3965,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited) if (ppVersion >= 346) { assignFromKeyfile(keyFile, "SharpenMicro", "Uniformity", pedited, sharpenMicro.uniformity, pedited->sharpenMicro.uniformity); } else { - double temp; + double temp = 50.0; assignFromKeyfile(keyFile, "SharpenMicro", "Uniformity", pedited, temp, pedited->sharpenMicro.uniformity); sharpenMicro.uniformity = temp / 10; } From 3c0b0ffd331ca6d9bae8eed63723bf17a9c6e1e4 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 4 Jun 2019 17:01:05 +0200 Subject: [PATCH 8/9] Small speedup for loading unpacked 16 bit raw files --- rtengine/dcraw.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index ae8aefa91..280b692e7 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -2507,11 +2507,19 @@ void CLASS unpacked_load_raw() while (1 << ++bits < maximum); read_shorts (raw_image, raw_width*raw_height); - for (row=0; row < raw_height; row++) - for (col=0; col < raw_width; col++) - if ((RAW(row,col) >>= load_flags) >> bits - && (unsigned) (row-top_margin) < height - && (unsigned) (col-left_margin) < width) derror(); + if (load_flags) { + for (row=0; row < raw_height; row++) + for (col=0; col < raw_width; col++) + if ((RAW(row,col) >>= load_flags) >> bits + && (unsigned) (row-top_margin) < height + && (unsigned) (col-left_margin) < width) derror(); + } else if (bits < 16) { + for (row=0; row < raw_height; row++) + for (col=0; col < raw_width; col++) + if (RAW(row,col) >> bits + && (unsigned) (row-top_margin) < height + && (unsigned) (col-left_margin) < width) derror(); + } } From df65774667f3d62cbc0698f219f743f81f910cd5 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Tue, 4 Jun 2019 17:52:39 +0200 Subject: [PATCH 9/9] Fix calculation of reserve --- rtgui/cachemanager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 2b35e1e7a..b270c3795 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -386,7 +386,7 @@ void CacheManager::applyCacheSizeLimitation () const return; } - const std::size_t toDelete = files.size() - options.maxCacheEntries + options.maxCacheEntries * 100 / 5; // reserve 5% free cache space + const std::size_t toDelete = files.size() - options.maxCacheEntries + options.maxCacheEntries * 5 / 100; // reserve 5% free cache space std::nth_element( files.begin(),