openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

Bug in ofToDataPath implementation

Open IanByun opened this issue 9 years ago • 1 comments

I am using of 0.9.0 so I am not sure if this is already addressed, but anyway I will report this. If your path to file starts with "data...", ofToDataPath() func does not add "data" to your path. For example if your path is "dataset/street.jpg", it should be "data/dataset/street.jpg", but the function outputs just "dataset/street.jpg".

The function should be modified to properly identify whether the path starts with exactly "data/...", or it just contains a leading folder name with leading "data.../...".

IanByun avatar Jun 09 '17 07:06 IanByun

I cannot reproduce this on the mater branch. I believe it has been fixed with the std::filesystem integration.

Closing:

        std::cout << ofToDataPath("dataset/street.jpg") << std::endl;
        std::cout << ofToDataPath("data/dataset/street.jpg") << std::endl;

outputs

../../../data/dataset/street.jpg
../../../data/data/dataset/street.jpg

bakercp avatar Jun 12 '17 03:06 bakercp