mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
Update README, Merge Master
This commit is contained in:
@@ -68,8 +68,13 @@ a name and an image. The method also accepts an optional callback.
|
||||
```js
|
||||
sequencer.loadImage(image_src,optional_callback);
|
||||
```
|
||||
On `Node.js` the `image_src` may be a DataURI or a local path. On browsers, it
|
||||
must be a DatURI (or 'selector to image' -- Work in Progress)
|
||||
On `Node.js` the `image_src` may be a DataURI or a local path.
|
||||
|
||||
On browsers, it may be a DatURI, a local image or a URL (Unless this violates
|
||||
CORS Restrictions). To sum up, these are accepted:
|
||||
* Images in the same domain (or directory - for a local implementation)
|
||||
* CORS-Proof images in another domain.
|
||||
* DataURLs
|
||||
|
||||
return value: **`sequencer`** (To allow method chaining)
|
||||
|
||||
|
||||
BIN
examples/test.gif
Normal file
BIN
examples/test.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
1
examples/test.gif.js
Normal file
1
examples/test.gif.js
Normal file
File diff suppressed because one or more lines are too long
1
examples/test.png.js
Normal file
1
examples/test.png.js
Normal file
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
||||
"name": "image-sequencer",
|
||||
"version": "0.0.1",
|
||||
"description": "A modular JavaScript image manipulation library modeled on a storyboard.",
|
||||
"main": "dist/image-sequencer.js",
|
||||
"main": "src/ImageSequencer.js",
|
||||
"scripts": {
|
||||
"test": "tape test/*.js | tap-spec; browserify test/image-sequencer.js test/chain.js | tape-run --render=\"tap-spec\""
|
||||
},
|
||||
|
||||
@@ -7,10 +7,14 @@ var test = require('tape');
|
||||
|
||||
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/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEX+AAD///+KQee0AAAAAWJLR0QB/wIt3gAAAAd0SU1FB+EGHRIVAvrm6EMAAAAMSURBVAjXY2AgDQAAADAAAceqhY4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTctMDYtMjlUMTg6MjE6MDIrMDI6MDDGD83DAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE3LTA2LTI5VDE4OjIxOjAyKzAyOjAwt1J1fwAAAABJRU5ErkJggg==";
|
||||
sequencer.loadImages(image);
|
||||
|
||||
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.addSteps(['do-nothing-pix','invert','invert']);
|
||||
|
||||
test("Preload", function(t) {
|
||||
@@ -28,3 +32,17 @@ test("Twice inverted image is identical to original image", function (t) {
|
||||
t.equal(sequencer.images.image1.steps[1].output.src, sequencer.images.image1.steps[3].output.src);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test("PixelManipulation works for PNG images", function (t) {
|
||||
sequencer.loadImages(test_png).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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user