Closed gameveloster closed 2 days ago
Hi @gameveloster,
Apologies for the delayed response.
I was able to successfully convert the base64 image string into a base64 Uint8Array using the code snippet you provided. Here is the code I used:
const resizedImage = await ImageManipulator.manipulateAsync(
selectedImage,
[{ resize: { width: 640, height: 640 } }],
{ format: ImageManipulator.SaveFormat.PNG, base64: true }
);
const resizedImagBase = resizedImage.base64 ?? '';
console.log("resizedImage..", resizedImagBase)
const imgBuffer = tf.util.encodeString( resizedImagBase
, 'base64').buffer;
console.log("imgBuffer",imgBuffer)
This code results in a Uint8Array
, as shown in the attached image.
The error suggests that the env() function might not be properly initialized, as referenced in environment.ts.
Please try the following troubleshooting steps:
1) Delete your node_modules folder.
2) Remove the package-lock.json or yarn.lock file.
3) Reinstall all dependencies using `npm install`.
Let me know if this resolves the issue.
Thank you!
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.
I'm having issues using tfjs in Expo app.
Getting the error:
when trying to use
tf.util.encodeString
:Anyone encountered this before?
My app has installed
expo@51.0.13
,@tensorflow/tfjs@4.20.0