From 2c20d845ebe9536b8f4f6eee382597ca76b9aacf Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 11 Jan 2017 06:50:13 +0400 Subject: [PATCH] (AJP): fixed images without alpha-channel. --- ArcFormats/AliceSoft/ImageAJP.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArcFormats/AliceSoft/ImageAJP.cs b/ArcFormats/AliceSoft/ImageAJP.cs index 29fe53df..9051040c 100644 --- a/ArcFormats/AliceSoft/ImageAJP.cs +++ b/ArcFormats/AliceSoft/ImageAJP.cs @@ -78,6 +78,11 @@ namespace GameRes.Formats.AliceSoft var decoder = new JpegBitmapDecoder (jpeg, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); BitmapSource bitmap = decoder.Frames[0]; + if (0 == meta.AlphaOffset || 0 == meta.AlphaSize) + { + bitmap.Freeze(); + return new ImageData (bitmap, info); + } if (bitmap.Format.BitsPerPixel != 32) bitmap = new FormatConvertedBitmap (bitmap, PixelFormats.Bgr32, null, 0);