Open anhnch opened 2 years ago
You should decode the base64 string from react-native-fs into a typed array or ArrayBuffer before passing it to this library. This library may work for you: https://github.com/superhuman/fast64
Alternatively, use a filesystem library that allows for reading files into typed arrays or ArrayBuffers.
I would use this JSI lib instead:
Hi, I'm trying to use mozjpeg-js in react native, but I face an issue. React Native doesn't run on node, it doesn't have fs. I have to use an alternative react-native-fs. When reading file, react-native-fs doesn't return binary buffer. It returns a string.
Are there anyway to fix this? Please have a look