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

function conversion(image) {
   const image = gm(image);
   image.orientation(function(err, value) {
            if (err) {
                 console.log("Error Occurred :",err);
              }
}

访问 image.orientation 时,这是发生的错误。

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:786:11)
    at Socket._write (net.js:798:8)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Socket.Writable.write (_stream_writable.js:318:11)
    at gm._spawn (/var/task/node_modules/gm/lib/command.js:253:18)
    at gm._exec (/var/task/node_modules/gm/lib/command.js:190:17)
    at gm.proto.<computed> [as orientation] (/var/task/node_modules/gm/lib/getters.js:68:12) {
  errno: 'EPIPE',
  code: 'EPIPE',
  syscall: 'write'
}

这些是我已经执行的一些步骤。

  1. 我已经尝试安装 imagemagick 和 graphicsmagick。https://www.npmjs.com/package/gm

  2. 还有建议重新安装 imagemagick 和 graphicsmagick 并在重新启动系统后进行测试。它也没有用

  3. 我正在使用 Ubuntu,npm gm 版本:“^1.23.1”,节点版本:nodejs12.x

4

0 回答 0