1

I am using Image imagemagick,in my file i have my multiple image names seperated by a comma and my aim is,AFTER I RESIZING THE IMAGE I NEED TO STORE THE NAMES AS SEPERATED BY COMMAN IN 'res_image'.The problem is an error is occured in between which is stoping the iteration.Can anyone please help me.Thanks.

My Code,

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; 
  })

}

Error:

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 }

Can anyone please help me.Thanks.

striker
  • 51
  • 1
  • 1
  • 5
  • Does this answer your question? [Trying to convert 200 jpg files to an mp4 w/ ImageMagick. Receiving the same error over and over again](https://stackoverflow.com/questions/31779009/trying-to-convert-200-jpg-files-to-an-mp4-w-imagemagick-receiving-the-same-err) – kenorb Jul 14 '20 at 16:05

0 Answers0