-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Image loading doesn't work with for loops #1836
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
Comments
I ran into similar issues. Might be related. It seems to work if you wait ~5 minutes after uploading the file. (I didn't get any errors when I ran your sketch). |
@da091005 Strange! It's working fine for me now as well. I feel that still it shouldn't take 5 minutes for you to be able to use your images, or if it does can we provide the user with some information on when their image data will be available? |
Yea I think it’s a VERY strange bug. If you access the files directly it works immediately. But if you try to use a variable to access the files it takes like 5 minutes. |
I still experience this issue a lot as well during live sessions with my classes. I too have found that waiting a bit resolves the issue initially. I kept forgetting to come back and reopen #771 but I agree it may be related somehow. |
@raclim The loop is working only their is some syntax error is the code . let letters = function preload(){ // This works function setup() { function draw() { function preload(){ // This works function setup() { function draw() { |
Nature of issue?
I'm running into something odd where when I try to load my images in a for loop in the preload function, the images can't resolve. It seems like the file paths are being changed in some way so that p5 can't find the images.
If I try to load the images by typing them all out by hand, then they load just fine.
Here's a sketch showing what happens: https://editor.p5js.org/aferriss/sketches/RyE5Z91iC
I'm wondering if this is related to this issue #771
Details about the bug:
Try to load images dynamically during a for loop in the preload function
The text was updated successfully, but these errors were encountered: