Skip to content

Commit c60cae8

Browse files
committed
Tests
1 parent 7e48253 commit c60cae8

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

tests/ImageSharp.Tests/Formats/Pbm/PbmDecoderTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public void ImageLoadRgb24CanDecode(string imagePath)
8181
[Theory]
8282
[WithFile(BlackAndWhitePlain, PixelTypes.L8, "pbm")]
8383
[WithFile(BlackAndWhiteBinary, PixelTypes.L8, "pbm")]
84+
[WithFile(Issue2477, PixelTypes.L8, "pbm")]
8485
[WithFile(GrayscalePlain, PixelTypes.L8, "pgm")]
8586
[WithFile(GrayscalePlainNormalized, PixelTypes.L8, "pgm")]
8687
[WithFile(GrayscaleBinary, PixelTypes.L8, "pgm")]

tests/ImageSharp.Tests/Formats/Pbm/PbmEncoderTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class PbmEncoderTests
2626
{
2727
{ BlackAndWhiteBinary, PbmColorType.BlackAndWhite },
2828
{ BlackAndWhitePlain, PbmColorType.BlackAndWhite },
29+
{ Issue2477, PbmColorType.BlackAndWhite },
2930
{ GrayscaleBinary, PbmColorType.Grayscale },
3031
{ GrayscaleBinaryWide, PbmColorType.Grayscale },
3132
{ GrayscalePlain, PbmColorType.Grayscale },
@@ -96,6 +97,11 @@ public void PbmEncoder_P1_Works<TPixel>(TestImageProvider<TPixel> provider)
9697
public void PbmEncoder_P4_Works<TPixel>(TestImageProvider<TPixel> provider)
9798
where TPixel : unmanaged, IPixel<TPixel> => TestPbmEncoderCore(provider, PbmColorType.BlackAndWhite, PbmEncoding.Binary);
9899

100+
[Theory]
101+
[WithFile(Issue2477, PixelTypes.Rgb24)]
102+
public void PbmEncoder_P4_Irregular_Works<TPixel>(TestImageProvider<TPixel> provider)
103+
where TPixel : unmanaged, IPixel<TPixel> => TestPbmEncoderCore(provider, PbmColorType.BlackAndWhite, PbmEncoding.Binary);
104+
99105
[Theory]
100106
[WithFile(GrayscalePlainMagick, PixelTypes.Rgb24)]
101107
public void PbmEncoder_P2_Works<TPixel>(TestImageProvider<TPixel> provider)

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,5 +1038,6 @@ public static class Pbm
10381038
public const string RgbPlain = "Pbm/rgb_plain.ppm";
10391039
public const string RgbPlainNormalized = "Pbm/rgb_plain_normalized.ppm";
10401040
public const string RgbPlainMagick = "Pbm/rgb_plain_magick.ppm";
1041+
public const string Issue2477 = "Pbm/issue2477.pbm";
10411042
}
10421043
}
Lines changed: 3 additions & 0 deletions
Loading

tests/Images/Input/Pbm/issue2477.pbm

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:d625635f7be760fbea935056c0f6d046832dd74bba33a1597b52ab3dfe0c5e4e
3+
size 4956

0 commit comments

Comments
 (0)