Skip to content

Not loading images from folder #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leonardof131 opened this issue Sep 13, 2019 · 1 comment
Closed

Not loading images from folder #1158

leonardof131 opened this issue Sep 13, 2019 · 1 comment

Comments

@leonardof131
Copy link

So, I managed to run a version of the Web Editor for our ONG. You can check issue #1156 to learn more.

The thing is, how can we have a folder with some images on it, so our students can use them ?

For example, I have the website ong.processingeditor.com.br where the web editor is running.
We also have an folder for images on ong.processingeditor.com.br/assets/ with some mascots we would like to use. The thing is, some images the web editor can acess and others not.

For example:

let img; // Declare variable ‘img’.

function setup() {
createCanvas(720, 400);
img = loadImage(’/assets/mascot1.jpg’); // Load the image
}

function draw() {
// Displays the image at its actual size at point (0,0)
image(img, 0, 0);
// Displays the image at point (0, height/2) at half size
image(img, 0, height / 2, img.width / 2, img.height / 2);
}

The image mascot1 is displayed correctly, but if try to load another image from the same folder, the console gives an error and says to look the filepath. If I try to load ong.processingeditor.com.br/assets/mascot1.pg, the browser loads the file correctly, but if I try to load other files, like ong.processingeditor.com.br/assets/mascot2.jpg, I get an 404 page from the Web Editor.

I’m missing something ? I can load some files from that folder, but others I cant, and its driving me nuts. Can you guys help me with this ?

  • Found a bug

Details about the bug:

  • Web browser and version: Firefox 69.0 (64bits)
  • Operating System: Ubuntu 18.04 LTS

New feature details:

@catarak
Copy link
Member

catarak commented Sep 26, 2019

hi @leonardof131, sorry for the delay in replying to this! i thought i replied but i guess i didn't? anyway, the reason it's not working is because the web editor assumes image files are uploaded to an S3 bucket. it's a coincidence that the first example you give is working.

there's a guide for setting up an S3 bucket: https://github.com/processing/p5.js-web-editor/blob/master/developer_docs/installation.md#s3-bucket-configuration. you'll also need to update your .env file to point to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants