Callback draw() doesn’t await for img to be fully loaded, much less for some1 to drop an image into the browser!
In my own sketch, I check whether img exists before using image(). And you should do the same.
Callback draw() doesn’t await for img to be fully loaded, much less for some1 to drop an image into the browser!
In my own sketch, I check whether img exists before using image(). And you should do the same.