1
0
Fork 0

Fix type warning in emoji sprite sheet

This commit is contained in:
Cadence Ember 2024-09-10 12:40:17 +12:00
parent 23a7394ce7
commit 96fd046530

View file

@ -81,9 +81,10 @@ async function convertImageStream(streamIn, stopStream) {
giframe.feed(chunk) giframe.feed(chunk)
}) })
const frame = await giframe.getFrame() const frame = await giframe.getFrame()
const pixels = Uint8Array.from(frame.pixels)
stopStream() stopStream()
const buffer = await sharp(frame.pixels, {raw: {width: frame.width, height: frame.height, channels: 4}}) const buffer = await sharp(pixels, {raw: {width: frame.width, height: frame.height, channels: 4}})
.resize(SIZE, SIZE, {fit: "contain", background: {r: 0, g: 0, b: 0, alpha: 0}}) .resize(SIZE, SIZE, {fit: "contain", background: {r: 0, g: 0, b: 0, alpha: 0}})
.png({compressionLevel: 0}) .png({compressionLevel: 0})
.toBuffer({resolveWithObject: true}) .toBuffer({resolveWithObject: true})