Looking for imagemagick nodejs npm?

I have been using node-imagemagick for several days and realized that it has errors.

There are about 100 of his forks, some of which correct some of the problems that I have encountered, but it is difficult to determine which fork I should use.

+7
source share
2 answers

I decided to use the gm node module in one of my projects. It works very well.

See: http://aheckmann.github.com/gm/

This is basically a wrapper around imageMagick or graphic masks .

Here is a simple example:

var gm = require('gm'); gm('/path/to/image.jpg') .resize(353, 257) .autoOrient() .write(writeStream, function (err) { if (!err) console.log(' hooray! '); }); 
+15
source

I was once in your place, and after I was really disappointed with modules with errors or strange APIs, I started using imagemagic directly, creating a child process. Node.js is pretty good at this, so it's actually not that difficult.

 var spawn = require('child_process').spawn; var args = ['-ping', 'tree.gif' ]; var composite = spawn('identify', args); 

This is also great because you can just use the graphical documentation.

+22
source

All Articles