unburn / musicard

Musicard is a futuristic music card canvas library
GNU General Public License v3.0
81 stars 22 forks source link

non support image type #3

Closed KBYSHanahira closed 1 year ago

KBYSHanahira commented 1 year ago

Console Log

https://i.ytimg.com/vi_webp/mpWnhkMLIu4/maxresdefault.webp

Error

/home/hanahiranetwork/Desktop/DiscordBOT/HimawariChan/node_modules/canvas/lib/image.js:94 SetSource.call(img, src) ^

Error: Unsupported image type at setSource (/home/hanahiranetwork/Desktop/DiscordBOT/HimawariChan/node_modules/canvas/lib/image.js:94:13) at /home/hanahiranetwork/Desktop/DiscordBOT/HimawariChan/node_modules/canvas/lib/image.js:62:11 at /home/hanahiranetwork/Desktop/DiscordBOT/HimawariChan/node_modules/simple-get/index.js:97:7 at IncomingMessage. (/home/hanahiranetwork/Desktop/DiscordBOT/HimawariChan/node_modules/simple-concat/index.js:8:13) at Object.onceWrapper (node:events:628:28) at IncomingMessage.emit (node:events:526:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

KBYSHanahira commented 1 year ago

i fix this by set the picture to default

let imageurl;

    if (song.thumbnail.includes(".webp")) {
      imageurl = "";
    } else {
      imageurl = song.thumbnail;
    }

i wait fix this to support webp file

flameface commented 1 year ago

Thanks @KBYSHanahira We have fixed the bug, check out latest release here

KBYSHanahira commented 1 year ago

@flam3face Thanks you fixed this <3 I wait you update support file [ .webp ] or [ other picture file type ] can show in music card like the .png and .jpegs in future if can't not problem you doing good

flameface commented 1 year ago

canvas doesn't load .webp images, still i will try to resolve it.

KBYSHanahira commented 1 year ago

@flam3face Thank you very much :) music card is very good , i love it <3

flameface commented 1 year ago

@KBYSHanahira fixed the issue, now you can use webp as well