r/p5js • u/ElectroBeast_ • 24d ago
Loading Errors
My project has about 50 images so far and every time i try run my code, it comes up with failed to load image over and over. How do i fix this please help
1
u/forgotmyusernamedamm 24d ago
Does it work with one image? If so, does it work with 20? How many images break it?
Is it failing to load on the same image each time? Make 100% sure there are no spelling mistakes and you have the extension correct.
Try loading just that image on its own.
What version of p5.js are you using? If you're using 2.0 or greater are you using the async setup?
How big are your images? If you are compressing them anyways, try reducing the size before importing.
If none of this works, trying to isolate the problem into the shortest code possible. Eliminate everything but the bug, then give us some code to look at.
1
u/ElectroBeast_ 24d ago
I don't think its to do with that because some times it runs perfectly fine, but most of the time it just either takes minuets to load or fails to at all
2
u/JoeWhy2 24d ago
Are you doing this in the P5JS editor and have you looked at the updates to p5.js v2?