mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
GUIで大量の画像を入れたフォルダを入力にした際、GUIが長時間フリーズするのを修正
This commit is contained in:
parent
a309c1f367
commit
52eedcc8b9
@ -456,35 +456,7 @@ private:
|
||||
HWND hcrop = GetDlgItem(dh, IDC_COMBO_CROP_SIZE);
|
||||
|
||||
int gcd = 1;
|
||||
if (boost::filesystem::is_directory(input_path))
|
||||
{
|
||||
BOOST_FOREACH(const boost::filesystem::path& p, std::make_pair(boost::filesystem::recursive_directory_iterator(input_path),
|
||||
boost::filesystem::recursive_directory_iterator()))
|
||||
{
|
||||
|
||||
if (!boost::filesystem::is_directory(p))
|
||||
{
|
||||
tstring ext(getTString(p.extension()));
|
||||
#ifdef UNICODE
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::towlower);
|
||||
#else
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
|
||||
#endif
|
||||
if (std::find(extList.begin(), extList.end(), ext) != extList.end())
|
||||
{
|
||||
auto mat = Waifu2x::LoadMat(p.string());
|
||||
if (mat.empty())
|
||||
continue;
|
||||
|
||||
auto size = mat.size();
|
||||
mat.release();
|
||||
|
||||
gcd = boost::math::gcd(size.width, size.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!boost::filesystem::is_directory(input_path))
|
||||
{
|
||||
auto mat = Waifu2x::LoadMat(input_path.string());
|
||||
if (mat.empty())
|
||||
|
Loading…
x
Reference in New Issue
Block a user