mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Explicit cast of size_t to 32 bit integer
Ensures compilation with nan 1.5.0+
This commit is contained in:
@@ -725,13 +725,13 @@ class ResizeWorker : public NanAsyncWorker {
|
||||
argv[1] = NanNewBufferHandle(static_cast<char*>(baton->bufferOut), baton->bufferOutLength);
|
||||
g_free(baton->bufferOut);
|
||||
// Add buffer size to info
|
||||
info->Set(NanNew<String>("size"), NanNew<Integer>(baton->bufferOutLength));
|
||||
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(baton->bufferOutLength)));
|
||||
argv[2] = info;
|
||||
} else {
|
||||
// Add file size to info
|
||||
struct stat st;
|
||||
g_stat(baton->output.c_str(), &st);
|
||||
info->Set(NanNew<String>("size"), NanNew<Integer>(st.st_size));
|
||||
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
|
||||
argv[1] = info;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user