Skip to content

Commit

Permalink
Revert "Test fix for node 0.8 failing."
Browse files Browse the repository at this point in the history
This reverts commit eb18a1f.
  • Loading branch information
Deltatiger committed Apr 19, 2016
1 parent 06b5e80 commit d5e3668
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -734,17 +734,17 @@ class BMP
//Convert object from Javascript to a C++ class (BMP).
BMP buildBMP(Local<Object> info)
{
char * buf = NULL;
BMP img;
Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked();

BMP img;

img.width = obj->Get(Nan::New("width").ToLocalChecked())->Uint32Value();
img.height = obj->Get(Nan::New("height").ToLocalChecked())->Uint32Value();
img.byteWidth = obj->Get(Nan::New("byteWidth").ToLocalChecked())->Uint32Value();
img.bitsPerPixel = obj->Get(Nan::New("bitsPerPixel").ToLocalChecked())->Uint32Value();
img.bytesPerPixel = obj->Get(Nan::New("bytesPerPixel").ToLocalChecked())->Uint32Value();

buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));
char* buf = node::Buffer::Data(obj->Get(Nan::New("image").ToLocalChecked()));

//Convert the buffer to a uint8_t which createMMBitmap requires.
img.image = (uint8_t *)malloc(img.byteWidth * img.height);
Expand Down

0 comments on commit d5e3668

Please sign in to comment.