【发布时间】:2020-09-26 04:51:55
【问题描述】:
var newImage = await sharp(originalBuffer).resize(newWidth, newHeight, {
fit: sharp.fit.inside,
withoutEnlargement: true
});
console.log(`after resize before to buffer ${typeof newImage} `, newImage)
// works on localhost mac but not on aws lambda
// https://github.com/lovell/sharp/issues/2085#issuecomment-587187740
newImage = await newImage.toBuffer();
错误是
Error: undefined Input buffer contains unsupported image format Error: Input buffer contains unsupported image format
使用express-fileupload 上传文件。不要认为它在这里相关。也试过multer
我研究了很多,还没有找到解决办法
【问题讨论】: