From 5a00ec24067767418db2a5a3202c9440f2c50e59 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Fri, 9 Feb 2024 17:28:16 +0100 Subject: [PATCH] Fix bird avatar generation. --- build-avatars.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-avatars.js b/build-avatars.js index 9ec33356..4eb3e8bc 100755 --- a/build-avatars.js +++ b/build-avatars.js @@ -126,19 +126,20 @@ const path = require('node:path') continue } - const bodyFile = computeFilename('body', i) + const firstPart = Object.keys(parts)[0] + const firstFile = computeFilename(firstPart, i) // We just have to combinate different parts into one file, then output at the wanted size. const composites = [] let j = 0 - for (const part of Object.keys(parts).filter(p => p !== 'body')) { + for (const part of Object.keys(parts).filter(p => p !== firstPart)) { j++ // introduce an offset so we don't get all empty parts at the same time composites.push({ input: computeFilename(part, i + (j * 7)) }) } - const buff = await sharp(bodyFile) + const buff = await sharp(firstFile) .composite(composites) .toBuffer()