This commit is contained in:
Chinmay Pandhare
2017-07-26 23:26:18 +05:30
21 changed files with 649 additions and 559 deletions

View File

@@ -1,23 +1,28 @@
/*
* Decodes QR from a given image.
*/
module.exports = function DoNothing(options) {
module.exports = function DoNothing(options,UI) {
options = options || {};
options.title = "Decode QR Code";
UI.onSetup();
var output;
var jsQR = require('jsqr');
var getPixels = require('get-pixels');
function draw(input,callback) {
var this_ = this;
UI.onDraw();
const step = this;
getPixels(input.src,function(err,pixels){
if(err) throw err;
var w = pixels.shape[0];
var h = pixels.shape[1];
var decoded = jsQR.decodeQRFromImage(pixels.data,w,h);
this_.output = input;
this_.output.data = decoded;
step.output = input;
step.output.data = decoded;
callback();
UI.onComplete(input.src);
});
}