-
Notifications
You must be signed in to change notification settings - Fork 81
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
Added image error handling #6
base: master
Are you sure you want to change the base?
Conversation
If an image cannot be downloaded it throws lots of exception during drawing, add a onError handler to the images solves this issue
I've just done some testing with this, and it's not very clear to me how this change helps. If you add an error handler to the images to fix the image, then it looks like TagCanvas can used the fixed image without your modification. If the error handler doesn't update the image, then TagCanvas will still have a broken image and the change won't help. I can see how adding an error handler to TagCanvas would be useful, but I think it might be better to make TagCanvas deal with the error itself instead of using a handler from the image element. Do you have any examples of where this change is really useful? |
Hi, Thank you for your reply. A use case is exactly that you'd like to update Here is it: I have my images hosted out of my control, so some of them are OK, some are Broken or unavailable images while drawn on the canvas are generating an With my update it's easy to handle I'd like to display another image in place of the broken one (while The update I'm proposing helps to handle this use case while keeping the Hope this example is clear enough. Should you have any questions, please Thank you. 2014-11-07 11:30 GMT+01:00 goat1000 notifications@github.com:
|
I've tried out the onerror handler, and it replaces the broken image with a new one as expected. But the extra line in TagCanvas doesn't appear to make any difference. Without the "onerror=" in the img element, TagCanvas doesn't work with or without the extra line. With the "onerror=" in the img element it does work with or without the extra line. I'm just trying to understand under what conditions it makes a difference to have the new line of code. Is it only required for specific browsers, or when it takes a long time for the image to fail? |
Hi, Sorry for this delay. Actually I was trying to reproduce it using jsfiddle Thank you. 2014-11-11 16:38 GMT+01:00 goat1000 notifications@github.com:
|
Hi could you please merge this small change? I think it's useful. Thank you.
If an image cannot be downloaded it throws lots of exceptions during
drawing, added onError handler to the images solves this issue.