[javascript] problem when using capture screenshot

When I capture screenshot and using ID.submit_image to send the image up, but sometime reponse is error:
Object {code: -32099, message: “{message: “timeout after “10000” second”, status: 0, data: null}”}
Link for my game: Happy-mother-day
Thanks!

ohh,see that?null
Seem that’s the problem,you know this thing is like something wrong with you computer/Laptop will become crash…happen to me,you will lost your data i think…but doesn’t mean is none logic because this thing can happen to all people in every country…even good software can happen…if you watch the news about attacked by hacker mean you need to be careful and make sure not share your account or don’t make an easy password…you need to be tricky…if you wanna know what is null…watch minecraft null…just watch and learn about null

3 Likes

Hi, I’m not sure why that data property is there or why it’s null. However, the message is clear. This is happening because there is some slowness some where. Could be your internet, the image, our servers, or a mixture of these. The fast fix is to reduce the image size. Maybe cut off some of the background. Also, with toDataURL there are some encoder options. You will probably want jpg with a lower quality setting like 60.

Side note, there are some strange color artifacts that are bloating the screenshot size. It appears that a jpg with many gradients was converted to a png with limited color palette. That will cause this dithering.

2 Likes

So you mean this just a some of image that make his computer crash?

1 Like

Thanks for reply.
the picture is so I optimize size atlas with pngquant-windows, I set medium quality image Before sending up, Error code: -32099 occurs less, I’m trying to reduce the image size before sending up but dont know resize an image (base64 image) before upload :frowning:

I made this only to show the quality issue. You see on the yellow how there is a mix of colors on the top part? This is a type of distortion that happens when images are saved. It’s a sign that the data is compressed too much and that causes some bad quality.

ok sounds good. You will want to resize before toDataUrl. A quick search for resize canvas image, I found at least one example of how to do it.

To get better quality vs file size in the future, You might try saving each individual image using 8-bit png compression, then save the final sprite sheet using 24-bit. In Banjo Panda, I got good results using this.

1 Like

Yeah true :joy:

1 Like
Y8 Games