We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › threshold errors
Page Index Toggle Pages: 1
threshold errors (Read 340 times)
threshold errors
Jan 5th, 2009, 4:22pm
 
Im trying to run this code from Processing by Ian Greenberg

size (800,200);
PImage img = loadImage("ketty.jpg");
float thresholdLevel = 1.0;
for (int i=0; i<4; i++){
 image(img, 200*i, 0, 200, 200);
 filter (THRESHOLD, thresholdLevel);
 thresholdLevel-=.25;
}

getting a nullpointerException error, also tried using the the example code from processing site

PImage b;
b = loadImage("ketty.jpg");
image(b, 0, 0);
filter(THRESHOLD);

coming up with same error, im using 0156 beta on macbook.

cheers


Re: threshold errors
Reply #1 - Jan 5th, 2009, 5:03pm
 
FYI I tested with Processing (Expert) 0154 and 1.0.1 on Windows XP Pro SP3, using Java 1.6.0_11 and I got the desired result, no NPE.
Re: threshold errors
Reply #2 - Jan 5th, 2009, 5:57pm
 
Could you copy the console output showing the null pointer exception, or do you know which line is highlighted when it faults?
Re: threshold errors
Reply #3 - Jan 5th, 2009, 6:02pm
 
Hi I found the problem, it was not reading the image although it was working in other sketches. I just added file again and its running fine. thanks for ur help though
Page Index Toggle Pages: 1