psychopy.org | Reference | Downloads | Github

The argument is not an image error

URL of experiment: Pavlovia

Description of the problem: Dear all, I created a program that shows images on the screen.

I put the images (png format) in a folder named “Ideogr” in the resources folder, and the files get synchronized and downloaded.

If I set the filename in the object GUI like this:

everything seems to work fine.

If instead I code the filename in a variable, and then call it like this:

I get the following error:

Pressing F12 in the browser reveals this error message:

FATAL unknown | {“origin”:“ImageStim.setImage”,“context”:“when setting the image of ImageStim: image1”,“error”:“the argument: Ideogr/nonTUP.png is not an image” }"}

Which I find a bit puzzling because the path to the file seems to be exactly the same, but in the second case it´s not found.

Has anybody encountered this before? from the previous reports I saw the problem was usually missing files or wrong path definitions, but as far as I can tell here it´s not the case.

Thanks a lot,

Matteo

1 Like

Dear all, it took me a while but I sort of managed to solve the issue. The only solution I found was to create a mock trial at the beginning of the experiments that has all the images shown each called by its own name (with 0 opacity to avoid them actually showing). After that they seem to be available to be called through the variable definition.

1 Like

I had a very similar problem, slightly different error message.
The images would not load in, despite the images folder being present in the gitlab directory, the error was something like “image.png is not a resource”. Having tried many other fixes for the issue (changing backslashes to forward slashes, recreating a new directory and pavlovia experiment, etc, the above fix is the only thing that worked.

Hi @valsecchimat,

Can you please show how you did this?

Hi, I literally had a trial at the end of the experiment where I showed all the stimuli calling them by name