@@ -67,6 +67,12 @@ public partial class PngDecoderTests
6767 TestImages . Png . GrayTrns16BitInterlaced
6868 } ;
6969
70+ public static readonly string [ ] TestImagesGrayAlpha8Bit =
71+ {
72+ TestImages . Png . GrayAlpha8Bit ,
73+ TestImages . Png . GrayAlpha8Bit2
74+ } ;
75+
7076 public static readonly TheoryData < string , int , int , PixelResolutionUnit > RatioFiles =
7177 new TheoryData < string , int , int , PixelResolutionUnit >
7278 {
@@ -123,6 +129,18 @@ public void Decode_64Bpp<TPixel>(TestImageProvider<TPixel> provider)
123129 }
124130 }
125131
132+ [ Theory ]
133+ [ WithFileCollection ( nameof ( TestImagesGrayAlpha8Bit ) , PixelTypes . Rgba32 ) ]
134+ public void Decoder_Gray8bitWithAlpha < TPixel > ( TestImageProvider < TPixel > provider )
135+ where TPixel : struct , IPixel < TPixel >
136+ {
137+ using ( Image < TPixel > image = provider . GetImage ( new PngDecoder ( ) ) )
138+ {
139+ image . DebugSave ( provider ) ;
140+ image . CompareToOriginal ( provider , ImageComparer . Exact ) ;
141+ }
142+ }
143+
126144 [ Theory ]
127145 [ WithFileCollection ( nameof ( TestImagesGray16Bit ) , PixelTypes . Rgb48 ) ]
128146 public void Decode_Gray16Bit < TPixel > ( TestImageProvider < TPixel > provider )
@@ -159,6 +177,18 @@ public void Decoder_IsNotBoundToSinglePixelType<TPixel>(TestImageProvider<TPixel
159177 }
160178 }
161179
180+ [ Theory ]
181+ [ WithFile ( TestImages . Png . GrayAlpha8Bit2 , PixelTypes ) ]
182+ public void Decoder_CanDecodeGrey8bitWithAlpha < TPixel > ( TestImageProvider < TPixel > provider )
183+ where TPixel : struct , IPixel < TPixel >
184+ {
185+ using ( Image < TPixel > image = provider . GetImage ( new PngDecoder ( ) ) )
186+ {
187+ image . DebugSave ( provider ) ;
188+ image . CompareToOriginal ( provider , ImageComparer . Exact ) ;
189+ }
190+ }
191+
162192 [ Fact ]
163193 public void Decode_IgnoreMetadataIsFalse_TextChunckIsRead ( )
164194 {
0 commit comments