Skip to content

Svg support? #6

@scientific-dev

Description

@scientific-dev

I am using deno-canvas for making a test image and i was using a svg image url to load image but whenever i try to load image it throws me a error Invalid Image. But when using nodejs's canvas it works fine. Is the problem with svg or something? Here is my code to reproduce the error:

import Canvas, { dataURLtoFile, loadImage } from 'https://deno.land/x/canvas@v1.1.3/mod.ts';

ctx.fillStyle = '#7298da';
ctx.fillRect(0, 0, 800 - 20, 800 - 20);
ctx.fillStyle = 'white';

await ctx.drawImage(await loadImage('https://weboverhauls.github.io/demos/svg/checkmark.svg'), 0, 0);
Deno.writeFileSync("test.png", dataURLtoFile(canvas.toDataURL()))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions