diff --git a/rtdata/languages/default b/rtdata/languages/default index b9f966744..f394f80d2 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1075,7 +1075,7 @@ PREFERENCES_MIP;Mip Profiles PREFERENCES_MIP_LABEL;Mip profiles: PREFERENCES_MIP_OPT;Mip files in cache PREFERENCES_MIP_PREV;Next Input file -PREFERENCES_MIP_TOOLTIP;Next input file allow multiple sessions of the same file, but do not allow path with NON ASCII characters.\nMip files in Cache, allow NON ASCII characters in path, but allow only one session for the same file. +PREFERENCES_MIP_TOOLTIP;Next input file allow multiple sessions of the same file, but do not allow path with NON ASCII characters.\nMip files in Cache, allow NON ASCII characters in path, allow multi session for the same file. PREFERENCES_MONINTENT;Default rendering intent PREFERENCES_MONITOR;Monitor PREFERENCES_MONPROFILE;Default color profile diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 47fa302b8..819a673cc 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -26,6 +26,9 @@ #include #include #include +#include "../rtgui/cachemanager.h" +#include "../rtgui/cacheimagedata.h" + //#include // "ceil" rounding //#define SKIPS(a,b) ((a) / (b) + ((a) % (b) > 0)) @@ -836,12 +839,20 @@ void Crop::update (int todo) // if (tyty ) { //Glib::ustring datalab2 = parent->imgsrc->getFileName() + ".mip"; // Glib::ustring pop = options.getUserProfilePath() + "/"; + + CacheManager* cachemgr; // parent + + CacheImageData cfs; // cache entry corresponding to the thumbnai + cfs.md5 = cachemgr->getMD5 (parent->imgsrc->getFileName()); + std::string mdfive = cfs.md5; + // printf("md5=%s \n", mdfive.c_str()); + Glib::ustring pop = options.cacheBaseDir + "/mip/"; Glib::ustring datalab; if (options.mip == MI_opt) { - datalab = pop + Glib::path_get_basename (parent->imgsrc->getFileName () + ".mip"); + datalab = pop + Glib::path_get_basename (parent->imgsrc->getFileName () + "." + mdfive + ".mip"); } if (options.mip == MI_prev) { diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index a32e574d9..f8925d9e3 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -26,6 +26,9 @@ #include #include #include +#include "../rtgui/cachemanager.h" +#include "../rtgui/cacheimagedata.h" + #include "iccstore.h" #ifdef _OPENMP #include @@ -717,6 +720,14 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) */ bool isascii = true; + CacheManager* cachemgr; // parent + + CacheImageData cfs; // cache entry corresponding to the thumbnai + cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); + std::string mdfive = cfs.md5; +// printf("md5=%s \n", mdfive.c_str()); + + Glib::ustring datainterm = imgsrc->getFileName() + ".ii";//extansion ii arbitrary to test if mip file is possible ofstream finterm (datainterm, ios::out); @@ -744,9 +755,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) Glib::ustring datal; - if (options.mip == MI_opt || !isascii) { - datal = pop + Glib::path_get_basename (imgsrc->getFileName () + ".mip"); + datal = pop + Glib::path_get_basename (imgsrc->getFileName () + "." + mdfive + ".mip"); } if (options.mip == MI_prev && isascii) {//&& isascii diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index 0404ad295..9e9f0f223 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -26,6 +26,7 @@ #include "imagesource.h" #include "procevents.h" #include "dcrop.h" + #include "LUT.h" #include "../rtgui/threadutils.h" diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index da6f139b6..59ebf9824 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -32,6 +32,8 @@ #include #include #include +#include "../rtgui/cachemanager.h" +#include "../rtgui/cacheimagedata.h" #undef THREAD_PRIORITY_NORMAL @@ -946,6 +948,11 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p if (params.locallab.enabled) { MyTime t1, t2; t1.set(); + CacheManager* cachemgr; // parent + + CacheImageData cfs; // cache entry corresponding to the thumbnai + cfs.md5 = cachemgr->getMD5 (imgsrc->getFileName()); + std::string mdfive = cfs.md5; //Glib::ustring datalab = imgsrc->getFileName() + ".mip"; @@ -955,7 +962,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p Glib::ustring datalab; if (options.mip == MI_opt) { - datalab = pop + Glib::path_get_basename (imgsrc->getFileName () + ".mip"); + datalab = pop + Glib::path_get_basename (imgsrc->getFileName () + "." + mdfive + ".mip"); } if (options.mip == MI_prev) { diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 081db2b76..b391ad50c 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -195,6 +195,7 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin error |= g_rename (getCacheFileName ("aehistograms", oldfilename, "", oldmd5).c_str (), getCacheFileName ("aehistograms", newfilename, "", newmd5).c_str ()); error |= g_rename (getCacheFileName ("embprofiles", oldfilename, ".icc", oldmd5).c_str (), getCacheFileName ("embprofiles", newfilename, ".icc", newmd5).c_str ()); error |= g_rename (getCacheFileName ("data", oldfilename, ".txt", oldmd5).c_str (), getCacheFileName ("data", newfilename, ".txt", newmd5).c_str ()); + error |= g_rename (getCacheFileName ("mip", oldfilename, ".mip", oldmd5).c_str (), getCacheFileName ("mip", newfilename, ".mip", newmd5).c_str ()); if (error != 0 && options.rtSettings.verbose) { std::cerr << "Failed to rename all files for cache entry '" << oldfilename << "': " << g_strerror (errno) << std::endl; @@ -255,6 +256,8 @@ void CacheManager::clearProfiles () const MyMutex::MyLock lock (mutex); deleteDir ("profiles"); + deleteDir ("mip"); + } void CacheManager::deleteDir (const Glib::ustring& dirName) const @@ -295,6 +298,8 @@ void CacheManager::deleteFiles (const Glib::ustring& fname, const std::string& m if (purgeProfile) { error |= g_remove (getCacheFileName ("profiles", fname, paramFileExtension, md5).c_str ()); + error |= g_remove (getCacheFileName ("mip", fname, ".mip", md5).c_str ()); + } if (error != 0 && options.rtSettings.verbose) {