I did some tests with 10 MB images and noticed that the function transformToByteArray takes 0.5 seconds to 1 second to convert the image stream to a buffer. Sharp supports streams, could we try compressing images without turning them into buffers?
|
originalImageBody = getOriginalImageCommandOutput.Body.transformToByteArray(); |
I did some tests with 10 MB images and noticed that the function
transformToByteArraytakes 0.5 seconds to 1 second to convert the image stream to a buffer. Sharp supports streams, could we try compressing images without turning them into buffers?image-optimization/functions/image-processing/index.mjs
Line 36 in 259f680