mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 03:10:03 +01:00
Adds "Add QR" module (#736)
* Adds Add QR module * Grunt build changes * Rremoved copyPixels function and added test for QR module * Resolved test fail issues * Adds look same test * Change default to get from info.json
This commit is contained in:
committed by
Jeffrey Warren
parent
600ddece58
commit
6dd7738476
@@ -67,14 +67,15 @@ module.exports = function PixelManipulation(image, options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// perform any extra operations on the entire array:
|
||||
if (options.extraManipulation) pixels = options.extraManipulation(pixels);
|
||||
|
||||
var res;
|
||||
if (options.extraManipulation) res = options.extraManipulation(pixels,generateOutput);
|
||||
// there may be a more efficient means to encode an image object,
|
||||
// but node modules and their documentation are essentially arcane on this point
|
||||
var chunks = [];
|
||||
function generateOutput(){
|
||||
var chunks = [];
|
||||
var totalLength = 0;
|
||||
|
||||
var r = savePixels(pixels, options.format, { quality: 100 });
|
||||
|
||||
r.on("data", function(chunk) {
|
||||
@@ -89,5 +90,11 @@ module.exports = function PixelManipulation(image, options) {
|
||||
options.output(options.image, datauri, options.format);
|
||||
if (options.callback) options.callback();
|
||||
});
|
||||
}
|
||||
if(res){
|
||||
pixels=res;
|
||||
generateOutput();
|
||||
}
|
||||
else if(!options.extraManipulation) generateOutput();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user