STBI not loading image despite giving the right directory for absolutely no reason #1835
-
|
I tried loading an image but it just doesn't want to load, despite me giving the right path. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
|
@MyoskSoftwareCompany Could you upload the PNG image you are using here and I'll verify whether the image format is supported by stb_image. It would be nice if you could create a short C++ project that reproduces the problem. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
What does the |
Beta Was this translation helpful? Give feedback.
-
|
@MyoskSoftwareCompany I downloaded the image you uploaded. After testing, the image is fine and it can be read correctly by stb_image.
|
Beta Was this translation helpful? Give feedback.
-
|
the issue still persists
|
Beta Was this translation helpful? Give feedback.
-
STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
{
FILE *f = stbi__fopen(filename, "rb");
unsigned char *result;
if (!f) return stbi__errpuc("can't fopen", "Unable to open file");
result = stbi_load_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
}As you can see from the output message and the source code, the reason is that it is not possible to open this file, which may not be able to find the file based on the path. Please check the file path and test using the full path (absolute path) of the file. You run the program at |
Beta Was this translation helpful? Give feedback.
-
|
the working directory isn't in the build directory so i just use |
Beta Was this translation helpful? Give feedback.


the working directory isn't in the build directory so i just use
cd buildandcd ..