-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
HTMLImageElement is in "broken" state. #2470
Comments
This works for me. Not sure if this matters, but I noticed you have a comma instead of a semi-colon var img = new Image();
img.onload = function() {
somcanvas.getContext('2d').drawImage(img, 0, 0);
};
img.src = 'data:image/png;base64,iVBORw0KGgoAA....'; I'm using nw 0.10.5 |
Sorry, updated the example. It was a typo only occuring in the above example. The issue is still occuring. Is there a way to debug those lock-states of the images? I guess CORS also plays a role for those, but shouldn't be relevant for this example. I don't know where to start looking for in Chromium's WebAPI, so any hint would be appreciated. (using nw 0.10.5 on Linux/Ubuntu amd64) |
untill nw 0.12.2 on Linux/Unbuntu amd64 this still persists for the given example. Any suggestions on possible walk around ? |
I do have the same problem..... |
Do you see the same error on Chrome? |
Yep, same problem. I want to put a live demo of my JS game on my website. When I play it by itself, it's good, but on the website I get the broken error above. Exact same error. |
Same problem here, |
Hey Guys I am also having this error: The HTMLImageElement provided is in the 'broken' state when embedding a view from Tableau Server. Has anyone found anything on this? What does it mean? |
I think the problem is related to when you draw the image on the canvas. If the image is set via Might be possible for others to get around the broken state by using setTimeout(draw, 0) inside the |
Thanks |
I think I traced down the bug further in upstream Blink: Related lines: Somewhere between ImageResource.get() it fails, but I have no effing clue why. They always return pointers in their dummy methods and ImageResource, ImageLoader, Image, HTMLImageElement use all But maybe this helps nail the bug further down. My partly blind guess is that the ImageLoader for data URLs does not fire the Maybe you can produce a test case for this by using this and toggle on/off the width/height properties to further trace the bug down the spaghetti code: let img = new Image();
img.width = 1337;
img.height = 13.37;
img.onload = function() {
context.drawImage(this, 0, 0);
};
img.src = 'data:...'; |
I can't reproduce this issue on latest stable 0.16.1 or LTS 0.14.7. |
I had the same. |
I have a serialized image, which I deserialize from its base64 encoded URL. The encoded URL is correctly serialized and known to work in Browsers and my other SDL-based runtime.
Error and Description
Uncaught InvalidStateError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.
Steps to reproduce
How can I fix this?
// EDIT: corrected the example to avoid confusions
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: