itinance / itinance/react-native-fs

Reading an image file and returning Uint8Array or Uint8ClampedArray

Open
#1,145 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am using _react-native-fs_ to read images that I retrieve with the ImagePicker of React Native.

I want to convert these images into Uint8Array (or Uint8ClampedArray even better), and for now I do it like this:

```
RNFS.readFile(result.uri, "base64").then(data => {
base64res = base64.parse(data); // -> Uint8Array
});
```

But, I want have a very fast code, so, is there a function like `readFile `or an option of `readFile` that **directly** return _Uint8Array_ ?

Thank you

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.