0.3.0 • Published 10 months ago

react-native-png-encoder v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

react-native-png-encoder

A simple React Native library for encoding RGB buffers into PNG files.

Installation

npm install react-native-png-encoder

yarn add react-native-png-encoder

Usage

Save an RGB buffer to an PNG file.

Saves an RGB buffer (array of color values) as a PNG file and returns the file path where the image is stored.

import { saveRgbAsPng } from 'react-native-png-encoder';

// ...

const savedFilePath = saveRgbAsPng(RGBBuffer);

// Do something with the returned file path

!NOTE You can use this function in conjunction with vision-camera-resize-plugin!

Clear the cache folder containing the previously saved PNG files.

Clears the cache folder by deleting previously saved PNG files and returns the count of deleted files.

import { deleteCacheFiles } from 'react-native-png-encoder';

// ...

const filesDeletedCount = deleteCacheFiles();

!NOTE I'd recommend on calling this function regularly (I.E. when the app becomes active), especially if you save a lot of data.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.0

10 months ago

0.2.1

10 months ago

0.2.0

11 months ago

0.2.0-beta.5

11 months ago

0.2.0-beta.4

11 months ago

0.2.0-beta.3

11 months ago

0.2.0-beta.2

11 months ago

0.2.0-beta.1

11 months ago

0.2.0-beta.0

11 months ago