here is my whole code:
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); } ;
});
I have also installed imageMagick. But when I run that simple code I get this silly error:
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)
I have also gone ahead into imageMagick website and download and install imageMagick.(ImageMagick-7.0.4-6-Q16-x64-dll.exe HTTP)
and this is my project structure: My project structure That is all! Would U please tell me where is the problem?