I am running an experiment where I am showing an image in a routine. I am doing this for many routines (15-20). each image is constant but specific to a routine type. I am using pix. I’d rather not have to switch to height since that would erase 10 hours of work but if you think its the only way then I will. It was working when I had sized 5 of them to be bigger than the default. But once I started resizing the others it broke and gave this error:
IndexSizeError: Failed to execute ‘getImageData’ on ‘OffscreenCanvasRenderingContext2D’: The source width is 0.
I had been running into this error before but found a way to fix it, but now nothing seems to fix it. I have tried clearing the image stimuli after it is by using a code component. I have tried checking to see if it loads properly and if not loading a default image. I am at a loss of what to do now and there are no solutions that have worked.
Here are all the coding components I have tried:
here is me preloading them, even though they are all under under the online tab in psychopy.
imageFiles = [“chatgpt was I right stick figure.jpg”, “chatgpt true-false stick figure.jpg”, “chatgpt source trust.jpg”, “chatgpt source say.jpg”, “chatgpt source familiarity.jpg”, “chatgpt right source.jpg”, “chatgpt memory stick figure.jpg”, “chatgpt know answer.jpg”, “chatgpt familiarity stick.jpg”, “chatgpt conf memory.jpg”,“placeholder.jpg”]; // Add all image names
for (let i = 0; i < imageFiles.length; i++) {
let img = new Image();
img.src = imageFiles[i]; // Forces preloading
}
My image sizes are not that big like <200kb most around 120kb. The biggest I size it in pixels is 450,500 but I have even messed with this and made them all smaller to see if that would fix it which it has not. I know I am rambling here I just hope to give enough info to get help because nothing seems to be working.