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 & HelpSyntax Questions › Fail to Load Image
Page Index Toggle Pages: 1
Fail to Load Image (Read 1255 times)
Fail to Load Image
Feb 1st, 2007, 3:55pm
 
Hi List,
When I run following code with the image located in the data folder of the app, why is it that the image only loads in 1 out of 10 tries.

size(800, 600);
PImage b;
b = loadImage("MySelf2.jpg");
image(b, 0, 0);

The code is as raw as can be and the size equals the actual image size. Have also noticed that if size is change in some of the demo apps, the load in unreliable. What is the solution for this problem. I'm using a v. 0123 installed with existing Java but can run the demos, so no problem there.
Thanks,
Mikael

Re: Fail to Load Image
Reply #1 - Feb 2nd, 2007, 3:55pm
 
have you tried with the version of processing that includes java?
Re: Fail to Load Image
Reply #2 - Feb 3rd, 2007, 3:19pm
 
No I have only used the version that installs without Java since I already have jdk1.5.0_06 used w/TinyOS and two separate updates jre1.5.0_09 and jre1.5.0_10. What exactly is the java that is installed with Processing?
Re: Fail to Load Image
Reply #3 - Feb 3rd, 2007, 5:56pm
 
http://processing.org/reference/troubleshooting/#wontstart
it's a version of java 1.4.2 that we actually test with.

not that it will necessarily fix things, it's probably a weird threading issue with some machines and i've only recently been able to reproduce.
http://dev.processing.org/bugs/show_bug.cgi?id=511
Re: Fail to Load Image
Reply #4 - Feb 3rd, 2007, 7:25pm
 
Maybe I should add that I have a Cygwin environment with a ton of CLASSPATH's used for the TinyOS install pointing to java 1.5.0_06 But when I check java -version in the dos prompt it refers to version 1.5.0_10 so that should be Ok. Machine is a Laptop with Duo T2500 processor. Will I be better of by downloading w/Java assuming that a jre 1.4 will be bound to the Processing installation? This "should" not conflict with my already installed Cygwin environment?
Re: Fail to Load Image
Reply #5 - Feb 4th, 2007, 12:51am
 
Processing with java is completely self-contained, the java is installed in a sub-folder of processing, and no environment variables are messed with, so it should behave nicely and not interfere with anything else you have installed.
Re: Fail to Load Image
Reply #6 - Feb 7th, 2007, 12:10am
 
No change is observed when using the latest version w/Java. It seems that the issue is related to the mismatch of actual image size (width/height) and window size. It shows in that the closer the match the more stable is the image load -at least for small sizes. This ends my investigation into this issue.
Page Index Toggle Pages: 1