Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added composite functionality #20

Open
wants to merge 1 commit into from

2 participants

Philipp Klose Ian Babrou
Philipp Klose

Added composite functionality similar to the convert function.

Ian Babrou

I want to see that too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2011
  1. Philipp Klose
This page is out of date. Refresh to see the latest.
Showing with 26 additions and 0 deletions.
  1. +12 −0 README.md
  2. +14 −0 imagemagick.js
12 README.md
View
@@ -73,6 +73,18 @@ Example:
if (err) throw err
console.log('stdout:', stdout);
})
+
+### composite(args, callback(err, stdout, stderr))
+
+Raw interface to `composite` passing arguments in the array `args`.
+
+Example:
+
+ im.composite(['-watermark','30%','-gravity','SouthEast','watermark.png','input.png'],
+ function(err, metadata){
+ if (err) throw err
+ console.log('stdout:', stdout);
+ })
### resize(options, callback(err, stdout, stderr))
14 imagemagick.js
View
@@ -254,6 +254,20 @@ exports.convert = function(args, timeout, callback) {
}
exports.convert.path = 'convert';
+exports.composite = function(args, timeout, callback) {
+ var procopt = {encoding: 'binary'};
+ if (typeof timeout === 'function') {
+ callback = timeout;
+ timeout = 0;
+ } else if (typeof timeout !== 'number') {
+ timeout = 0;
+ }
+ if (timeout && (timeout = parseInt(timeout)) > 0 && !isNaN(timeout))
+ procopt.timeout = timeout;
+ return exec2(exports.composite.path, args, procopt, callback);
+}
+exports.composite.path = 'composite';
+
var resizeCall = function(t, callback) {
var proc = exports.convert(t.args, t.opt.timeout, callback);
if (t.opt.srcPath.match(/-$/)) {
Something went wrong with that request. Please try again.