mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-15 04:40:02 +01:00
LoadImages will return nothing, only call a callback
This commit is contained in:
@@ -10,11 +10,10 @@ require('../src/ImageSequencer.js');
|
||||
//require image files as DataURLs so they can be tested alike on browser and Node.
|
||||
var sequencer = ImageSequencer({ ui: false });
|
||||
|
||||
var image = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z";
|
||||
var test_png = require('../examples/test.png.js');
|
||||
var test_gif = require('../examples/test.gif.js');
|
||||
|
||||
sequencer.loadImages(image);
|
||||
sequencer.loadImages(test_png);
|
||||
sequencer.addSteps(['do-nothing-pix','invert','invert']);
|
||||
|
||||
test("Preload", function(t) {
|
||||
@@ -34,15 +33,19 @@ test("Twice inverted image is identical to original image", function (t) {
|
||||
});
|
||||
|
||||
test("PixelManipulation works for PNG images", function (t) {
|
||||
sequencer.loadImages(test_png).addSteps('invert').run(function(out){
|
||||
t.equal(1,1)
|
||||
t.end();
|
||||
sequencer.loadImages(test_png,function(){
|
||||
this.addSteps('invert').run(function(out){
|
||||
t.equal(1,1)
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test("PixelManipulation works for GIF images", function (t) {
|
||||
sequencer.loadImages(test_gif).addSteps('invert').run(function(out){
|
||||
t.equal(1,1)
|
||||
t.end();
|
||||
sequencer.loadImages(test_gif,function(){
|
||||
this.addSteps('invert').run(function(out){
|
||||
t.equal(1,1)
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user