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

Bugfix - Fix pallete size calculation #87

Merged

Conversation

Martinius79
Copy link
Contributor

Fixed calculation of palette size for most palettized bitmaps.

2^bitDepth (pow(2, bitDepth) is correct (as mentioned in the comment), but bitDepth*bitDepth was used instead, which only displayed BMPs with 64 colors or fewer correctly.

The calculation is necessary because the paletteSize field in the DIB header is often not filled correctly by most image libraries/tools, so when 0 is read, the calculation was wrong, leading to strange colors for palettized BMPs with more than 64 colors.

@aly-fly aly-fly merged commit 4b23b15 into SmittyHalibut:main Sep 19, 2024
2 checks passed
@Martinius79 Martinius79 deleted the bugfix/FixPalleteSizeCalculation branch September 19, 2024 08:45
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.

2 participants