Git Product home page Git Product logo

barcodereader_js's Introduction

Barcode Reader for JS

BarcodeReader | Githubを少し改変して少し使いやすくしました。

Getting Started

ターミナルを起動して適当なディレクトリに移動、以下のコマンド打ってローカルサーバー上でデバッグする。
PHPで開発するならローカルサーバーが起動しているので特に気にすることはないです。

 $ git clone https://github.com/TanisukeGoro/BarcodeReader_JS.git
 $ cd BarcodeReader_JS
 $ python -m http.server 8000
 # if your python version is 2.x ... 
 $ python -m SimpleHTTPServer 8000 

注意点

webworkerを使用しているのでlocalhostを起動しないとうまく動作しません。

また、ディレクトリ構成を変更する際にはJOB.jsを変更する必要があります。 JOB.js45行目DecodeWorker.js54行目exif.jsを適当なものに変更します。

// 適当なディレクトリを指定
DecoderWorker: new Worker("./barcode-reader/DecoderWorker.js"),

    OrientationCallback: null,
    // Always call the Init().
    Init: function() {
        JOB.ScanCanvas = JOB.FixCanvas(document.createElement("canvas"));
        JOB.ScanCanvas.width = 640;
        JOB.ScanCanvas.height = 480;
        JOB.ScanContext = JOB.ScanCanvas.getContext("2d");
        var script = document.createElement('script');

        // 適当なディレクトリを指定
        script.src = "./barcode-reader/exif.js";
        script.type = 'text/javascript';
        document.getElementsByTagName('head').item(0).appendChild(script);
    },

barcodereader_js's People

Contributors

tanisukegoro 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.