New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flatten support #53

Merged
merged 1 commit into from Apr 11, 2012
Jump to file or symbol
Failed to load files and symbols.
+29 −0
Diff settings

Always

Just for now

Added flatten support

Includes a layered PSD, example and test.
  • Loading branch information...
jwarchol committed Apr 3, 2012
commit 16a17518c6fdcb41ab31786fa5504ddb553d2966
View
@@ -0,0 +1,12 @@
// gm - Copyright Aaron Heckmann <aaron.heckmann+github@gmail.com> (MIT Licensed)
var gm = require('../')
, dir = __dirname + '/imgs'
gm(dir + '/layers.psd')
.flatten()
.write(dir + "/unlayered.jpg", function(err){
if (err) return console.dir(arguments)
console.log(this.outname + " created :: " + arguments[3])
}
)
View
Binary file not shown.
View
@@ -386,6 +386,11 @@ module.exports = function (proto) {
, "South"
, "SouthEast"
];
// http://www.graphicsmagick.org/GraphicsMagick.html#details-flatten
proto.flatten = function flatten () {
return this.out("-flatten");
}
};
/**
View
@@ -0,0 +1,12 @@
var assert = require('assert')
module.exports = function (img, dir, finish, gm) {
var changed = gm('whatever.png').gravity("Souths")
assert.equal(changed._out[1], 'NorthWest');
gm(dir + '/layers.psd')
.flatten()
.write(dir + '/unlayered.jpg', function (err) {
finish(err);
});
}
ProTip! Use n and p to navigate between commits in a pull request.