Skip to content

loadImage and non-literal file names #212

Closed
@kjhollen

Description

@kjhollen

A couple students in our class have seen an issue where they try to load a sequence of images but the paths don't resolve. For example they have images like:

folder/file-1.png
folder/file-2.png
folder/file-3.png

and want to use a for loop to load all the images in a folder, iterating over the numbers in the file name. I have a couple of examples that reproduce this:

http://alpha.editor.p5js.org/projects/rJtoro7Gg

http://alpha.editor.p5js.org/projects/r1f0wsmzg

They don't work in the web editor, but downloading the sketch and serving the files locally works as I'd expect (a grid of images is visible).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:HighShould be addressed soon but not critical

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions