You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the jpeg-js module with an iOS application and everything was working correctly
Now I have passed to an android version of the same App.
But there is an issue that I don't get.
When I use the decode function i have the following error : Can't find variable: Buffer
After checking it's at line 1128 of the jpeg-js module.
try {
JpegImage.requestMemoryAllocation(bytesNeeded);
var image = {
width: decoder.width,
height: decoder.height,
exifBuffer: decoder.exifBuffer,
data: opts.useTArray ?
new Uint8Array(bytesNeeded) : Buffer.alloc(bytesNeeded)
};
if(decoder.comments.length > 0) {
image["comments"] = decoder.comments;
}
} catch (err) {
if (err instanceof RangeError) {
throw new Error("Could not allocate enough memory for the image. " +
"Required: " + bytesNeeded);
}
if (err instanceof ReferenceError) {
if (err.message === "Buffer is not defined") {
throw new Error("Buffer is not globally defined in this environment. " +
"Consider setting useTArray to true");
}
}
throw err;
}
I don't get why the Buffer is not a global variable ?
Hi there,
I have been using the jpeg-js module with an iOS application and everything was working correctly
Now I have passed to an android version of the same App.
But there is an issue that I don't get.
When I use the decode function i have the following error : Can't find variable: Buffer
After checking it's at line 1128 of the jpeg-js module.
}
I don't get why the Buffer is not a global variable ?
Package.json data :
"react": "18.2.0",
"react-native": "0.71.0",
"buffer": "^6.0.3",
"jpeg-js": "^0.4.4",
Do you have any clues on this ?
The text was updated successfully, but these errors were encountered: