Allow pngs
This commit is contained in:
parent
7d9800806a
commit
96634a7e9e
4
main.js
4
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);
|
||||
|
|
Loading…
Reference in New Issue