Fix issue with writing BMP images

This commit is contained in:
ds5678 2025-10-19 13:07:13 -07:00
parent 09221814d6
commit 07d415a794

View File

@ -129,10 +129,18 @@ public sealed class DirectBitmap<TColor, TChannel> : DirectBitmap
public override void SaveAsBmp(Stream stream)
{
if (UseFastBmp)
{
if (typeof(TColor) == typeof(ColorBGRA32))
{
BmpWriter.WriteBmp(Data, Width, Height * Depth, stream);
}
else
{
RgbConverter.Convert<TColor, TChannel, ColorBGRA32, byte>(Bits, Width, Height * Depth, out byte[] data);
BmpWriter.WriteBmp(data, Width, Height * Depth, stream);
}
}
else
{
GetDataAndComponentsForSaving(out byte[] data, out ColorComponents components);
lock (imageWriter)