mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
Fix issue with writing BMP images
This commit is contained in:
parent
09221814d6
commit
07d415a794
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user