DjDeveloperr / skia_canvas

Fast HTML Canvas API implementation for Deno using Google Skia
https://jsr.io/@gfx/canvas
Apache License 2.0
132 stars 9 forks source link

`Canvas.toDataURL` doesn't work #62

Closed RuiNtD closed 8 months ago

RuiNtD commented 9 months ago

Canvas.toDataURL doesn't work, returning this error:

error: Uncaught (in promise) TypeError: encodeBase64 is not a function
    return `data:image/${format};base64,${encodeBase64(buffer)}`;
                                          ^
    at Canvas.toDataURL (https://deno.land/x/skia_canvas@0.5.5/src/canvas.ts:151:43)

Using deno 1.40.1

RuiNtD commented 9 months ago

This also affects setting an Image's src to a data URL:

error: Uncaught (in promise) TypeError: decodeBase64 is not a function
          ? decodeBase64(content)
            ^
    at Image.set src (https://deno.land/x/skia_canvas@0.5.5/src/image.ts:75:13)
DjDeveloperr commented 8 months ago

This should be fixed in 0.5.6