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

Unsupported BMP bitfields layout error #6435

Closed
usernamefreaks opened this issue Jul 13, 2022 · 3 comments · Fixed by #6436
Closed

Unsupported BMP bitfields layout error #6435

usernamefreaks opened this issue Jul 13, 2022 · 3 comments · Fixed by #6436
Labels

Comments

@usernamefreaks
Copy link

I have a bitmap that can be opened by Ristretto Image Viewer (a Linux program), but it can't be opened by Pillow. I originally encountered this with Pillow version 5.1.0. I upgraded my package to v8.4.0 to see if the issue would resolve, but the same error is raised. In v8.4.0, this error is raised on line 203 of BmpImagePlugin.py.

Upon closer inspection, it seems that the bitmap file I was trying to open has file_info['header_size'] == 124, file_info['compression'] == 3, file_info['bits'] == 32, and file_info['rgba_mask'] == (0xff000000, 0xff0000, 0xff00, 0xff).

Does my bmp file follow the BMP file format? If so, can it be supported in a future version? Thanks.

@usernamefreaks
Copy link
Author

I can provide more information if needed.

@radarhere
Copy link
Member

Your BMP file seems perfectly valid to me. I've created PR #6436 to add support for it.

It would be ideal if you could take that branch, install Pillow from it, and load your image. That would just confirm that there aren't any other surprises. Alternatively, you could upload your image here.

@usernamefreaks
Copy link
Author

Yep, everything works now after I applied your PR #6436. I will use this diff for now. Thank you!

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

Successfully merging a pull request may close this issue.

2 participants