mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 11:20:02 +01:00
* change all old module benchmarks * no node 6 * add average module tests * edge-detect test added * edge detect tests * flip-image tests * tint tests * saturation tests * gradient tests * exposure tests * draw-rectangle tests * color-temperature tests * convolution tests * paint-bucket tests * ndvi tests * ndvi-colormap tests * histogram tests * crop tests * gamma-correction tests * dynamic tests * colorbar tests * webgl-distort tests * fisheye-gl tests * blend module tests * overlay module tests
29 lines
1.3 KiB
JavaScript
29 lines
1.3 KiB
JavaScript
'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(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.steps.slice(-1)[0].output.src);
|
|
sequencer.steps.splice(1,1);
|
|
sequencer.run({index: 1},function(out){
|
|
var output2 = DataURItoBuffer(sequencer.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();
|
|
})
|
|
});
|
|
});
|
|
}); |