mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 21:52:49 +00:00
GUIで単体ファイルを入力した時に変換に失敗するバグを修正
This commit is contained in:
parent
559778bb54
commit
0b167104ee
@ -611,7 +611,23 @@ private:
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
const auto inputFuncMulti = [this, &file_paths](const tstring &input)
|
||||
@ -692,24 +708,23 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto out = output_path / (input_path.stem().wstring() + outputExt);
|
||||
file_paths.emplace_back(input_path.wstring(), out.wstring());
|
||||
}
|
||||
};
|
||||
const auto &outDir = output_path;
|
||||
|
||||
if (!boost::filesystem::exists(outDir))
|
||||
{
|
||||
const boost::filesystem::path output_path(boost::filesystem::absolute(output_str));
|
||||
if (!boost::filesystem::exists(output_path))
|
||||
if (!boost::filesystem::create_directories(outDir))
|
||||
{
|
||||
if (!boost::filesystem::create_directory(output_path))
|
||||
{
|
||||
SendMessage(dh, WM_FAILD_CREATE_DIR, (WPARAM)&output_path, 0);
|
||||
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);
|
||||
file_paths.emplace_back(input_path.wstring(), out.wstring());
|
||||
}
|
||||
};
|
||||
|
||||
if(input_str_multi.size() == 0)
|
||||
inputFunc(input_str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user