Skip to content

Commit

Permalink
🔨 Rebuild fix save
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Jan 9, 2020
1 parent 001d83f commit db30e7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cpp/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ JS_IMPLEMENT_METHOD(Image, save) { THIS_CHECK;
FreeImage_Unload(old);
}

#ifdef _WIN32
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::wstring ws = converter.from_bytes(dest);
bool ret = FreeImage_SaveU(format, output, ws.c_str()) == 1;
#else
bool ret = FreeImage_Save(format, output, dest.c_str()) == 1;
#endif

FreeImage_Unload(output);

Expand Down

0 comments on commit db30e7a

Please sign in to comment.