Added the ability to morph more than two images

Forgot to replace undefined variable

Removed extra space and added test

Swapped monochrome.png with original.png, it doesn't exist before running tests

Use Array.isArray() instead of instanceof Array

Update morph-more.js

Removed todo comment
master
Adam Snodgrass 11 years ago
parent d68d50ed0d
commit 03d1f4a60d
  1. 9
      lib/convenience/morph.js
  2. 14
      test/morph-more.js

@ -28,7 +28,14 @@ module.exports = function (proto) {
var self = this;
self.out(other, "-morph", 1);
if (Array.isArray(other)) {
other.forEach(function (img) {
self.out(img);
});
self.out("-morph", other.length);
} else {
self.out(other, "-morph", 1);
}
self.write(outname, function (err, stdout, stderr, cmd) {
if (err) return callback(err, stdout, stderr, cmd);

@ -0,0 +1,14 @@
var assert = require('assert')
module.exports = function (gm, dir, finish, GM) {
if (gm._options.imageMagick) return finish();
if (!GM.integration)
return finish();
gm
.morph([dir + '/morpher.jpg', dir + '/original.png'], dir + '/morphed2.jpg', function morph (err) {
finish(err);
});
}
Loading…
Cancel
Save