psychopy.org | Reference | Downloads | Github

Unknown Resource Image File


#1

URL of experiment: https://pavlovia.org/run/huppfi/eating2/html/

Description of the problem: When running the experiment following Error shows up

Is the way I access my files wrong?


#2

I believe you are receiving this error because your prime image stim is undefined when you create your image component. You may want to put a base image file in there, and then this will be overwritten when you set the image at the start of each routine.


#3

So should I not do it like this? I currently have a variable primeimage that gets set to whatever Image I need.

Should I just put in a base image and then overwrite it with prime.setImage() ?


#4

Actually, I think this relates to a resource problem. Are you sure your images are being uploaded to Gitlab and available in the destination file?


#5

Hmm I think I might know what is happening. If you take a look at my gitlab https://gitlab.pavlovia.org/huppfi/eating2/tree/master/
you can see that I have a stim folder with all the files.

But the .js file is here: https://gitlab.pavlovia.org/huppfi/eating2/tree/master/html
Where theres a different stim folder. Maybe I need to go back 1 level and then assign the picture. So “…/stim/disgustprime/xxx.bmp”


#6

I cannot actually see your repo there, it does not seem to exist. Try putting your images in the resources folder that is in the same directory as your javascript and html, rather than the parent directory.


#7

image


That didn’t seem to fix the problem.


#9

I think this one is the old problem of backslash in filenames.

stim\disgustprime\RF_042.bmp

You want to use / (which is recognised on all computers) rather than \ (only recognised on Windows).


#10

image

I am using forward slashes. Though I see now that in the screenshot it looks weird sorry.


#11

I had thought that too, but the filepaths all use ‘/’. Yes, the screenshot looks like “\” are used.


#12

I recreate this error when I have not put all of my images in the resources folder. Instead of having them in the current working directory (i.e., where the JS and HTML experiment is saved), move your images into your resources folder that should have been created on export.


#13

Thank you! That was the solution!