Browse Source

report problem files

pull/1760/head
Ildar Khayrutdinov 5 years ago
parent
commit
8b7aaba615
  1. 11
      tests/ImageSharp.Tests/Formats/Tiff/BigTiffDecoderTests.cs
  2. 3
      tests/ImageSharp.Tests/TestImages.cs
  3. 0
      tests/Images/Input/Tiff/BigTiff/BigTIFF_MinInBlack_RLE.tif
  4. 3
      tests/Images/Input/Tiff/BigTiff/BigTIFF_MinInWhite_RLE.tif

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

@ -12,6 +12,7 @@ using SixLabors.ImageSharp.PixelFormats;
using Xunit; using Xunit;
using static SixLabors.ImageSharp.Tests.TestImages.BigTiff; using static SixLabors.ImageSharp.Tests.TestImages.BigTiff;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
namespace SixLabors.ImageSharp.Tests.Formats.Tiff namespace SixLabors.ImageSharp.Tests.Formats.Tiff
{ {
@ -30,7 +31,6 @@ 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(RLE, 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);
@ -39,6 +39,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tiff
public void ThrowsNotSupported<TPixel>(TestImageProvider<TPixel> provider) public void ThrowsNotSupported<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<NotSupportedException>(() => provider.GetImage(TiffDecoder)); where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<NotSupportedException>(() => provider.GetImage(TiffDecoder));
[Theory]
[WithFile(MinInWhite_RLE, PixelTypes.Rgba32)]
[WithFile(MinInBlack_RLE, PixelTypes.Rgba32)]
public void ProblemFiles<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<ImageDifferenceIsOverThresholdException>(() => TestTiffDecoder(provider));
[Theory] [Theory]
[InlineData(BigTIFF, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(BigTIFF, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(BigTIFFLong, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(BigTIFFLong, 24, 64, 64, 96, 96, PixelResolutionUnit.PixelsPerInch)]
@ -49,7 +55,8 @@ 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(RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)] [InlineData(MinInWhite_RLE, 1, 32, 32, 96, 96, PixelResolutionUnit.PixelsPerInch)]
[InlineData(MinInBlack_RLE, 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);

3
tests/ImageSharp.Tests/TestImages.cs

@ -689,7 +689,8 @@ 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 RLE = Base + "BigTIFF_RLE.tif"; public const string MinInWhite_RLE = Base + "BigTIFF_MinInWhite_RLE.tif";
public const string MinInBlack_RLE = Base + "BigTIFF_MinInBlack_RLE.tif";
} }
} }
} }

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

3
tests/Images/Input/Tiff/BigTiff/BigTIFF_MinInWhite_RLE.tif

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