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

iPad image download bug for huge maps #274

Open
JannikStreek opened this issue Apr 25, 2024 · 4 comments · May be fixed by #300
Open

iPad image download bug for huge maps #274

JannikStreek opened this issue Apr 25, 2024 · 4 comments · May be fixed by #300
Labels
bug Something isn't working

Comments

@JannikStreek
Copy link
Member

JannikStreek commented Apr 25, 2024

Describe the bug
When exporting a big map (meaning not many nodes but just nodes with huge distances), image download on the iPad adds a txt ending which makes image usage difficult.

To Reproduce
Steps to reproduce the behavior:

  1. Create a big mind map
  2. Download as image on the iPad
  3. See txt ending of file

Expected behavior
No txt ending of the file

@JannikStreek JannikStreek added the bug Something isn't working label Apr 25, 2024
@JannikStreek JannikStreek changed the title investigate iPad Download bug iPad image download bug for huge maps Apr 25, 2024
@sorenjohanson
Copy link
Contributor

So the reason why Safari adds .txt at the end is that the image exported is actually 0KB. Chrome downloads it correctly, but it still doesn't show anything. Seems to be a general export bug.

@sorenjohanson
Copy link
Contributor

Can be reproduced on Desktop as well.

@sorenjohanson
Copy link
Contributor

This is caused by canvas.toDataUrl() in the export handler: https://github.com/b310-digital/teammapper/blob/main/teammapper-frontend/mmp/src/map/handlers/export.ts#L86

I'm assuming there's a practical character limit to the base64 string and we're just exceeding it.

@sorenjohanson
Copy link
Contributor

We're hitting the practical limits of canvasses when exporting images:

Maximum height/width: 32,767 pixels
Maximum area: 268,435,456 pixels (e.g., 16,384 x 16,384)

I think the only feasible solution would be to simply limit the working area to 16,000 x 16,000 px (leaving a bit of buffer) and displaying the rest of the area in grey.

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

Successfully merging a pull request may close this issue.

2 participants