aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.95k stars 615 forks source link

Issue/Question: Command failed: convert.im6: delegate failed html2ps + no image defined #644

Open sebastienratez opened 7 years ago

sebastienratez commented 7 years ago

Hey guys,

I'm not too sure what's happening here. I'm running imagemagick through the npn gm module in nodejs (v6)


var gm = require('gm').subClass({
  imageMagick: true
});
var fs = require('fs');

var file = "/absolutepath/dis.png";
var targetFile = "/absolutepath/300px-dis.png";

if (!fs.existsSync(file)) console.log("WARNING:  FILE DOES NOT EXIST");
gm(file).resize(300).write(targetFile, function(err) {
              if (err) {
                console.log("[KO - RESIZE 300]", err);
                return callback(err);
              }
});

The command fails with the following error message:

    [KO - RESIZE 300] Error: Command failed: convert.im6: delegate failed `\"html2ps\" -U -o \"%o\" \"%i\"' @ error/delegate.c/InvokeDelegate/1065.,
    convert.im6: unable to open image `/tmp/magick-dEhsHcmz': No such file or directory @ error/blob.c/OpenBlob/2641.,
    convert.im6: unable to open file `/tmp/magick-dEhsHcmz': No such file or directory @ error/constitute.c/ReadImage/583.,
    convert.im6: no images defined `/absolutepath/300px-dis.png' @ error/convert.c/ConvertImageCommand/3044.,,
    at ChildProcess.onExit (/nodejsAction/node_modules/gm/lib/command.js:301:17),

What troubles me is that I'm pretty sure this code used to work a while ago. A guy refactored part of this method but I don't think he altered the gm-related logic... Then again, I'm running it on bluemix OpenWhisk so it's perfectly possible that the have made an update on the provided gm package that would be initiating this problem.

I really don't have a clue where and how to proceed so I was wondering if you could point me out to the right direction.

Thx

tojuasp commented 7 years ago

Are you trying to use this together with the Dark vision sample code? I got this error when I had conflict between where the actual image was stored and where I tried to download it from. I had written the code to retrieve the image from object storage but in was in reality embedded in the cloudant document.