GraphicsMagick for node.js, this is a powerful framework. It's based on many different frameworks, so, that first and hardest one we need to do, is to install it.
1. Download Command tools for MacOS, if you don't have gcc compiler
1. ./configure
2. make && sudo make install
1. ./configure
2. make && sudo make install
(*NOTE*, I got Undefined symbols for architecture x86_64 because I didn't add CC=clang, and cause lots of time, if you got the same problem, please remember to add it)
After run the configure, it'll show the result for it, you'll need these two as yes.
JPEG v1 --with-jpeg=yes yes(Need to install jpeg delegate library)
PNG --with-png=yes yes(Need to install png delegate library)
2. make && sudo make install
5. In node.js, put the following code :
var gm = require('gm');
gm('image.jpg').size(function(err, value){
if(err) return;
console.log(value);
}
If you still get any problems or found something wrong in this post, please feel free to tell me. :)
Reference :
https://github.com/rsms/node-imagemagick
http://aheckmann.github.com/gm