[node] Pixel ratio may be floating point
This commit is contained in:
@@ -638,7 +638,7 @@ void NodeMap::AddImage(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
return Nan::ThrowTypeError("width parameter required");
|
||||
}
|
||||
|
||||
if (!Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->IsUint32()) {
|
||||
if (!Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->IsNumber()) {
|
||||
return Nan::ThrowTypeError("pixelRatio parameter required");
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ void NodeMap::AddImage(const Nan::FunctionCallbackInfo<v8::Value>& info) {
|
||||
return Nan::ThrowTypeError("Max height and width is 1024");
|
||||
}
|
||||
|
||||
uint32_t pixelRatio = Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->Uint32Value();
|
||||
float pixelRatio = Nan::Get(optionObject, Nan::New("pixelRatio").ToLocalChecked()).ToLocalChecked()->NumberValue();
|
||||
auto imageBuffer = Nan::To<v8::Object>(info[1]).ToLocalChecked()->ToObject();
|
||||
|
||||
char * imageDataBuffer = node::Buffer::Data(imageBuffer);
|
||||
|
||||
Reference in New Issue
Block a user