Skip to content

Commit a43ac0c

Browse files
committed
Added compressed grayscale 16 bit decoder tests
1 parent bd9e1ee commit a43ac0c

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void Identify(string imagePath, int expectedPixelSize, int expectedWidth,
3535
using MemoryStream stream = new(testFile.Bytes, false);
3636
ImageInfo info = Image.Identify(stream);
3737

38-
Assert.Equal(expectedPixelSize, info.PixelType?.BitsPerPixel);
38+
Assert.Equal(expectedPixelSize, info.PixelType.BitsPerPixel);
3939
Assert.Equal(expectedWidth, info.Width);
4040
Assert.Equal(expectedHeight, info.Height);
4141
Assert.NotNull(info.Metadata);
@@ -601,6 +601,8 @@ public void TiffDecoder_CanDecode_128Bit_WithUnassociatedAlpha<TPixel>(TestImage
601601
[WithFile(RgbDeflateMultistrip, PixelTypes.Rgba32)]
602602
[WithFile(Calliphora_GrayscaleDeflate, PixelTypes.Rgba32)]
603603
[WithFile(Calliphora_GrayscaleDeflate_Predictor, PixelTypes.Rgba32)]
604+
[WithFile(Calliphora_GrayscaleDeflate16Bit, PixelTypes.Rgba32)]
605+
[WithFile(Calliphora_GrayscaleDeflate_Predictor16Bit, PixelTypes.Rgba32)]
604606
[WithFile(Calliphora_RgbDeflate_Predictor, PixelTypes.Rgba32)]
605607
[WithFile(RgbDeflate, PixelTypes.Rgba32)]
606608
[WithFile(RgbDeflatePredictor, PixelTypes.Rgba32)]
@@ -617,6 +619,7 @@ public void TiffDecoder_CanDecode_DeflateCompressed<TPixel>(TestImageProvider<TP
617619
[WithFile(Calliphora_RgbPaletteLzw_Predictor, PixelTypes.Rgba32)]
618620
[WithFile(Calliphora_RgbLzwPredictor, PixelTypes.Rgba32)]
619621
[WithFile(Calliphora_GrayscaleLzw_Predictor, PixelTypes.Rgba32)]
622+
[WithFile(Calliphora_GrayscaleLzw_Predictor16Bit, PixelTypes.Rgba32)]
620623
[WithFile(SmallRgbLzw, PixelTypes.Rgba32)]
621624
public void TiffDecoder_CanDecode_LzwCompressed<TPixel>(TestImageProvider<TPixel> provider)
622625
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ public static class Tiff
768768
public const string Calliphora_GrayscaleLzw_Predictor = "Tiff/Calliphora_gray_lzw_predictor.tiff";
769769
public const string Calliphora_GrayscaleDeflate = "Tiff/Calliphora_gray_deflate.tiff";
770770
public const string Calliphora_GrayscaleUncompressed16Bit = "Tiff/Calliphora_grayscale_uncompressed_16bit.tiff";
771+
public const string Calliphora_GrayscaleDeflate_Predictor16Bit = "Tiff/Calliphora_gray_deflate_predictor_16bit.tiff";
772+
public const string Calliphora_GrayscaleLzw_Predictor16Bit = "Tiff/Calliphora_gray_lzw_predictor_16bit.tiff";
773+
public const string Calliphora_GrayscaleDeflate16Bit = "Tiff/Calliphora_gray_deflate_16bit.tiff";
771774
public const string Calliphora_RgbDeflate_Predictor = "Tiff/Calliphora_rgb_deflate_predictor.tiff";
772775
public const string Calliphora_RgbJpeg = "Tiff/Calliphora_rgb_jpeg.tiff";
773776
public const string Calliphora_PaletteUncompressed = "Tiff/Calliphora_palette_uncompressed.tiff";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4fdf62eb43c0349cb8c6ad67e5389a0f307944d8a8e760667a7f78fcc48a9ffa
3+
size 62698
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:8040010e7f760d09dda49145050b07f32826037c11686d976b4b7949a0c40c18
3+
size 54086
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:67246d3bfc0c361fae21db04fa0251168c7e12abe3c3cc134cd1d685fb09876f
3+
size 58392

0 commit comments

Comments
 (0)