Browse Source

Added compressed grayscale 16 bit decoder tests

pull/2339/head
Petar Tasev 3 years ago
parent
commit
a43ac0cf53
  1. 5
      tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
  2. 3
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tiff/Calliphora_gray_deflate_16bit.tiff
  4. 3
      tests/Images/Input/Tiff/Calliphora_gray_deflate_predictor_16bit.tiff
  5. 3
      tests/Images/Input/Tiff/Calliphora_gray_lzw_predictor_16bit.tiff

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

@ -35,7 +35,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester
using MemoryStream stream = new(testFile.Bytes, false);
ImageInfo info = Image.Identify(stream);
Assert.Equal(expectedPixelSize, info.PixelType?.BitsPerPixel);
Assert.Equal(expectedPixelSize, info.PixelType.BitsPerPixel);
Assert.Equal(expectedWidth, info.Width);
Assert.Equal(expectedHeight, info.Height);
Assert.NotNull(info.Metadata);
@ -601,6 +601,8 @@ public class TiffDecoderTests : TiffDecoderBaseTester
[WithFile(RgbDeflateMultistrip, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleDeflate, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleDeflate_Predictor, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleDeflate16Bit, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleDeflate_Predictor16Bit, PixelTypes.Rgba32)]
[WithFile(Calliphora_RgbDeflate_Predictor, PixelTypes.Rgba32)]
[WithFile(RgbDeflate, PixelTypes.Rgba32)]
[WithFile(RgbDeflatePredictor, PixelTypes.Rgba32)]
@ -617,6 +619,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester
[WithFile(Calliphora_RgbPaletteLzw_Predictor, PixelTypes.Rgba32)]
[WithFile(Calliphora_RgbLzwPredictor, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleLzw_Predictor, PixelTypes.Rgba32)]
[WithFile(Calliphora_GrayscaleLzw_Predictor16Bit, PixelTypes.Rgba32)]
[WithFile(SmallRgbLzw, PixelTypes.Rgba32)]
public void TiffDecoder_CanDecode_LzwCompressed<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);

3
tests/ImageSharp.Tests/TestImages.cs

@ -768,6 +768,9 @@ public static class TestImages
public const string Calliphora_GrayscaleLzw_Predictor = "Tiff/Calliphora_gray_lzw_predictor.tiff";
public const string Calliphora_GrayscaleDeflate = "Tiff/Calliphora_gray_deflate.tiff";
public const string Calliphora_GrayscaleUncompressed16Bit = "Tiff/Calliphora_grayscale_uncompressed_16bit.tiff";
public const string Calliphora_GrayscaleDeflate_Predictor16Bit = "Tiff/Calliphora_gray_deflate_predictor_16bit.tiff";
public const string Calliphora_GrayscaleLzw_Predictor16Bit = "Tiff/Calliphora_gray_lzw_predictor_16bit.tiff";
public const string Calliphora_GrayscaleDeflate16Bit = "Tiff/Calliphora_gray_deflate_16bit.tiff";
public const string Calliphora_RgbDeflate_Predictor = "Tiff/Calliphora_rgb_deflate_predictor.tiff";
public const string Calliphora_RgbJpeg = "Tiff/Calliphora_rgb_jpeg.tiff";
public const string Calliphora_PaletteUncompressed = "Tiff/Calliphora_palette_uncompressed.tiff";

3
tests/Images/Input/Tiff/Calliphora_gray_deflate_16bit.tiff

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4fdf62eb43c0349cb8c6ad67e5389a0f307944d8a8e760667a7f78fcc48a9ffa
size 62698

3
tests/Images/Input/Tiff/Calliphora_gray_deflate_predictor_16bit.tiff

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8040010e7f760d09dda49145050b07f32826037c11686d976b4b7949a0c40c18
size 54086

3
tests/Images/Input/Tiff/Calliphora_gray_lzw_predictor_16bit.tiff

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67246d3bfc0c361fae21db04fa0251168c7e12abe3c3cc134cd1d685fb09876f
size 58392
Loading…
Cancel
Save