Unverified Commit d61b0761 authored by LongYinan's avatar LongYinan Committed by GitHub

Use sequentialRead while encoding images with sharp (#44881)

This can reduce memory usage and might improve performance on some systems.

Related: https://github.com/Brooooooklyn/Image/pull/34#issuecomment-1382182686
parent d4a3c664
......@@ -408,7 +408,9 @@ export async function optimizeImage({
let optimizedBuffer = buffer
if (sharp) {
// Begin sharp transformation logic
const transformer = sharp(buffer)
const transformer = sharp(buffer, {
sequentialRead: true,
})
transformer.rotate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment