DjDeveloperr / skia_canvas

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

canvas.encode() does not work with Deno 1.40.4 or later. #63

Closed hdae closed 9 months ago

hdae commented 9 months ago

This occurs when the following code is executed with Deno 1.40.4 or later.

import { createCanvas } from "https://deno.land/x/skia_canvas@0.5.5/mod.ts"
const canvas = createCanvas(100, 100)
canvas.encode("png")

Returning this error.

error: (in promise) TypeError: getBuffer is not a function
    const buffer = new Uint8Array(getBuffer(bufptr, 0, size));
                                  ^
    at Canvas.encode (https://deno.land/x/skia_canvas@0.5.4/src/canvas.ts:141:35)

Since Deno 1.40.4, many functions in Deno[Deno.internal].core.ops seem to be unavailable.

> Deno[Deno.internal].core.ops
{
  op_napi_open: [Function: op_napi_open],
  op_npm_process_state: [Function: op_npm_process_state],
  op_set_exit_code: [Function: op_set_exit_code],
  op_pledge_test_permissions: [Function: op_pledge_test_permissions],
  op_restore_test_permissions: [Function: op_restore_test_permissions],
  op_register_test: [Function: op_register_test],
  op_register_test_step: [Function: op_register_test_step],
  op_test_event_step_wait: [Function: op_test_event_step_wait],
  op_test_event_step_result_ok: [Function: op_test_event_step_result_ok],
  op_test_event_step_result_ignored: [Function: op_test_event_step_result_ignored],
  op_test_event_step_result_failed: [Function: op_test_event_step_result_failed],
  op_test_op_sanitizer_collect: [Function: op_test_op_sanitizer_collect],
  op_test_op_sanitizer_finish: [Function: op_test_op_sanitizer_finish],
  op_test_op_sanitizer_report: [Function: op_test_op_sanitizer_report],
  op_test_op_sanitizer_get_async_message: [Function: op_test_op_sanitizer_get_async_message]
}