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

Image Alignment Issue w/ Some PNG files #105

Open
NOOBDY opened this issue Feb 11, 2024 · 0 comments
Open

Image Alignment Issue w/ Some PNG files #105

NOOBDY opened this issue Feb 11, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@NOOBDY
Copy link
Member

NOOBDY commented Feb 11, 2024

Problem

PNG/JPG files converted from GIF (from this website) has alignment issues when displayed on screen. However, BMP files converted with the same method doesn't have these issues.

Adding glPixelStorei(GL_UNPACK_ALIGNMENT, 1) before glTexImage2D fixes the issue with PNG/JPG files, but breaks BMP files. Also, glPixelStorei(GL_UNPACK_ALIGNMENT, 1) doesn't seems to have any affect on images that are not converted from GIFs.

Demo

PNG w/o glPixelStorei(GL_UNPACK_ALIGNMENT, 1)

image

PNG w/ glPixelStorei(GL_UNPACK_ALIGNMENT, 1)

image

BMP w/o glPixelStorei(GL_UNPACK_ALIGNMENT, 1)

image

BMP w/ glPixelStorei(GL_UNPACK_ALIGNMENT, 1)

image

Proposed Workaround

Use BMP when converting from GIFs

@NOOBDY NOOBDY added the bug Something isn't working label Feb 11, 2024
@NOOBDY NOOBDY added the help wanted Extra attention is needed label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: 🆕 Backlog
Development

No branches or pull requests

1 participant