This is very basic, I understand.
My code below functions in the online editor, but it does not function locally in my own computer. I’ve tried downloading the p5.js file, as well as linking to it online, but to no avail. I’ve even tried various versions of the p5.js file.
I have also run it on various browsers (Firefox, Chrome, Safari, Brave), all with the same results: I get the canvas, but no image. If I try to use a preload function, I don’t even get the canvas, just an interminable “loading…”
let img;
function setup() {
createCanvas(423, 600);
background(220);
img = loadImage("images/uccello.jpg");
}
function draw() {
image(img, 0, 0, width, height);
}
Here is a link to the functioning code in the online editor: https://editor.p5js.org/carterjohnson.sbu/sketches/M5nNcg7zo
I’ve uploaded images of my local HTML file and folder structure.
I do get an error in Firefox that reads: Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.
I’d really appreciate any help. Thanks!