mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
GUIで単体ファイルを入力した時に変換に失敗するバグを修正
This commit is contained in:
parent
559778bb54
commit
0b167104ee
@ -611,7 +611,23 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
const boost::filesystem::path output_path(output_str);
|
||||||
|
const auto outDir = output_path.branch_path();
|
||||||
|
|
||||||
|
if (!boost::filesystem::exists(outDir))
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::create_directories(outDir))
|
||||||
|
{
|
||||||
|
SendMessage(dh, WM_FAILD_CREATE_DIR, (WPARAM)&outDir, 0);
|
||||||
|
PostMessage(dh, WM_END_THREAD, 0, 0);
|
||||||
|
// printf("出力フォルダ「%s」の作成に失敗しました\n", output_path.string().c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
file_paths.emplace_back(input_str, output_str);
|
file_paths.emplace_back(input_str, output_str);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto inputFuncMulti = [this, &file_paths](const tstring &input)
|
const auto inputFuncMulti = [this, &file_paths](const tstring &input)
|
||||||
@ -692,25 +708,24 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
const auto &outDir = output_path;
|
||||||
|
|
||||||
|
if (!boost::filesystem::exists(outDir))
|
||||||
|
{
|
||||||
|
if (!boost::filesystem::create_directories(outDir))
|
||||||
|
{
|
||||||
|
SendMessage(dh, WM_FAILD_CREATE_DIR, (WPARAM)&outDir, 0);
|
||||||
|
PostMessage(dh, WM_END_THREAD, 0, 0);
|
||||||
|
// printf("出力フォルダ「%s」の作成に失敗しました\n", output_path.string().c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const auto out = output_path / (input_path.stem().wstring() + outputExt);
|
const auto out = output_path / (input_path.stem().wstring() + outputExt);
|
||||||
file_paths.emplace_back(input_path.wstring(), out.wstring());
|
file_paths.emplace_back(input_path.wstring(), out.wstring());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
|
||||||
const boost::filesystem::path output_path(boost::filesystem::absolute(output_str));
|
|
||||||
if (!boost::filesystem::exists(output_path))
|
|
||||||
{
|
|
||||||
if (!boost::filesystem::create_directory(output_path))
|
|
||||||
{
|
|
||||||
SendMessage(dh, WM_FAILD_CREATE_DIR, (WPARAM)&output_path, 0);
|
|
||||||
PostMessage(dh, WM_END_THREAD, 0, 0);
|
|
||||||
// printf("出力フォルダ「%s」の作成に失敗しました\n", output_path.string().c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(input_str_multi.size() == 0)
|
if(input_str_multi.size() == 0)
|
||||||
inputFunc(input_str);
|
inputFunc(input_str);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user