I have a Nodejs program that used GM (FILE_PATH). Size () to get picture size has been unsuccessful, tossing all day, because the document is less, and are not very correct, finally to the research out;
In Linux, GM can easily get pictures such as the size of the picture operation, but the use of GM need to install GraphicsMagick or ImageMagick, the following is my test GraphicsMagick installation method
1. Installation GraphicsMagick
CD/ALIDATA/SRC
wget http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.18/ Graphicsmagick-1.3.18.tar.bz2/download
tar jxvf graphicsmagick-1.3.18.tar.bz2
CD GraphicsMagick-1.3.18
./configure–prefix=/usr/local/graphicsmagick-1.3.18 make make
install
2. Modify Environment variables:
Vim/etc/profile
Add the following string
gm_home=/usr/local/graphicsmagick-1.3.18;
Path= $GM _home/bin: $PATH;
Export PATH
Export Gm_home
Execute command source/etc/profile to take effect
3, testing
GM version can output success on behalf of GM normal