Coder Social home page Coder Social logo

zakzheng / react-native-local-barcode-recognizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cicistream/react-native-local-barcode-recognizer

0.0 1.0 0.0 933 KB

The barcode recognizer for local image.

License: MIT License

Java 0.59% JavaScript 0.01% Objective-C 98.73% Ruby 0.19% C 0.48%

react-native-local-barcode-recognizer's Introduction

###rn-local-qrdecode

*** Still under development.

##Install:

#install:
npm install rn-local-qrdecode

#and link:
react-native link rn-local-qrdecode

or you may install manually.

##Usage: Here is the demo (may check the examples folder of source code as well)

import ...

import LocalBarcodeRecognizer from 'rn-local-qrdecode';


const imageBase64 = "data:image/jpeg;base64,/9j/4AA.......";

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>React Native Local Barcode Recoginzer Demo</Text>
        <Text>Follow images to test:</Text>
        <Image source={{uri:imageBase64}} style={{width:width,height:width}}></Image>
          <Button onPress={()=>{
              this.recoginze();
          }} title={"Recognize"} />
      </View>
    );
  }

  recoginze = async ()=>{
	// Here is the demoe
     let result = await LocalBarcodeRecognizer.decode(imageBase64.replace("data:image/jpeg;base64,",""),{codeTypes:['ean13','qr']});
     alert(result);
  }

}
...
});

API

 let result = await LocalBarcodeRecognizer.decode(base64EncodeStringWithSchema,options);

Options

Only codeTypes supports currently Options:

name desc
codeTypes the codeFormat array, no default values,at last one of follow values needed: aztec ean13 ean8 qr pdf417 upc_e datamatrix code39 code93 interleaved2of5 codabar code128 maxicode rss14 rssexpanded upc_a upc_ean

react-native-local-barcode-recognizer's People

Contributors

cicistream avatar januslo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.