kyranet / canvas-constructor

An ES6 utility for canvas with built-in functions and chained methods.
https://canvasconstructor.js.org
MIT License
116 stars 23 forks source link

bug: #362

Closed Cyanic76 closed 4 years ago

Cyanic76 commented 4 years ago

Hello, I got a quick question:

I'm getting TypeError: Image or Canvas expected when using the following code.


const resultbg = await fetch("https://cdn.discordapp.com/attachments/725418862346240070/747769058283225158/Capture.PNG ");
    const bg = await resultbg.buffer();
    let img = new Canvas(400,180)
    .printImage(bg, 0, 0, 400, 180)
    .setColor("#ffffff")
    .setTextSize(27)
    .addText(name, 10, 10) // name = mentioned user or author's username
    .setTextSize(18) // rest of profile...```

Is the picture not in an acceptable format? What did I forgot to do?
Cyanic76 commented 4 years ago

I'm really sorry about using the wrong template.