Load image from mapped drive in Windows

Hi,

I am trying to load an image from a mapped drive in Windows. ofDirectory has no trouble seeing and listing files in this folder, but ofImage cannot load the files.

If I do
img.load(imgPath);
the path looks correct but cannot open.

If I do
img.load(ofToDataPath(imgPath));
or
img.load(ofToDataPath(imgPath, true));
the direction of the first slash changes (i.e. “Z:\path\to\stuff” becomes “Z:/path\to\stuff”) and is still unreadable. Thoughts? Suggestions?

ofImage::load lets freeimage open the file which might be doign something strange. you can try to read the file to an ofBuffer first and the load the image from there like:

ofFile imgFile(imgPath);
ofBuffer imgBuffer(imgFile);
ofImage img;
img.load(imgBuffer);