我一直在尝试使用lambda中的image magick调整图像的大小。它适用于较小的图像。但是,如果图像尺寸较大,我将遇到错误
Error: Stream yields empty buffer
at Socket.<anonymous> (/var/task/node_modules/gm/lib/command.js:57:17)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
gm(response).command('convert')
.resize(_sizesArray[key].width,_sizesArray[key].width)
.gravity('Center')
.extent(_sizesArray[key].width,_sizesArray[key].width)
//.quality(50)
.toBuffer(
'JPG', function(err,
buffer)