Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Feb 4, 2025
2 parents 2223518 + 0374697 commit d51e70e
Show file tree
Hide file tree
Showing 70 changed files with 935 additions and 121 deletions.
10 changes: 2 additions & 8 deletions itext.tests/itext.svg.tests/itext/svg/renderers/OpacityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public virtual void TestRGBA() {

[NUnit.Framework.Test]
public virtual void TestFillOpacityWithComma() {
//TODO DEVSIX-2678 SVG: Displaying invalid value of fill-opacity incorrectly
NUnit.Framework.Assert.Catch(typeof(FormatException), () => ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER
, "testFillOpacityWithComma"));
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "testFillOpacityWithComma");
}

[NUnit.Framework.Test]
Expand All @@ -72,15 +70,12 @@ public virtual void TestFillOpacityWithPercents() {

[NUnit.Framework.Test]
public virtual void TestFillOpacity() {
//TODO: update after DEVSIX-2678 fix
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "svg_fill_opacity");
}

[NUnit.Framework.Test]
public virtual void TestStrokeOpacityWithComma() {
//TODO DEVSIX-2679
NUnit.Framework.Assert.Catch(typeof(Exception), () => ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER,
"testStrokeOpacityWithComma"));
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "testStrokeOpacityWithComma");
}

[NUnit.Framework.Test]
Expand All @@ -90,7 +85,6 @@ public virtual void TestStrokeOpacityWithPercents() {

[NUnit.Framework.Test]
public virtual void TestStrokeOpacity() {
//TODO: update after DEVSIX-2679 fix
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "svg_stroke_opacity");
}
}
Expand Down
108 changes: 108 additions & 0 deletions itext.tests/itext.svg.tests/itext/svg/renderers/VectorEffectTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2025 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Svg.Logs;
using iText.Test;
using iText.Test.Attributes;

namespace iText.Svg.Renderers {
[NUnit.Framework.Category("IntegrationTest")]
public class VectorEffectTest : SvgIntegrationTest {
private static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/svg/renderers/VectorEffectTest/";

private static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/svg/renderers/VectorEffectTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void NonScalingStrokeTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "nonScalingStroke");
}

[NUnit.Framework.Test]
public virtual void NonScalingStrokePathTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "nonScalingStrokePath");
}

[NUnit.Framework.Test]
public virtual void NonScalingStrokeFiguresTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "nonScalingStrokeFigures");
}

[NUnit.Framework.Test]
public virtual void NonScalingStrokeTextTest() {
// TODO DEVSIX-8850 support vector-effect for text and tspan
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "nonScalingStrokeText");
}

[NUnit.Framework.Test]
public virtual void PreserveAspectRatioTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "preserveAspectRatio");
}

[NUnit.Framework.Test]
public virtual void SvgWithSvgTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "svgWithSvg");
}

[NUnit.Framework.Test]
public virtual void SeveralTransformationsTest() {
// TODO DEVSIX-8850 support vector-effect for text and tspan
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "severalTransformations");
}

[NUnit.Framework.Test]
public virtual void SeveralNestedSvgTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "severalNestedSvg");
}

[NUnit.Framework.Test]
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNABLE_TO_RETRIEVE_IMAGE_WITH_GIVEN_BASE_URI
)]
public virtual void ImageWithSvgTest() {
// TODO DEVSIX-8884 Support svg format for image href attribute
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "imageWithSvg");
}

[NUnit.Framework.Test]
public virtual void ClipPathTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "clipPath");
}

[NUnit.Framework.Test]
public virtual void VectorEffectOnUseTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "vectorEffectOnUse");
}

[NUnit.Framework.Test]
[LogMessage(SvgLogMessageConstant.NON_INVERTIBLE_TRANSFORMATION_MATRIX_FOR_NON_SCALING_STROKE)]
public virtual void NonInvertibleMatrixTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "nonInvertibleMatrix");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ public static void BeforeClass() {
ITextTest.CreateDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void EmptyClipPathTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "emptyClipPath");
}

[NUnit.Framework.Test]
public virtual void InvalidClipPathTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "invalidClipPath");
}

[NUnit.Framework.Test]
public virtual void RectClipPathComplexTest() {
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "clippath_rect_complex");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public virtual void SingleImageTest() {
ConvertAndCompareSinglePage(sourceFolder, destinationFolder, "singleImage", properties);
}

[NUnit.Framework.Test]
public virtual void SingleImageHrefTest() {
ConvertAndCompareSinglePage(sourceFolder, destinationFolder, "singleImageHref", properties);
}

[NUnit.Framework.Test]
public virtual void ImageWithRectangleTest() {
ConvertAndCompareSinglePage(sourceFolder, destinationFolder, "imageWithRectangle", properties);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d51e70e

Please sign in to comment.