openFrameworks
openFrameworks copied to clipboard
Bug in ofToDataPath implementation
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.../...".
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