UNPKG

781 BMarkdownView Raw
1
2# react-native-img-to-base64
3
4This repo is a working rewrite of [this](https://github.com/xfumihiro/react-native-image-to-base64) abandonned library.
5It provides a very simple way to convert an image to a base64 string.
6
7If you encounter `OOM` errors on old android devices, make sure you optimize the image's size before you convert it.
8Indeed working with big images on Android might cause very high memory usage.
9
10## Getting started
11
12`npm install react-native-image-base64 --save`
13or
14`yarn add react-native-image-base64`
15
16
17## Installation
18
19`$ react-native link react-native-image-base64`
20
21## Usage
22```javascript
23import ImgToBase64 from 'react-native-image-base64';
24
25ImgToBase64.getBase64String('file://youfileurl', (err, base64string) => doSomethingWith(base64string));
26```
27
\No newline at end of file