Fixed terrible bug in writer method

This commit is contained in:
Leonetienne 2022-03-06 17:08:15 +01:00
parent 01b3144d6c
commit d5a1e4f93f

View File

@ -86,12 +86,13 @@ namespace Leonetienne::BmpPP {
break; break;
} }
}
// Add row padding // Add row padding
// Since we have to pad to a multiple of 4, the padding will never be more than four bytes // Since we have to pad to a multiple of 4, the padding will never be more than four bytes
for (std::size_t i = 0; i < paddingBytesPerRow; i++) for (std::size_t i = 0; i < paddingBytesPerRow; i++)
packedPixels.insert(packedPixels.cend(), 0x0); packedPixels.insert(packedPixels.cend(), 0x0);
} }
}
// Now we can finally set the fileSize field in the file header, // Now we can finally set the fileSize field in the file header,
// and the pixelArraySize in the dib header // and the pixelArraySize in the dib header