Closed cyanskies closed 1 year ago
Hi I've created a repo with the file and some code to load it. I mimic the same behaviour as SFML as that is where I experienced the original assertion error.
https://github.com/cyanskies/stb_recreate
The graphic was downloaded from a free game art repository(I don't remember which), it seems the original source for the image was 8bit, so it must have been converted along the way.
Using the latest stb in my repo above, stbi_load_from_callbacks() no longer asserts and the file is reported as having a bad offset.
Opening and saving the file with paint.net(forcing it to keep it as 32bit) doesn't seem to repair the file(it previews fine in windows and other image editors, but is still unloadable with stb).
I'm satisfied with the returned error, so I'll close this issue unless you want to try and make stb tolerate this file?
it opens correctly in mspaint and photoshop and FreeImage, so it's probably worth fixing it. it appears to have extra data in the header, and instead of skipping that data, stb_image throws an error.
I would like to contribute to solve this issue. So if possible, can you please assign this issue to me and help me with some resources for the issue?
[i edited out the tag spam, but it's too late to stop the notification spam, sorry everybody -- nothings]
dude, why are you tagging a bunch of people? that's spam.
i don't use github assignment to outsider contributors, if you want to work on it, work on it. you can ask for help in the discussion forum, but no guarantee anybody will answer.
@sharmadhiraj86
Let me be clearer. The thing you did with the list of random contributors is spam and it is not cool and it is the kind of thing that will get you banned from this repository. You get one strike, if you do something like that again you're out.
Feel free to continue participating normally, or if that makes you uncomfortable feel free to stop, whatever, but I have better things to do than police the repository issue comments.
Let me be clearer. The thing you did with the list of random contributors is spam and it is not cool and it is the kind of thing that will get you banned from this repository. You get one strike, if you do something like that again you're out.
Feel free to continue participating normally, or if that makes you uncomfortable feel free to stop, whatever, but I have better things to do than police the repository issue comments.
Sorry for that but I did not know whom to tag who will assign me the issue.
@sharmadhiraj86 As Sean said, you don't need to be assigned. You're free to work on the issue, and open a PR that fixes things.
A fix for this was just added on the dev branch. Will be in the next release.
Fixed in 2.28.
The following gets written to the console after calling stbi_load: Assertion failed: info.offset == s->callback_already_read + (int) (s->img_buffer - s->img_buffer_original) stb_image.h, line 5397
Here is the BMP that triggers the error example_bmp.zip.