I used GraphicsMagick for node but got the error "Stream yields empty buffer"
import gm from 'gm';
gm(buffer).resize(200, 200).setFormat('jpeg') .toBuffer( function (err, buf) {
const data = {
Key: imagePath,
Body: buf,
ContentEncoding: 'base64',
ContentType: 'image/jpeg',
};
...
some code to upload to AWS S3
});
This is my docker config
FROM node:10.16-alpine
RUN apk add --no-cache bash graphicsmagick
I expected to have the buffer after used gm and push file to AWS S3. Would anyone can help me solved this issue? Thank you so much.