Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toBuffer silently swallows stderr #854

Open
Bersaelor opened this issue Mar 11, 2023 · 0 comments
Open

toBuffer silently swallows stderr #854

Bersaelor opened this issue Mar 11, 2023 · 0 comments

Comments

@Bersaelor
Copy link

When using

        .toBuffer('png', function (error, buffer) {

the actual underlying error is swallowed and we only get an opaque: Error: Stream yields empty buffer.

Example:
When removing imageMagick, i.e. by

const gm = require('gm') // .subClass({ imageMagick: '7+' });

we should get the following error: (tested using .write(fileImg, (error) => {):

	ERROR	Error:  Error: Could not execute GraphicsMagick/ImageMagick: gm "convert" "./background-U3OTKXWN.png" ... "/tmp/output.png" this most likely means the gm/convert binaries can't be found
    at ChildProcess.<anonymous> (/var/task/lambda.js:24:2752)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

but with .toBuffer('png', function (error, buffer) { we only get

Error: Stream yields empty buffer
    at Socket.<anonymous> (/var/task/lambda.js:24:1101)
    at Socket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant