forked from jywarren/image-sequencer
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes #269 Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update demo Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * refactor and comments Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update readme Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * updated and refactored Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update readme Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * trying to fix tests Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update documentation Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update to config.mode = test Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * finaly everything works Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * 1.8.0 * update test Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add test for run Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
- Loading branch information
Showing
13 changed files
with
118 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
var test = require('tape'); | ||
var DataURItoBuffer = require('data-uri-to-buffer'); | ||
|
||
require('../../src/ImageSequencer.js'); | ||
|
||
var sequencer = ImageSequencer({ ui: false }); | ||
var red = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z"; | ||
|
||
sequencer.loadImages('image1', red); | ||
sequencer.addSteps('invert'); | ||
sequencer.addSteps('invert'); | ||
sequencer.addSteps('invert'); | ||
|
||
test('run() works with all possible argument combinations',function(t){ | ||
sequencer.run(function (out) { | ||
var output1 = DataURItoBuffer(sequencer.images.image1.steps.slice(-1)[0].output.src); | ||
sequencer.images.image1.steps.splice(1,1); | ||
sequencer.run({index: 1},function(out){ | ||
var output2 = DataURItoBuffer(sequencer.images.image1.steps.slice(-1)[0].output.src); | ||
t.deepEqual(output1,output2,"output remains same after removing a step and running sequencer from a greater index"); | ||
sequencer.run(function(out){ | ||
t.end(); | ||
}) | ||
}); | ||
}); | ||
}); |