Fix for Issue9 : Error while adding a new step from HTML UI, A small fix for #7 (#16)

* Fix : add a step in the demo

* Change global variable to document.sequencer_image

* Change global variable to document.sequencer_image

* Small fix for FireFox; Ref: Issue #7

* Change document.sequencer_image to options.image

* Change document.sequencer_image to options.initial_image

* Completed the addStep issue.

* Completed the addStep issue.

* Change options.initial_image to options.initialImage

* Added Crop Module

* lowercase parameters

* Merging Crop.js

* Merging Crop.js

* Merging Crop.js
This commit is contained in:
Chinmay Pandhare (CCD)
2017-03-15 02:03:55 +05:30
committed by Jeffrey Warren
parent bf4a264ed9
commit 38a569b958
4 changed files with 15 additions and 7 deletions

View File

@@ -184197,6 +184197,9 @@ ImageSequencer = function ImageSequencer(options) {
if (previousStep) {
// connect output of last step to input of this step
previousStep.options.output = function output(image) {
if (sequencer.steps[0].options.initialImage) {
options.initialImage = sequencer.steps[0].options.initialImage;
}
log('running module "' + name + '"');
// display the image in any available ui
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
@@ -184235,6 +184238,7 @@ ImageSequencer = function ImageSequencer(options) {
image.onload = function() {
run(image);
if (callback) callback(image);
options.initialImage = image;
}
image.src = src;
}
@@ -184443,8 +184447,8 @@ module.exports = function ImageSelect(options) {
// we should trigger "load" event here
image = new Image();
image.src = event.target.result;
image.src = e.target.result;
options.initialImage = image;
el.html(image); // may be redundant
// this is done once per image:
@@ -184470,6 +184474,7 @@ module.exports = function ImageSelect(options) {
// this module is unique because it creates the image
function draw(image) {
el.html(image);
options.initialImage = image;
if (options.output) options.output(image);
}

View File

@@ -73,10 +73,9 @@
//sequencer.addStep('plot');
$('.add-step').click(function(e) {
e.preventDefault();
sequencer.addStep($('.select-module').val());
sequencer.run(); // later we might only run this step, if we can fetch the image output from the previous
sequencer.run(sequencer.options.initialImage); // later we might only run this step, if we can fetch the image output from the previous
});

View File

@@ -51,6 +51,9 @@ ImageSequencer = function ImageSequencer(options) {
if (previousStep) {
// connect output of last step to input of this step
previousStep.options.output = function output(image) {
if (sequencer.steps[0].options.initialImage) {
options.initialImage = sequencer.steps[0].options.initialImage;
}
log('running module "' + name + '"');
// display the image in any available ui
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
@@ -83,12 +86,12 @@ ImageSequencer = function ImageSequencer(options) {
// load default starting image
// i.e. from parameter
// this could send the image to ImageSelect, or something?
// not currently working
function loadImage(src, callback) {
image = new Image();
image.onload = function() {
run(image);
if (callback) callback(image);
options.initialImage = image;
}
image.src = src;
}

View File

@@ -41,8 +41,8 @@ module.exports = function ImageSelect(options) {
// we should trigger "load" event here
image = new Image();
image.src = event.target.result;
image.src = e.target.result;
options.initialImage = image;
el.html(image); // may be redundant
// this is done once per image:
@@ -68,6 +68,7 @@ module.exports = function ImageSelect(options) {
// this module is unique because it creates the image
function draw(image) {
el.html(image);
options.initialImage = image;
if (options.output) options.output(image);
}