We are about to switch to a new forum software. Until then we have removed the registration on this forum.
in javaScript mode of processing 2.2.1, the resize function breaks my sketch.
/* @pjs preload="../georgios.jpg"; */
PImage img;
void setup() {
//size(800,800, RGB);
size(800,800, P2D);
colorMode(RGB,1);
background(0);
//frameRate(60);
img = loadImage("../georgios.jpg");
img.resize(100, 100);
}
void draw() {
background(0);
image(img, 0, 0);
}
Strange thing is that if I comment out the framerate it displays the image but at the original size.
there has been another post about this, but no answer. Any ideas maybe? Thank you
Answers
This path is strange: "../georgios.jpg".
Can you try out change file location to "georgios.jpg" instead?
oh that actually fixed it.
That was actually a side question I wanted to ask. I ended up having it at the parent directory because every time I save/export the sketch, processing will wipe out the jpg from the web-export directory. Is there a way to copy all the media files I need into that directory, on every export? What's the common practice?
thanks for pointing that out
In general, Processing expects our files to be in "data/" subfolder.
I thought "JavaScript Mode" would copy anything there to "web-export", wouldn't it? :-/
oh right, yes it does!
Thanks a lot