gm icon indicating copy to clipboard operation
gm copied to clipboard

"Error: Stream yields empty buffer" when using dissolve()

Open PassTheMayo opened this issue 6 years ago • 4 comments

Hello. I just recently started using Graphics Magick. I installed using npm i gm and did the sudo apt-get install graphics-magick command, and it works fine. Every method seems to work except dissolve(). Here's my code:

gm(body.body).dissolve(50).toBuffer((error, buffer) => {
    if (error) return console.error(error);
    // do stuff
});

I am getting the following error:

Error: Stream yields empty buffer
  at Socket.<anonymous> (/root/bots/prisma/node_modules/gm/lib/command.js:57:17)
  at emitNone (events.js:110:20)
  at Socket.emit (events.js:207:7)
  at endReadableNT (_stream_readable.js:1059:12)
  at _combinedTickCallback (internal/process/next_tick.js:138:11)
  at process._tickCallback (internal/process/next_tick.js:180:9)

Can anyone help?

PassTheMayo avatar Aug 29 '17 23:08 PassTheMayo

+1

albertyou2 avatar Oct 12 '17 03:10 albertyou2

same here after using .autoOrient()

luck2011 avatar Oct 30 '17 02:10 luck2011

+1 help

luyufa avatar May 31 '18 08:05 luyufa

1+ help from here. After include <?xml><svg></svg>, I'm getting Stream yields empty buffer. Any thoughts, how convert svg to buffer with node/gm?

sharstream avatar Mar 10 '19 22:03 sharstream