I am using sharp
to resize images on AWS Lambda
.
It works fine for testing but the issue is that how to give dynamic content type according to the content type of image.
My code is
then(buffer => S3.putObject({
Body: buffer,
Bucket: dstBucket,
ContentType: 'image/jpeg',
Key: dstKey,
}).promise()
)
I want this contentType is according to buffer content Type.