Thank you for the answear.
I have come a litttle further with my code and now it dosen't and just takes the amount of images that is new (but it takes the picture that is last in the folder, but that have worked for me).
But now I have a new problem, because each pictures starts with always at the beginning. But not after the last picture.
I'll put in the code how it looks now.
Code:import processing.pdf.*;
int posterWidth = 875;
int posterHeight = 1225;
int rows = 50;
int colls = 100;
int Check = 10000;
int LastCheck = 0;
int xoff =0;
int index = 0;
void setup()
{
size(posterWidth, posterHeight);
beginRecord(PDF, "PIG-####.pdf");
}
void draw(){
File path= sketchFile("pictures");
File[] files = path.listFiles();
int imgWidth = posterWidth / rows;
int imgHeight = posterHeight / colls;
if(millis() - LastCheck > Check){
if(files.length > + index){
for(int y=0; y < colls; y++)
{
for(int x = 0; x < rows; x++)
{
if(index >= files.length) break;
PImage img = loadImage(files[index].getAbsolutePath());
img.resize(imgWidth,imgHeight);
image(img, (x * imgWidth) + xoff, y * imgHeight);
println("place @ " + (x * imgWidth));
index++;
xoff = ((x * imgWidth) + imgWidth);
}
index=files.length;
}
}
LastCheck=millis();
}
endRecord();
}
I was trying make xoff to tell the program to start at X place.
And was hoping that makeing
xoff = ((x * imgWidth) + imgWidth);
would change the value of int xoff.
I have no idea what I'm doing wrong, or if there is a better method or even if I'm doing it right