Skip to content

stbi_load doesn't work with jpg, data is null #1364

Answered by nothings
Mordentary asked this question in Q&A
Discussion options

You must be logged in to vote

Tried the first one (in my own codebase, not your test code), it loaded fine for me.

What platform are you on and/or what compiler are you using?

You could try using fopen to load the file yourself (make sure you open in binary mode), and then use stbi_load_from_memory and see if that's any different, but I can't imagine why it would be.

If you're willing to debug it, breakpoint in stbi__err(). Then run until the callstack shows the jpeg decoder (possibly other image formats will be attempted first and generate spurious calls to stbi__err). Then look up one level on the callstack and see what's calling one of the stbi__err*() macros.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@nothings
Comment options

@Mordentary
Comment options

@Mordentary
Comment options

@Mordentary
Comment options

@nothings
Comment options

Answer selected by Mordentary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants