带有nodejs的imagemagick无法正常工作 [英] imagemagick with nodejs not working
本文介绍了带有nodejs的imagemagick无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用node-imagemagick库调整图像的大小,但无法正常工作.
I am trying to resize an image with node-imagemagick library, but it is not working.
我用来调整大小的代码是
the code i am using to resize is
im.resize({
srcPath: __dirname+'originalimage.jpg',
dstPath: __dirname+'resized.jpg',
width: 50
}, function(err, stdout, stderr){
if (err) throw err;
});
它引发错误
Error: Command failed: Invalid Parameter - -set
at ChildProcess.<anonymous> (E:\NodeJsDevelopment\node_modules\imagemagick\imagemagick.js:64:15)
at ChildProcess.EventEmitter.emit (events.js:91:17)
at Process._handle.onexit (child_process.js:674:10)
推荐答案
在Windows上,您还需要安装imagemagick exe. nodejs imagemagick库只是imagemagick exe的包装器.因此,只有安装了imagemagick exe并转换并标识可执行文件在路径中后,它才能起作用.
On windows you also need to install the imagemagick exe. The nodejs imagemagick library is just a wrapper for imagemagick exe. So it will not work untill the imagemagick exe is intalled and convert and identify executable are in path.
这篇关于带有nodejs的imagemagick无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文