datapath...route lost
in
Programming Questions
•
1 year ago
Hi,
part of the data path is lost (null) and the images are not loaded when I am in a subroutine.
I am trying to upload an image, it works when I enter it directly form new sketch:
b=loadImage("../dir/subdir/iconos/imagen1.jpg");
image(b,10,10);
println(dataPath(""));
displays> /Users/myuser/Documents/Processing/sketch1/data , and the image is displayed.
but when I copy/paste the same code inside a void subroutine , this happens:
The file "../dir/subdir/iconos/imagen1.jpg" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
the data path then is /null/data
If I set the datapath directly,
dataPath("/Users/myuser/Documents/Processing/files1/"); it fails, also iiIf i call the image directly
mimagen=loadImage("/Users/myuser/Documents/Processing//dir/subdir/iconos/imagen1.jpg");
it didn't work,
If I print the data path it says:
/Applications/null/data
maybe is that /null that appears in data path that don't let the image to be loaded, because it exists, is the same code and route, but it don't work in subroutines level..
any idea how to correct it?
thank you
1