Improves the process of locating mip files to avoid crash

This commit is contained in:
Desmis
2017-01-22 08:58:46 +01:00
parent 273e1cb3b2
commit 3ecf01c713
2 changed files with 974 additions and 965 deletions

View File

@@ -712,17 +712,29 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
* 2017 Jacques Desmis <jdesmis@gmail.com>
*/
bool isascii = true;
Glib::ustring datainterm = imgsrc->getFileName() + ".mip";
ofstream finterm (datainterm, ios::out);
if (finterm.fail()) {
printf ("Non ascii Mip file..switch to Profiles\n");
isascii = false;
} else {
printf ("ascii Mip file!\n");
}
finterm.close();
// Glib::ustring datalab = imgsrc->getFileName() + ".mip";
// printf("mip file=%s \n", datalab.c_str());
Glib::ustring pop = options.getUserProfilePath() + "/";
Glib::ustring datal;
if (options.mip == MI_opt) {
if (options.mip == MI_opt || !isascii) {
datal = pop + Glib::path_get_basename (imgsrc->getFileName () + ".mip");
}
if (options.mip == MI_prev) {
if (options.mip == MI_prev && isascii) {
datal = imgsrc->getFileName() + ".mip";
}