H
H
HaruAtari2013-09-11 20:25:45
Canvas
HaruAtari, 2013-09-11 20:25:45

How to work with long data:url?

Good afternoon.
There is a small js application that works with canvas. You also need the ability to present the current image from the canvas as an img-image so that you can save it to your computer. In this case, everything should work on the client, without calls to the server.
For this I use canvas.toDataURL(), which returns the image from the canvas as a data:url string. On small images it works fine, but on large images google chrom refuses to work. This happens when the received string is larger than 1000000 characters.
Other browsers work fine, but in chrome the tab crashes. And this happens not only when opening an image from a new tab, but also when trying to drag it with the mouse.

Tell me how to solve this problem? What should be done so that chrome does not show off? To be honest, I do not quite understand in which direction to think at all.

I would be grateful for any thoughts.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question