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)
When using
the actual underlying error is swallowed and we only get an opaque:
Error: Stream yields empty buffer
.Example: When removing
imageMagick
, i.e. bywe should get the following error: (tested using
.write(fileImg, (error) => {
):but with
.toBuffer('png', function (error, buffer) {
we only get