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

Huge canvases are not rendered #6418

Open
Rob--W opened this issue Sep 4, 2015 · 2 comments · May be fixed by #19128
Open

Huge canvases are not rendered #6418

Rob--W opened this issue Sep 4, 2015 · 2 comments · May be fixed by #19128

Comments

@Rob--W
Copy link
Member

Rob--W commented Sep 4, 2015

PDF.js seems to assume that the canvas size is unlimited.

As demonstrated by #6385, this is not true. In that bug, a specific system using IE11 with HWA enabled supported canvases of at most 2048x2048 (#6385 (comment)).

Other browsers / systems have more generous limits, but there are probably images (e.g. high-res scans?) that exceeds these boundaries. In these cases, we should still be able to display the image in some way.

Slicing the canvas seems a solution, but that might be a bit tricky with gradients.

In IE, feature detection seems possible using canvas.toDataURL & img.naturalWidth & img.naturalHeight. In Chrome, toDataURL. I haven't checked Firefox or Safari yet, but detection can probably be done in a similar way.

So, how should we tackle big canvases?

@timvandermeij
Copy link
Contributor

Yury talked about canvas tiling a while ago, but nobody has further investigated or implemented that. I think the idea is to split the one large canvas into multiple smaller canvases, though I would not really have an idea on how to implement that properly.

/cc @yurydelendik (who can probably add more to this issue than I can)

@yurydelendik
Copy link
Contributor

Blocked by #6419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: High priority
3 participants