1.0.1 • Published 1 year ago

react-native-pixel-jpg v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-pixel-jpg

npm version npm downloads npm licence Platform

Parse JPEG to ImageData for React Native.

Installation

$ npm install react-native-pixel-jpg

For RN >= 0.65, run npm install react-native-blob-util.

For RN < 0.65, run npm install react-native-blob-util@0.16.3, and patch manually to fix: with react-native-web product build will export 'URIUtil' (reexported as 'URIUtil') was not found.

var pixelJpeg= require('react-native-pixel-jpg');
console.log(pixelJpeg); //object

API

pixelJpg.parse(file) -> promise.then(images)

return images is Array contains one or more ImageData.

var file= 'https://59naga.github.io/fixtures/still.JPG';

pixelJpeg.parse(file).then(function(images){
  console.log(images[0]);
});
// {width: 256, height: 192, exifBuffer: [], data: <Uint8Array ..>}

Related projects

License

MIT