mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-13 11:50:02 +01:00
BuildFix
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user