Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix outputfile extension problem when input is directory #33

Merged
merged 1 commit into from
Dec 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions waifu2x_snowshell/Converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ bool Converter_Cpp::execute(ConvertOption *convertOption, bool noLabel) {
// create folder for folder conversion
if (convertOption->getOutputFolderName() != L"") {
CreateDirectory(convertOption->getOutputFolderName().c_str(), NULL);
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.'));
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.')) + L'.' + convertOption->getOutputFileExtension();
}

// set model directory
Expand Down Expand Up @@ -412,7 +412,7 @@ bool Converter_Caffe::execute(ConvertOption *convertOption, bool noLabel) {
// create folder for folder conversion
if (convertOption->getOutputFolderName() != L"") {
CreateDirectory(convertOption->getOutputFolderName().c_str(), NULL);
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.'));
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.')) + L'.' + convertOption->getOutputFileExtension();
}

// set model directory
Expand Down Expand Up @@ -477,7 +477,7 @@ bool Converter_Vulkan::execute(ConvertOption* convertOption, bool noLabel) {
// create folder for folder conversion
if (convertOption->getOutputFolderName() != L"") {
CreateDirectory(convertOption->getOutputFolderName().c_str(), NULL);
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.'));
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.')) + L'.' + convertOption->getOutputFileExtension();
}

// set model directory
Expand Down Expand Up @@ -542,7 +542,7 @@ bool Converter_Cugan::execute(ConvertOption* convertOption, bool noLabel) {
// create folder for folder conversion
if (convertOption->getOutputFolderName() != L"") {
CreateDirectory(convertOption->getOutputFolderName().c_str(), NULL);
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.'));
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.')) + L'.' + convertOption->getOutputFileExtension();
}

// set model directory
Expand Down Expand Up @@ -602,7 +602,7 @@ bool Converter_Esrgan::execute(ConvertOption* convertOption, bool noLabel) {
// create folder for folder conversion
if (convertOption->getOutputFolderName() != L"") {
CreateDirectory(convertOption->getOutputFolderName().c_str(), NULL);
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.'));
ExportName = convertOption->getOutputFolderName() + InputName.substr(last, InputName.find_last_of(L'.')) + L'.' + convertOption->getOutputFileExtension();
}

// set model directory
Expand Down