From 96634a7e9ed8f3f7aae1b651d954fa1fc831a0c2 Mon Sep 17 00:00:00 2001 From: Wizzard <25581244+Wizzard@users.noreply.toomuchslop.com> Date: Mon, 16 Oct 2023 16:38:25 -0400 Subject: [PATCH] Allow pngs --- main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index c664207..594bc03 100644 --- a/main.js +++ b/main.js @@ -18,8 +18,8 @@ async function processAlbumCover(url) { const imageSharp = sharp(imageBuffer); const metadata = await imageSharp.metadata(); - if (metadata.format !== 'jpeg' && metadata.format !== 'jpg') { - throw new Error('Not a JPEG image'); + if (metadata.format !== 'jpeg' && metadata.format !== 'jpg' && metadata.format !== 'png') { + throw new Error('Not a supported image format'); } const dominantColor = await getDominantColor(imageBuffer);