mirror of https://gitgud.io/fatchan/gm
parent
2fb65bac7c
commit
9efaf3277c
4 changed files with 65 additions and 0 deletions
@ -0,0 +1,27 @@ |
||||
// montage
|
||||
|
||||
var exec = require('child_process').exec; |
||||
var utils = require('./utils'); |
||||
|
||||
/** |
||||
* Montage images next to each other using the `montage` command in graphicsmagick. |
||||
* |
||||
* gm('/path/to/image.jpg') |
||||
* .montage('/path/to/second_image.jpg') |
||||
* .geometry('+100+150') |
||||
* .write('/path/to/montage.png', function(err) { |
||||
* if(!err) console.log("Written montage image."); |
||||
* }); |
||||
* |
||||
* @param {String} other Path to the image that contains the changes. |
||||
*/ |
||||
|
||||
module.exports = exports = function(proto) { |
||||
proto.montage = function(other) { |
||||
this.in(other); |
||||
|
||||
this.subCommand("montage"); |
||||
|
||||
return this; |
||||
} |
||||
} |
@ -0,0 +1,20 @@ |
||||
|
||||
var assert = require('assert') |
||||
|
||||
module.exports = function (gm, dir, finish, GM) { |
||||
gm.source = __dirname + '/fixtures/compare_1.png'; |
||||
var a = gm.montage(__dirname + '/fixtures/favicon.png') |
||||
|
||||
var args = a.args(); |
||||
assert.equal('montage', args[0]); |
||||
assert.equal(__dirname + '/fixtures/favicon.png', args[1]); |
||||
assert.equal(__dirname + '/fixtures/compare_1.png', args[2]); |
||||
|
||||
if (!GM.integration) |
||||
return finish(); |
||||
|
||||
a
|
||||
.write(dir + '/montage.png', function(err) { |
||||
finish(err); |
||||
}); |
||||
} |
Loading…
Reference in new issue