Missing image filename ImageMagick convert running from Node.js only -


i built little script first montage 8 tiles together, scale down , has distort image.

everything goes according plan until distorting part.

this.distort = function(filename) {   var distortdeferred = q.defer();    var totalwidth = width * waves * 2,       totalheight = height * waves * 2;    var params = [     filename,     '-matte',     '-virtual-pixel',     'transparent',     '-distort',     'perspective "{left},{top} {newleft},{top}   {left},{bottom} {left},{bottom}   {right},{bottom} {right},{bottom}    {right},{top} {newright},{top}"'.assign({       left: 0,       top: 0,       newleft: totalwidth * distortpercentage,       bottom: totalheight,       right: totalwidth,       newright: totalwidth - totalwidth * distortpercentage     }),     filename   ];    im.convert(params, function() {     console.log(arguments);   });    return distortdeferred.promise; }; 

this following function wil give error:

error: command failed: convert: missing image filename `tmp/5458f2e3d6840bb65ba6100f.png' @ error/convert.c/convertimagecommand/3184. 

running exact same operation on command line, have desired output.

possible mistakes have made , have tested:

  • two image converts, converting image @ same time
  • non existing image
  • file rights image not set correctly
  • missing plugins imagemagick

two image converts, converting image @ same time

everything done deferreds , promises, it's not possible 2 requests run @ same time, sure set 2000ms timeout before distort function called. no help.

non existing image

tested sure fs.fileexists. result expected.

file rights image not set correctly

to safe tried chmod -r 777 folder on folder. result expected.

missing plugins imagemagick

after googling came across people didn't have appropriate plugins installed , received same error me.

apparently had either jpeg library missing or png, see error here.

so after running identify -list format, apparent have appropriate libraries installed complete operation this.

synopsis

i think error found in node instead of imagemagick, because operation runs command line without problem.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -