这是我的全部代码:
var fs = require('fs')
, gm = require('gm');
// resize and remove EXIF profile data
gm('./image.jpg')
.resize(240, 240)
.noProfile()
.write('./image2.jpg', function (err) {
if (!err) { console.log('done') } else { console.log(err); } ;
});
我还安装了imageMagick。 但是,当我运行这个简单的代码时,我得到了这个愚蠢的错误:
Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "./image.jpg" "-resize" "240x240" "+profile" "\"*\"" "./image2.jpg" this most likely means the gm/convert binaries can't be found
at ChildProcess.<anonymous> (C:\Users\ali\Desktop\Node js\Uploader\node_modules\gm\lib\command.js:232:12)
at emitOne (events.js:96:13)
at ChildProcess.emit (events.js:188:7)
at ChildProcess.cp.emit (C:\Users\ali\Desktop\Node js\Uploader\node_modules\cross-spawn\lib\enoent.js:36:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
我已经进入imageMagick网站并下载并安装imageMagick。(ImageMagick-7.0.4-6-Q16-x64-dll.exe HTTP)
这是我的项目结构: My project structure 就这些!请你告诉我问题出在哪里?