Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.74k stars 76 forks source link

GenericFailure on creating a huge canvas #897

Open lmachens opened 1 week ago

lmachens commented 1 week ago

I like to create a canvas with a size of 25600x25600 . createCanvas(25600, 25600)

This is the error message:

error: Create skia surface failed
 code: "GenericFailure"

      at createCanvas (/home/devleon/the-hidden-gaming-lair/services/data/node_modules/@napi-rs/canvas/index.js:67:62)
      at /home/devleon/the-hidden-gaming-lair/services/data/src/lib/image.ts:239:16

@napi-rs/canvas version: 0.1.55

Is it possible to increase the max size or does it depend on the memory of the host?

lmachens commented 1 week ago

Looks like it's a limitation related to the maximum canvas size in skia: https://github.com/mono/SkiaSharp/issues/896#issuecomment-506929905