【问题标题】:Node.js GraphicsMagick not working ( Invalid Parameter - -resize)Node.js GraphicsMagick 不工作(无效参数 - -resize)
【发布时间】:2018-04-29 00:12:39
【问题描述】:

我正在尝试使用Graphics Magick 调整图像大小。我已经安装了最新的GrapchicsMagickImageMagick 版本。我已经安装了

 npm install gm
 npm install im

也是。 我的 node.js 代码是:

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

  var srcPath = __dirname + '\\' + userId + '.jpg';
  var dstPath = __dirname + '\\' + userId + '-thumbnail.jpg';

  gm(srcPath)
  .resize(100, 100)
  .noProfile()
  .write(dstPath, function (err) {
    if (!err) console.log('Image resized');
    else console.log(err);
  });

我收到此错误:

 Error: Command failed: Invalid Parameter - -resize

我使用的是 Windows 10,我也安装了 .exe 和 npm。

【问题讨论】:

  • 你用的是哪个操作系统?
  • 我认为你应该从网站而不是从 npm 安装 im。
  • 我使用的是 Windows 10
  • 尝试从这个网站安装:imagemagick.org/script/download.php

标签: javascript node.js imagemagick imagemagick-convert graphicsmagick


【解决方案1】:

我的问题解决了。我必须将 identify.exe 复制到我的应用文件夹中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-02
    • 1970-01-01
    • 1970-01-01
    • 2019-07-19
    • 2014-11-09
    • 2021-08-25
    相关资源
    最近更新 更多