Browse Source

radically improved speed

master
Victor Giers 3 years ago
parent
commit
fd485ba6a8
1 changed files with 7 additions and 26 deletions
  1. 7
    26
      scancropper2.pde

+ 7
- 26
scancropper2.pde View File

int imageAmount; int imageAmount;
String[] imagePaths; String[] imagePaths;
PImage[] images; PImage[] images;
PImage imageThumb;
boolean imageLoaded; boolean imageLoaded;
String folderURI; String folderURI;


void setup() { void setup() {
size(240, 100); size(240, 100);
frameRate(30); frameRate(30);
noSmooth;
drop = new SDrop(this); drop = new SDrop(this);
surface.setResizable(true); surface.setResizable(true);
bounder = new Bounder(); bounder = new Bounder();


if (imageLoaded) { if (imageLoaded) {
if (images[imageNo] != null) { if (images[imageNo] != null) {
image(images[imageNo], 0, 0, width, height);
// image(images[imageNo], 0, 0, width, height);
image(imageThumb, 0, 0, width, height);
} }
} }


} }


void setImage(int i) { void setImage(int i) {
imageLoaded = false; //seperate threat not present ladida
images[i] = loadImage(imagePaths[imageNo]); images[i] = loadImage(imagePaths[imageNo]);
imageThumb = images[i].get();
imageThumb.resize(images[i].width/7, images[i].height/7);
imageLoaded = true; imageLoaded = true;
} }


imagePaths = new String[imageAmount]; imagePaths = new String[imageAmount];
imagePaths = imgs.toArray(imagePaths); imagePaths = imgs.toArray(imagePaths);
imagePaths = sort(imagePaths); imagePaths = sort(imagePaths);
/*
for (int i = 0; i < imageAmount; i++) {
imagePaths[i] = droppedFiles[i].toString();
}
*/
images = new PImage[imageAmount];
setImage(imageNo);
/*
imageAmount = droppedFiles.length-1; // assuming all files in folder are images
images = new PImage[imageAmount]; images = new PImage[imageAmount];
imageList = new String[imageAmount];
for (int i = 0; i < imageAmount; i++) {
imageList[i] = droppedFiles[i].toString();
}
imageList = sort(imageList);
setImage(imageNo); setImage(imageNo);
*/
/*for (int i = 0; i < imageAmount; i++) {
images[i] = loadImage(droppedFiles[i].toString());
println("hi");
} // braucht zu lang die scheisse */

} }
} }
} }

Loading…
Cancel
Save