p5.js
p5.js copied to clipboard
loadImage can brake the whole sketch
If you take the default example and add this:
function preload() {
loadImage("banner_512x128.mp4", (img)=> {
},
(err)=> {
console.log("mp4 you idiot!");
});
}
Then you get, as expected "mp4 you idiot!" and "p5.js says: It looks like there was a problem loading your image. Try checki....".
I know this is plain stupid, but it also means a corrupt image can break a whole sketch.
The preload counter is not decremented in the case of an error. It can perhaps be made so that if the error callback is provided the sketch continue to run. I'm just not sure how this can be considered a breaking change or not.
Even if it would be a breaking change, it would be the right step forward. Also, if it would be, all it would do is make sketches that don't run at the moment run right?
Breaking change is more about managing expectations, specifically expectation that the same semantic code that is written for one version works in the same way in another version. Though that does not mean this change is a breaking change, I'm just not sure whether it should be counted as one or not.
I'm a bit overloaded at the moment so cannot spend the time to think through cases where this change could have an effect and what kind of effect, so will have to leave this for later or for someone else to have a look.
@limzykenneth I would like to work on this, could you please let me know where I should start looking?