diff --git a/waifu2x-caffe-gui/Resource.rc b/waifu2x-caffe-gui/Resource.rc index fed00cc..ef3eb63 100644 Binary files a/waifu2x-caffe-gui/Resource.rc and b/waifu2x-caffe-gui/Resource.rc differ diff --git a/waifu2x-caffe-gui/Source.cpp b/waifu2x-caffe-gui/Source.cpp index 9118efb..e3660e9 100644 --- a/waifu2x-caffe-gui/Source.cpp +++ b/waifu2x-caffe-gui/Source.cpp @@ -152,7 +152,7 @@ private: scale_ratio = 2.0; ret = false; - MessageBox(dh, TEXT("拡大率は数字である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR); + MessageBox(dh, TEXT("拡大率は0.0より大きい正数である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR); } } @@ -179,6 +179,22 @@ private: inputFileExt = buf; } + { + char buf[AR_PATH_MAX] = ""; + GetWindowTextA(GetDlgItem(dh, IDC_EDIT_CROP_SIZE), buf, _countof(buf)); + buf[_countof(buf) - 1] = '\0'; + + char *ptr = nullptr; + crop_size = strtol (buf, &ptr, 10); + if (!ptr || *ptr != '\0') + { + crop_size = 128; + ret = false; + + MessageBox(dh, TEXT("分割サイズは0より大きい整数である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR); + } + } + return ret; } @@ -559,6 +575,7 @@ public: SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_SCALE_RATIO), text); SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_OUT_EXT), outputExt.c_str()); SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_INPUT_EXT_LIST), inputFileExt.c_str()); + SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_CROP_SIZE), std::to_string(crop_size).c_str()); } void Cancel(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) diff --git a/waifu2x-caffe-gui/resource.h b/waifu2x-caffe-gui/resource.h index eff5780..7df8cd7 100644 Binary files a/waifu2x-caffe-gui/resource.h and b/waifu2x-caffe-gui/resource.h differ