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
4b21788fcd
commit
08555f0864
@ -493,7 +493,13 @@ private:
|
||||
SyncMember(true);
|
||||
|
||||
const boost::filesystem::path output_path(output_str);
|
||||
std::string stem = output_path.stem().string();
|
||||
std::string stem;
|
||||
|
||||
if (!boost::filesystem::is_directory(input_str))
|
||||
stem = output_path.stem().string();
|
||||
else
|
||||
stem = output_path.filename().string();
|
||||
|
||||
if (stem.length() > 0 && stem.length() >= autoSetAddName.length())
|
||||
{
|
||||
const std::string base = stem.substr(0, stem.length() - autoSetAddName.length());
|
||||
@ -503,7 +509,11 @@ private:
|
||||
const std::string addstr(AddName());
|
||||
autoSetAddName = addstr;
|
||||
|
||||
boost::filesystem::path new_out_path = output_path.branch_path() / (base + addstr + outputExt);
|
||||
boost::filesystem::path new_out_path;
|
||||
if (!boost::filesystem::is_directory(input_str))
|
||||
new_out_path = output_path.branch_path() / (base + addstr + outputExt);
|
||||
else
|
||||
new_out_path = output_path.branch_path() / (base + addstr);
|
||||
|
||||
SetWindowTextA(GetDlgItem(dh, IDC_EDIT_OUTPUT), new_out_path.string().c_str());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user