title: NodeJs Failure: Expected params.Body to be a string, Buffer, Stream, Blob, or typed array object
body: <p>I am using GraphicsMagic to modify image. After drawing text on image I need to upload result image to s3 bucket. However I suspect toBuffer() is returning empty result because I am getting following error:</p>
  
  <blockquote>
    <p>Failure: Expected params.Body to be a string, Buffer, Stream, Blob, or typed array object</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code> s3.getObject({Bucket: srcBucket, Key: srcKey}).promise()
  .then(data =&gt; gm(data.Body)
    .fill('white')
    .stroke('black', 1)
    .drawText(0, -60, text.toUpperCase(), 'center')
    .toBuffer(imageType,function (err, buffer) {
      if (err) return handle(err);
      console.log('done!');
    })
  )
  .then(buffer =&gt; s3.putObject({
      Body: buffer,
      Bucket: dstBucket,
      ContentType: buffer.ContentType,
      Key: dstKey,
    }).promise()
  
  )
  .then(() =&gt; callback(null, {
    statusCode: 200,
    body: JSON.stringify({
      url: dstKey
    })
    })
  )
  .catch(err =&gt; callback(err))
  </code></pre>