1

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.

  • 1
    duplicate of https://stackoverflow.com/questions/35433249/graphicsmagick-tobuffer-stream-yields-empty-buffer . check if you find ur answer here – arunp9294 Oct 19 '19 at 21:38

0 Answers0