openframeworks / openframeworks/openFrameworks
Relative ofToDataPath() behavior and expected paths for data items
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Testing this on today's master, I see that ofToDataPath(false) changed behavior.
string myPath = ofToDataPath("test.png", false);
// myPath is "data/test.png", but it used to be (and I think it should) "test.png";
If I remember right, ofToDataPath() used to return the path from "inside" data, so "data/" would not be part of the path. Testing some more, I created a png in data/0.png and to my surprise, both:
ofLoadImage(pix, "0.png");
ofLoadImage(pix, "data/0.png");
load the image!
Is this intentional? If this is supposed to "help out" by being smart about paths that start with "data/", it seems counter-productive... But I wonder what the behavior should be.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the implementation and callers of ofToDataPath(), then compare its handling of "test.png", "0.png", and "data/0.png" with the ofLoadImage() examples in the issue. Clarify the intended path contract first, then add coverage showing the expected results for relative data paths and verify the image-loading behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100