@@ -56,7 +56,7 @@ JS_IMPLEMENT_GETTER(Image, height) {
5656inline Napi::Buffer<uint8_t > createBuffer (Napi::Env env, FIBITMAP *bmp) {
5757 size_t pixelCount = FreeImage_GetWidth (bmp) * FreeImage_GetHeight (bmp);
5858 size_t byteCount = pixelCount * 4 ;
59- const BYTE *src = FreeImage_GetBits (bmp);
59+ const uint8_t *src = FreeImage_GetBits (bmp);
6060
6161 Napi::Buffer<uint8_t > buffer = Napi::Buffer<uint8_t >::New (env, byteCount);
6262 uint8_t *dest = buffer.Data ();
@@ -78,7 +78,7 @@ JS_IMPLEMENT_METHOD(Image, _load) {
7878 REQ_BUF_ARG (0 , file);
7979 LET_BOOL_ARG (1 , swapBytes);
8080
81- BYTE *bufferData = reinterpret_cast <BYTE *>(file.Data ());
81+ uint8_t *bufferData = reinterpret_cast <uint8_t *>(file.Data ());
8282 size_t bufferLength = file.Length ();
8383
8484 FIMEMORY *memStream = FreeImage_OpenMemory (bufferData, bufferLength);
@@ -119,11 +119,11 @@ JS_IMPLEMENT_METHOD(Image, _load) {
119119 // Swap R-B bytes?
120120 if (swapBytes) {
121121 size_t pixelCount = (FreeImage_GetWidth (_bitmap) * FreeImage_GetHeight (_bitmap));
122- BYTE *pixels = FreeImage_GetBits (_bitmap);
122+ uint8_t *pixels = FreeImage_GetBits (_bitmap);
123123
124124 for (size_t i = 0 ; i < pixelCount; i++) {
125125 size_t i4 = i << 2 ;
126- BYTE temp = pixels[i4 + 0 ];
126+ uint8_t temp = pixels[i4 + 0 ];
127127 pixels[i4 + 0 ] = pixels[i4 + 2 ];
128128 pixels[i4 + 2 ] = temp;
129129 }
0 commit comments