Skip to content

Commit 1c2bfd8

Browse files
committed
Add test for issue 2629
1 parent 84a7988 commit 1c2bfd8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using System.Runtime.InteropServices;
54
using System.Runtime.Intrinsics.X86;
65
using Microsoft.DotNet.RemoteExecutor;
76
using SixLabors.ImageSharp.Formats;
@@ -724,7 +723,7 @@ public void TgaDecoder_CanDecode_WhenAlphaBitsNotSet<TPixel>(TestImageProvider<T
724723
{
725724
using (Image<TPixel> image = provider.GetImage(TgaDecoder.Instance))
726725
{
727-
// Using here the reference output instead of the the reference decoder,
726+
// Using here the reference output instead of the reference decoder,
728727
// because the reference decoder does not ignore the alpha data here.
729728
image.DebugSave(provider);
730729
image.CompareToReferenceOutput(ImageComparer.Exact, provider);
@@ -771,6 +770,19 @@ public void TgaDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
771770
appendPixelTypeToFileName: false);
772771
}
773772

773+
// https://github.com/SixLabors/ImageSharp/issues/2629
774+
[Theory]
775+
[WithFile(Issue2629, PixelTypes.Rgba32)]
776+
public void TgaDecoder_CanDecode_Issue2629<TPixel>(TestImageProvider<TPixel> provider)
777+
where TPixel : unmanaged, IPixel<TPixel>
778+
{
779+
using (Image<TPixel> image = provider.GetImage(TgaDecoder.Instance))
780+
{
781+
image.DebugSave(provider);
782+
ImageComparingUtils.CompareWithReferenceDecoder(provider, image);
783+
}
784+
}
785+
774786
[Theory]
775787
[WithFile(Bit16BottomLeft, PixelTypes.Rgba32)]
776788
[WithFile(Bit24BottomLeft, PixelTypes.Rgba32)]

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ public static class Tga
617617

618618
public const string Github_RLE_legacy = "Tga/Github_RLE_legacy.tga";
619619
public const string WhiteStripesPattern = "Tga/whitestripes.png";
620+
621+
public const string Issue2629 = "Tga/issues/Issue2629.tga";
620622
}
621623

622624
public static class Webp
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:defc1396481f426a74e8af51ed57f65cbed932f932673ce5a87fa12ea9b460f8
3+
size 32786

0 commit comments

Comments
 (0)