Hi all,
I’m hoping I have a simple question - I’m trying to populate an image array from a folder where images are stored but will not have sequential naming schemes (the folder is populated by a PHP uploader with a handful of different problems).

I’ve been checking around with no luck - is there a simple way to have P5 populate an array with all of the image files so I may begin to work with them?

(Sample code with what I think I’m trying to do - this code does nothing.)

Unfortunately, you have to know the names of the files ur gonna use, before hand. Whether you’re serving your p5 code in a <script> header, or separately as a .js file, when your page gets served to the client, it has no ‘concept’ of where it came from (compared to, say, a Python script that ‘knows’ where it resides, BECAUSE its being run on the local maching)

You might be testing your p5 in localhost, but, for very good security reasons, an html page is more like a set of instructions telling the browser what to load.

Long story short…if you don’t know your image names before-hand, the HTML page can’t bring them over to the browser.

(This IS possible in Java however, one of the few differences between P5 and Java Processing)