deployment: problem loading images

6 views
Skip to first unread message

María da Fonseca

unread,
Nov 12, 2020, 9:08:52 AM11/12/20
to ja...@googlegroups.com
Hi Elisa and Kristian,

Finally, I am deploying the exp and experiencing a problem loading stimuli images. Maybe, it is in the way I wrote the path. The directory where all the files are content is named 'experimento_clone' and the scr for images is: "/study_assets/experimento_clone/img/objective_noise_stimuli/001_1.png". But I also display a logo as "/study_assets/experimento_clone/img/koa_logo.png" and it is displayed.

The thing with the stimuli images is that I preloaded them in the following way that works fine in my local server:

<script>
....
var gabor_list = [];
        for (i=1;i<101;i++) {
            if (i < 10) gnoise = "00"+i;
            else if (i>9 && i<100) gnoise = "0"+i;
            else gnoise = i;
            var gabor_samples = [];
            for (j=1;j<11;j++) {
                gabor_samples.push("/study_assets/experimento_clone    /img/objective_noise_stimuli/"+gnoise+"_"+j+".png");
            }
            gabor_list.push(gabor_samples);
        }
function preload(list) {
            for (var i = 0; i < list.length; i++) {
                var gabor_images_noise = [];
                for (var j = 0; j < list[0].length; j++){
                    gabor_images_noise[j] = new Image();
                    gabor_images_noise[j].src = list[i][j];
                }  
                gabor_images[i] = gabor_images_noise;
            }
        }
jatos.onLoad(() => {
            $('#loader').show();
            $('#cargando').show();
            preload(gabor_list);
            $('#loader').hide();
            $('#cargando').hide();
...
</script>

Could you help me to understand why it works on the local server but not on the web server?

Best,

María
Reply all
Reply to author
Forward
0 new messages