Browse Source

renaming, add fax3 test file

pull/1760/head
Ildar Khayrutdinov 5 years ago
parent
commit
d1e778f097
  1. 10
      tests/ImageSharp.Tests/Formats/Tiff/BigTiffDecoderTests.cs
  2. 5
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsBlack_Fax3.tiff
  4. 0
      tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsBlack_RLE.tif
  5. 0
      tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsWhite_RLE.tif

10
tests/ImageSharp.Tests/Formats/Tiff/BigTiffDecoderTests.cs

@ -31,6 +31,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff
[WithFile(BigTIFFSubIFD8, PixelTypes.Rgba32)] [WithFile(BigTIFFSubIFD8, PixelTypes.Rgba32)]
[WithFile(Indexed4_Deflate, PixelTypes.Rgba32)] [WithFile(Indexed4_Deflate, PixelTypes.Rgba32)]
[WithFile(Indexed8_LZW, PixelTypes.Rgba32)] [WithFile(Indexed8_LZW, PixelTypes.Rgba32)]
[WithFile(MinIsBlack_Fax3, PixelTypes.Rgba32)]
public void TiffDecoder_CanDecode<TPixel>(TestImageProvider<TPixel> provider) public void TiffDecoder_CanDecode<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider); where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider);
@ -40,8 +41,8 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff
where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<NotSupportedException>(() => provider.GetImage(TiffDecoder)); where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<NotSupportedException>(() => provider.GetImage(TiffDecoder));
[Theory] [Theory]
[WithFile(MinInWhite_RLE, PixelTypes.Rgba32)] [WithFile(MinIsWhite_RLE, PixelTypes.Rgba32)]
[WithFile(MinInBlack_RLE, PixelTypes.Rgba32)] [WithFile(MinIsBlack_RLE, PixelTypes.Rgba32)]
public void ProblemFiles<TPixel>(TestImageProvider<TPixel> provider) public void ProblemFiles<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<ImageDifferenceIsOverThresholdException>(() => TestTiffDecoder(provider)); where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<ImageDifferenceIsOverThresholdException>(() => TestTiffDecoder(provider));
@ -55,8 +56,9 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff
[InlineData(BigTIFFSubIFD8, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(BigTIFFSubIFD8, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(Indexed4_Deflate, 4, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(Indexed4_Deflate, 4, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(Indexed8_LZW, 8, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(Indexed8_LZW, 8, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(MinInWhite_RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(MinIsWhite_RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(MinInBlack_RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(MinIsBlack_RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(MinIsBlack_Fax3, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)]
public void Identify(string imagePath, int expectedPixelSize, int expectedWidth, int expectedHeight, double expectedHResolution, double expectedVResolution, PixelResolutionUnit expectedResolutionUnit) public void Identify(string imagePath, int expectedPixelSize, int expectedWidth, int expectedHeight, double expectedHResolution, double expectedVResolution, PixelResolutionUnit expectedResolutionUnit)
{ {
var testFile = TestFile.Create(imagePath); var testFile = TestFile.Create(imagePath);

5
tests/ImageSharp.Tests/TestImages.cs

@ -689,8 +689,9 @@ namespace SixLabors.ImageSharp.Tests
public const string Indexed4_Deflate = Base + "BigTIFF_Indexed4_Deflate.tif"; public const string Indexed4_Deflate = Base + "BigTIFF_Indexed4_Deflate.tif";
public const string Indexed8_LZW = Base + "BigTIFF_Indexed8_LZW.tif"; public const string Indexed8_LZW = Base + "BigTIFF_Indexed8_LZW.tif";
public const string MinInWhite_RLE = Base + "BigTIFF_MinInWhite_RLE.tif"; public const string MinIsWhite_RLE = Base + "BigTIFF_MinIsWhite_RLE.tif";
public const string MinInBlack_RLE = Base + "BigTIFF_MinInBlack_RLE.tif"; public const string MinIsBlack_RLE = Base + "BigTIFF_MinIsBlack_RLE.tif";
public const string MinIsBlack_Fax3 = Base + "BigTIFF_MinIsBlack_Fax3.tif";
} }
} }
} }

3
tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsBlack_Fax3.tiff

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3853a4850a023bce431bc224145f47e095e9910cddce9ba5fcaf496c9d385e04
size 564

0
tests/Images/Input/Tiff/BigTiff/BigTIFF_MinInBlack_RLE.tif → tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsBlack_RLE.tif

0
tests/Images/Input/Tiff/BigTiff/BigTIFF_MinInWhite_RLE.tif → tests/Images/Input/Tiff/BigTiff/BigTIFF_MinIsWhite_RLE.tif

Loading…
Cancel
Save