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

Fix #2467 bmp encoding issue for BMP with 1 bit per pixel and more pixels per row than divisible by 8. #2471

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed bug in Write1BitPixelData that wrote too many bits to the byte
  • Loading branch information
synercoder committed Jun 7, 2023
commit b29cd27c1031a08fb78c50658fed9c8fabf23181
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ private void Write1BitPixelData<TPixel>(Configuration configuration, Stream stre

if (quantizedPixelRow.Length % 8 != 0)
{
int startIdx = quantizedPixelRow.Length - 7;
int startIdx = quantizedPixelRow.Length - (quantizedPixelRow.Length % 8);
endIdx = quantizedPixelRow.Length;
Write1BitPalette(stream, startIdx, endIdx, quantizedPixelRow);
}
Expand Down