Skip to content

sameervitian/magickwand

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magickwand

magickwand is the native port of imagemagick/convert.

Most other ports of imagemagick invoke the convert binary, instead of making direct API calls. While this works, API calls would be faster than invoking convert, and that is the motivation for this module.

Example

var magickwand = require('magickwand');
var fs = require('fs');

magickwand.resize('<pathtoimagefile>',newWidth,newHeight,function(err,data) {
  fs.writeFile('/tmp/def.jpg',data,"binary");
});

To maintain aspect ratio while resizing, set one of the width/height parameters to 0.

magickwand.resize('<pathtoimagefile>',newWidth,0,function(err,data) {
  fs.writeFile('/tmp/def.jpg',data,"binary");
});

See examples/cdn.js on how to use this module as a middleware in connect.

Requirements

I have tested this on Linux and MacOS.

On MacOS - make sure you have disabled openmp while building Imagemagick. Otherwise, imagemagick will hang the node process. If you use homebrew, use the --disable-openmp option while installing imagemagick.

Installation

TODO: Publish this as an npm module

$ npm install magickwand

Source Install / Manual Compilation

TODO

About

native port of imagemagick

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 63.6%
  • JavaScript 20.5%
  • Python 15.9%