I am seeing this same problem. Processing halts and will not continue when a file is not found with loadImage method.
I can catch the exception, but I can not seem to continue processing.
Here is my code:
Code:
boolean getImageById(int Id) {
String f = "thumb" + Id + ".jpg";
try {
PImage p = loadImage(f);
doSomethingWith(p);
} catch (Exception e) {
println(f+" file not found");
return false;
}
return true;
}
Here is the error I get when a file is missing:
-----------------------------------------------------
java.io.IOException: openStream() could not open D:\folded\thumb161.jpg
java.io.IOException: openStream() could not open D:\folded\thumb161.jpg
at processing.core.PApplet.openStream(PApplet.java:3168 )
java.lang.ArrayIndexOutOfBoundsException: -1
at processing.app.Runner.message(Runner.java:491)
at processing.app.MessageSiphon.run(MessageSiphon.java:60 )
at java.lang.Thread.run(Unknown Source)
D:\folded\thumb161.jpg file not found
-----------------------------------------------------
This is Processing 0091 in Windows XP, JRE 1.4.2.
Thanks for any help!
jared