Image response using Imagemagick


#1

Hi, I’m using imagemagick to resize and crop images,
I want to return the cropped image back to the client using the http request.

In a regular express app I would just do res.end(stdout, 'binary');
Where stdout is the binary result from imagemagick .resize method.

However, trying to return it using serverless does not seem to work.
How am I suppose to return the image back to the clients?

Thanks,
Matan


#2

Can this help? https://github.com/maciejtreder/serverless-apigw-binary

I’m not actually sure though, because it seems like that plugin is to deal with binary payloads (incoming requests), whereas you are talking about responding with a binary body.