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

Account for big endian support for RGB/BGR images #1930

Merged
merged 1 commit into from Jun 8, 2020

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Jun 8, 2020

Add big endian blocks in image_frombuffer() for RGB and BGR images,
similarly to how RGBA are handled. This also seems to match examples
in SDL documentation. This fixes test_frombuffer_BGR
and test_frombuffer_RGB on big endian machines (see #1291).

Disclaimer: my big endian hardware is headless and I haven't looked at X forwarding yet, so I have no clue if this works correctly, or if both the tests and the code are doing it other way around ;-).

Copy link
Contributor

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to my eyes, hopefully the CI will agree. 👍

@MyreMylar
Copy link
Contributor

Probably, a good idea to get the other PR adding the big endian test machine to Travis merged, and then merge master into this PR to get useful data from CI.

@mgorny
Copy link
Contributor Author

mgorny commented Jun 8, 2020

Sure, I can update it when the other PR is merged, or feel free to push to my branch.

@MyreMylar
Copy link
Contributor

OK, the other PR is merged to master now.

Add big endian blocks in image_frombuffer() for RGB and BGR images,
similarly to how RGBA are handled.  This also seems to match examples
in SDL documentation.  This fixes test_frombuffer_BGR
and test_frombuffer_RGB on big endian machines (see pygame#1291).
@mgorny
Copy link
Contributor Author

mgorny commented Jun 8, 2020

Rebased now.

@MyreMylar
Copy link
Contributor

Looks like it worked on Travis CI, I only see 1 error left there now 🎉 👍

@MyreMylar MyreMylar merged commit f17913d into pygame:master Jun 8, 2020
@illume illume added the image pygame.image label Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
image pygame.image
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants