Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPadOS: exceeding 480MB canvas limit #25

Open
bitbof opened this issue Apr 19, 2022 · 0 comments
Open

iPadOS: exceeding 480MB canvas limit #25

bitbof opened this issue Apr 19, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@bitbof
Copy link
Owner

bitbof commented Apr 19, 2022

With 16 layers of 2048 * 2048 px, Klecks/Kleki is capable of reaching the 480MB canvas limit that iPadOS has. That breaks the application, as no new canvas objects can be created, or more specifically their contexts are null.

Scenario 1 - embed - iPad

  • create new image: 2048*2048
  • add new layers until there are 16 layers
  • draw for a while, ~20 lines
    -> now the application will be broken

Scenario 2 - embed - iPad

  • open an image that is 2048*2048 and has 16 layers
    -> the application is broken right away

Scenario 3 - standalone - iPad

  • create new image: 2048*2048
  • add new layers until there are 16 layers
  • store to browser storage
  • reload the page
    -> now the application is and will remain broken until the cache (indexedDB) is cleared

Also reloading the page will break everything much quicker because it appears that Safari keeps the page from before the reload in memory. It will fail to create even a single canvas.


Cause

When the application breaks, it has 32 2048*2048px canvases, or 32 * 2048 * 2048 * 4 / 1024 / 1024 = 512MB . 16 canvases which represent the current state of the image, and 16 canvases that represent the image in its earliest Undo state. Architectural changes are needed to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant