mirror of https://gitgud.io/fatchan/gm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
595 B
31 lines
595 B
var assert = require('assert')
|
|
|
|
module.exports = function (img, dir, finish, gm) {
|
|
var changed = gm('whatever.png').gravity("Souths")
|
|
assert.equal(changed._out[1], 'NorthWest');
|
|
|
|
var m = img
|
|
.scale(200, 100)
|
|
.gravity("South")
|
|
.extent(300,300);
|
|
|
|
var args = m.args();
|
|
assert.equal('convert', args[0]);
|
|
args= args.slice(2);
|
|
assert.deepEqual(args, [
|
|
'-scale',
|
|
'200x100',
|
|
'-gravity',
|
|
'South',
|
|
'-extent',
|
|
'300x300',
|
|
'-' ])
|
|
|
|
if (!gm.integration)
|
|
return finish();
|
|
|
|
m
|
|
.write(dir + '/gravity.png', function resize (err) {
|
|
finish(err);
|
|
});
|
|
}
|
|
|