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

stbi: fix loading images from memory #16561

Conversation

markus-oberhumer-forks
Copy link
Contributor

This is similar to the (reverted) issue #15981, but it only addresses the core problem (stbi bug) which seems to return a wrong nr_channels for PNG images with a color palette.

Without this fix I get the following error (Fedora Linux):

sg_image_data: data size doesn't match expected surface size
^^^^ SOKOL-GFX VALIDATION FAILED, TERMINATING ^^^^

This is similar to the (reverted) issue vlang#15981, but it only addresses the
core problem (stbi bug) which seems to return a wrong nr_channels for
PNG images with a color palette.

Without this fix I get the following error (Fedora Linux):

  sg_image_data: data size doesn't match expected surface size
  ^^^^  SOKOL-GFX VALIDATION FAILED, TERMINATING ^^^^
@larpon
Copy link
Contributor

larpon commented Dec 1, 2022

@spytheman I think this can be closed in favour of #16564

@medvednikov medvednikov closed this Dec 1, 2022
@medvednikov
Copy link
Member

Thanks @markus-oberhumer

I've just merged #16564, it should fix it. Can you please try again?

@markus-oberhumer
Copy link
Contributor

Yes, #16564 fixes the problem for me. Thanks!

@markus-oberhumer-forks markus-oberhumer-forks deleted the fix-stbi-png-channels-bug branch December 1, 2022 17:41
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

Successfully merging this pull request may close these issues.

4 participants