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

Fixing the calculation of the padding suffix; removing an incorrect c… #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janert
Copy link

@janert janert commented Sep 30, 2022

Two changes:

  • Fixed the calculation of the padding suffix. The existing one is incorrect, I believe, but gave the correct results for images with an even width, but it fails for odd-sized images. I give two fixes, one based on the original calculation, and one using a different calculation that I find easier to understand.
  • Removed an unnecessary and incorrect cast when writing the image size. The current cast limits the size of output images, and does not agree with the type definition in the BMP header, anyway.

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.

1 participant