Browse Source

Add test for issue 2629

pull/2643/head
Brian Popow 2 years ago
parent
commit
1c2bfd8ebf
  1. 16
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/issues/Issue2629.tga

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

@ -1,7 +1,6 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Formats;
@ -724,7 +723,7 @@ public class TgaDecoderTests
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder.Instance))
{
// Using here the reference output instead of the the reference decoder,
// Using here the reference output instead of the reference decoder,
// because the reference decoder does not ignore the alpha data here.
image.DebugSave(provider);
image.CompareToReferenceOutput(ImageComparer.Exact, provider);
@ -771,6 +770,19 @@ public class TgaDecoderTests
appendPixelTypeToFileName: false);
}
// https://github.com/SixLabors/ImageSharp/issues/2629
[Theory]
[WithFile(Issue2629, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Issue2629<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder.Instance))
{
image.DebugSave(provider);
ImageComparingUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit16BottomLeft, PixelTypes.Rgba32)]
[WithFile(Bit24BottomLeft, PixelTypes.Rgba32)]

2
tests/ImageSharp.Tests/TestImages.cs

@ -617,6 +617,8 @@ public static class TestImages
public const string Github_RLE_legacy = "Tga/Github_RLE_legacy.tga";
public const string WhiteStripesPattern = "Tga/whitestripes.png";
public const string Issue2629 = "Tga/issues/Issue2629.tga";
}
public static class Webp

3
tests/Images/Input/Tga/issues/Issue2629.tga

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