Skip to content

Commit ef4c42f

Browse files
EvgenyB1001iText-CI
authored andcommitted
Add tests for grayscale alpha png without embedded profile
DEVSIX-3810 Autoported commit. Original commit hash: [e2d13814a]
1 parent 0282bb8 commit ef4c42f

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

itext.tests/itext.io.tests/itext/io/image/PngTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,21 @@ public virtual void Graya8BpcDepthImageTest() {
6565
NUnit.Framework.Assert.AreEqual(8, img.GetImageMask().GetBpc());
6666
}
6767

68+
[NUnit.Framework.Test]
69+
public virtual void Graya8BpcDepthWithoutEmbeddedProfileImageTest() {
70+
ImageData img = ImageDataFactory.Create(sourceFolder + "graya8BpcWithoutProfile.png");
71+
NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType());
72+
NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0);
73+
NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0);
74+
NUnit.Framework.Assert.AreEqual(8, img.GetBpc());
75+
NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace());
76+
NUnit.Framework.Assert.AreEqual(4, ((PngImageData)img).GetColorType());
77+
NUnit.Framework.Assert.IsNotNull(img.GetImageMask());
78+
NUnit.Framework.Assert.AreEqual(1, img.GetImageMask().GetColorSpace());
79+
NUnit.Framework.Assert.AreEqual(8, img.GetImageMask().GetBpc());
80+
NUnit.Framework.Assert.IsNull(img.GetProfile());
81+
}
82+
6883
[NUnit.Framework.Test]
6984
public virtual void Graya8BpcAddColorToAlphaImageTest() {
7085
ImageData img = ImageDataFactory.Create(sourceFolder + "graya8BpcAddColorToAlpha.png");
1.8 KB
Loading

itext.tests/itext.kernel.tests/itext/kernel/pdf/xobject/PdfImageXObjectTest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ public virtual void GrayAlphaPngImageXObjectTest() {
9999
"graya8Bpc.png");
100100
}
101101

102+
[NUnit.Framework.Test]
103+
public virtual void GrayAlphaPngWithoutEmbeddedProfileImageXObjectTest() {
104+
// TODO DEVSIX-1313
105+
// Update cmp file after the specified ticket will be resolved
106+
ConvertAndCompare(destinationFolder + "graya8BpcWithoutProfile.pdf", sourceFolder + "cmp_graya8BpcWithoutProfile.pdf"
107+
, sourceFolder + "graya8BpcWithoutProfile.png");
108+
}
109+
102110
[NUnit.Framework.Test]
103111
public virtual void GraySimpleTransparencyPngImageXObjectTest() {
104112
ConvertAndCompare(destinationFolder + "grayscaleSimpleTransparencyImage.pdf", sourceFolder + "cmp_grayscaleSimpleTransparencyImage.pdf"
Loading

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9a233f1e4fde03c882c7b29a81f9524137a3a8b2
1+
e2d13814ae06493ffa297b910060b2401eb259aa

0 commit comments

Comments
 (0)