From fd50e66837341b709644679d3aff3945d73e2592 Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 2 Feb 2018 03:35:54 +0400 Subject: [PATCH] (BMP): additional condition for bitmaps with alpha-channel. --- GameRes/ImageBMP.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GameRes/ImageBMP.cs b/GameRes/ImageBMP.cs index 6addc7e0..8e6abbb8 100644 --- a/GameRes/ImageBMP.cs +++ b/GameRes/ImageBMP.cs @@ -183,9 +183,11 @@ namespace GameRes { return ReadBitmapBGRA (file, info); } - else if (0x18 == info.BPP && (info.ImageLength + width_x_height) == file.Length) + else if (0x18 == info.BPP) { - return ReadBitmapWithAlpha (file, info); + uint length_with_alpha = info.ImageLength + width_x_height; + if (length_with_alpha == file.Length || length_with_alpha + info.Width == file.Length) + return ReadBitmapWithAlpha (file, info); } } }