Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/406.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript sharp aws lambda中调整图像大小的动态内容_Javascript_Node.js_Aws Lambda_Image Resizing_Sharp - Fatal编程技术网

Javascript sharp aws lambda中调整图像大小的动态内容

Javascript sharp aws lambda中调整图像大小的动态内容,javascript,node.js,aws-lambda,image-resizing,sharp,Javascript,Node.js,Aws Lambda,Image Resizing,Sharp,我正在使用sharp调整AWS Lambda上的图像大小。 它可以很好地进行测试,但问题是如何根据图像的内容类型给出动态内容类型 我的代码是 then(buffer => S3.putObject({ Body: buffer, Bucket: dstBucket, ContentType: 'image/jpeg', Key: dstKey, }).promise() ) 我希望此内容类型符合缓冲区内容类型

我正在使用
sharp
调整
AWS Lambda
上的图像大小。 它可以很好地进行测试,但问题是如何根据图像的内容类型给出动态内容类型

我的代码是

then(buffer => S3.putObject({
    Body: buffer,
    Bucket: dstBucket,
    ContentType: 'image/jpeg',
    Key: dstKey,
  }).promise()
)
我希望此内容类型符合缓冲区内容类型