Hello,
In my React Native app using tensorflow.js, I retrieve an image (a file) as a base64 type with:
const img64 = await FileSystem.readAsStringAsync(result.uri, {encoding:FileSystem.EncodingType.Base64})
This returns something like this:
iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAIAAAC3ytZVAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAWqADAAQAAAABAAAAWgAAAABJfIu3AAAA......
But then when I call:
const imgBuffer = tf.util.encodeString(img64, 'base64').buffer
it returns an empty array…