我正在使用Image imagemagick,在我的文件中,我有多个图像名称,用逗号分隔,我的目标是,在我调整图像之后,我需要存储名称,这些名称由COMMAN in resai' res_image&#39问题是在停止迭代之间发生错误。任何人都可以帮助我。谢谢。
我的代码,
function imageResize(file){
file = file.split(',');
file.forEach(function(i,v){
i = i.split(',');
im.resize(
{
srcPath: config.uploadPath+i,
dstPath: config.blogsResizeUploadPath+'res_'+i,
width: 600
},function(err, stdout, stderr){
if (err) throw err;
}
);
res_image += ','+i;
})
}
错误:
convert: no images defined `./public/uploads/blogs_resized/res_' @ error/convert.c/ConvertImageCommand/3210.
at ChildProcess.<anonymous> (/var/www/html/dox/node_modules/imagemagick/imagemagick.js:88:15)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:493:12) timedOut: false, killed: false, code: 1, signal: null }
任何人都可以帮助我。谢谢。