Browse Source

Add test for legacy tga format

pull/2197/head
Brian Popow 4 years ago
parent
commit
57c21370a1
  1. 14
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/Github_RLE_legacy.tga

14
tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs

@ -733,6 +733,20 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
// Test case for legacy format, when RLE crosses multiple lines:
// https://github.com/SixLabors/ImageSharp/pull/2172
[Theory]
[WithFile(Github_RLE_legacy, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_LegacyFormat<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
ImageComparingUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit16BottomLeft, PixelTypes.Rgba32)]
[WithFile(Bit24BottomLeft, PixelTypes.Rgba32)]

2
tests/ImageSharp.Tests/TestImages.cs

@ -544,6 +544,8 @@ namespace SixLabors.ImageSharp.Tests
public const string NoAlphaBits16BitRle = "Tga/16bit_rle_noalphabits.tga";
public const string NoAlphaBits32Bit = "Tga/32bit_no_alphabits.tga";
public const string NoAlphaBits32BitRle = "Tga/32bit_rle_no_alphabits.tga";
public const string Github_RLE_legacy = "Tga/Github_RLE_legacy.tga";
}
public static class Webp

3
tests/Images/Input/Tga/Github_RLE_legacy.tga

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