(BMP): use image offset stored in header.

This commit is contained in:
morkt
2017-11-12 10:02:21 +04:00
parent dd26dd9ae3
commit 800e69dfcb
2 changed files with 8 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ namespace GameRes.Formats.NekoSDK
if (alpha.Length != alp.Read (alpha, 0, alpha.Length) || alp.ReadByte() != -1)
return null;
}
file.Position = info.HeaderLength;
file.Position = info.ImageOffset;
int dst_stride = (int)info.Width * 4;
int gap = -((int)info.Width * info.BPP / 8) & 3;
var pixels = new byte[(int)info.Height * dst_stride];