Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMG_Load_RW can't load images not divisible by 8, but IMG_Load can #367

Open
FrostKiwi opened this issue Jun 11, 2023 · 0 comments
Open

Comments

@FrostKiwi
Copy link

I'm having a strange problem with my emscripten, C program, which loads images to display via WebGL 1.0. The images I have in the virtual filesystem of emscripten and load via IMG_Load here. Works fine, even for NPOT textures and dimensions not divisible by 8. I even made sure WebGL doesn't complain with glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

However, users are supposed to upload their own images, which I receive in a memory buffer and load via IMG_Load_RW here, which receives a buffer of the file uploaded here. The images loaded with that function however, have their memory alignment mangled. I get skewed images, ones with RGB boundaries mixed up ending in a rainbow mess, etc.
So I'm confused what I'm doing wrong, if IMG_Load works fine and loads everything perfectly, why does does loading from memory via IMG_Load_RW fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant