mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 12:19:58 +01:00
* redid import-image and fix ExportBin fixes #899 Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * 3.0.1 * bypass import-image Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
21ff486618
commit
cb53efbe21
@@ -9,10 +9,9 @@
|
||||
module.exports = function ImportImageModule(options, UI) {
|
||||
|
||||
var defaults = require('./../../util/getDefaults.js')(require('./info.json'));
|
||||
options.imageUrl = options.url || defaults.url;
|
||||
options.imageUrl = options.inBrowser ? (options.url || defaults.url) : "./examples/images/monarch.png";
|
||||
|
||||
var output,
|
||||
imgObj = new Image();
|
||||
var output;
|
||||
|
||||
// we should get UI to return the image thumbnail so we can attach our own UI extensions
|
||||
|
||||
@@ -27,32 +26,17 @@ module.exports = function ImportImageModule(options, UI) {
|
||||
|
||||
var step = this;
|
||||
|
||||
if (!options.inBrowser) { // This module is only for browser
|
||||
this.output = input;
|
||||
step.metadata = step.metadata || {};
|
||||
// TODO: develop a standard API method for saving each input state,
|
||||
// for reference in future steps (for blending, for example)
|
||||
step.metadata.input = input;
|
||||
// options.format = require('../../util/GetFormat')(options.imageUrl);
|
||||
|
||||
var helper = ImageSequencer({ inBrowser: options.inBrowser, ui: false });
|
||||
helper.loadImages(options.imageUrl, () => {
|
||||
step.output = helper.steps[0].output;
|
||||
callback();
|
||||
} else {
|
||||
step.metadata = step.metadata || {};
|
||||
// TODO: develop a standard API method for saving each input state,
|
||||
// for reference in future steps (for blending, for example)
|
||||
step.metadata.input = input;
|
||||
|
||||
function onLoad() {
|
||||
|
||||
// This output is accessible to Image Sequencer
|
||||
step.output = {
|
||||
src: imgObj.src,
|
||||
format: options.format
|
||||
}
|
||||
|
||||
// Tell Image Sequencer that step has been drawn
|
||||
callback();
|
||||
}
|
||||
|
||||
options.format = require('../../util/GetFormat')(options.imageUrl);
|
||||
imgObj.onload = onLoad;
|
||||
imgObj.src = options.imageUrl;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user