Ensure support for wide-char filenames on Windows #4391

This commit is contained in:
Lovell Fuller
2025-05-13 08:53:37 +01:00
parent 0b5f131df8
commit 7c7f960b60
3 changed files with 22 additions and 1 deletions

View File

@@ -1359,7 +1359,8 @@ class PipelineWorker : public Napi::AsyncWorker {
// Add file size to info
if (baton->formatOut != "dz" || sharp::IsDzZip(baton->fileOut)) {
try {
uint32_t const size = static_cast<uint32_t>(std::filesystem::file_size(baton->fileOut));
uint32_t const size = static_cast<uint32_t>(
std::filesystem::file_size(std::filesystem::u8path(baton->fileOut)));
info.Set("size", size);
} catch (...) {}
}