Skip to content

Releases: css4j/echosvg

1.2.3

27 Sep 16:13
v1.2.3
Compare
Choose a tag to compare

New batch of backports from the master branch, with SVG 2.0 compliance fixes and color improvements.

Also fixes a rendering crash when relative URLs read from a jar: file are shorter than 4 characters (for example <use href="#a1">).


Detail of changes

  • bridge: update <use> and <image> nodes on changes to namespaceless href attribute.
  • bridge: detect circularities and non-SVG elements referred by <use>.
  • css: increase the accuracy of color conversions.
  • util: do not crash on jar: relative URLs of less than 4 characters, avoid string creation.
  • Tests: create images with the correct resolution in AbstractImageTranscoderTest.
  • Upgrade to css4j 4.4 (which adds support for the srgb-linear color space).
  • Upgrade Gradle wrapper to 8.10.2.

1.2.2

22 Aug 12:39
v1.2.2
Compare
Choose a tag to compare

As there is still a long way towards the 2.0 version, several SVG compliance fixes were backported from the master branch and are made available here, including an important performance improvement.

Detail of changes

  • anim,bridge: improve lenient parsing, especially that of paths, polygons and polyline points. Paths and point sets are now only parsed once, even if referenced by multiple <use> elements, which fixes an important performance bottleneck.
  • anim: allow unrecognized SVG elements in createElementNS() of SVG 1.1 implementation, aligning it with the 1.2 one.
  • bridge: give EMPTY_SHAPE a smaller footprint.
  • svggen: be a bit more efficient in allocating the rgb() serialization color buffer.
  • i18n: if the resource cannot be loaded, print a warning and return the key.
  • Tests: check embedded profiles in ImageComparator.
  • Upgrade Gradle wrapper to 8.10.
  • Upgrade to JUnit 5.11.0.
  • Update RELEASE_HOWTO.md with current practice.

1.2.1

15 Aug 09:00
v1.2.1
Compare
Choose a tag to compare

SVG2 compliance fixes

This release brings the latest fixes right before merging the Typed OM patch (the basis for the forthcoming 2.0). Basically contains SVG2 compliance fixes.

This is intended to be the last 1.x release, although maintenance 1.2.x releases may be published if security vulnerabilities are found in the near future.


Detail of changes

  • SVG2 compliance for the viewBox attribute, including calc() support.
  • anim: make SVGOMAnimatedRect.getUnderlyingValue() less prone to races.
  • anim,bridge: continue rendering if x/y/width/height attributes of line,image,svg,use are wrong [SVG2].
  • bridge: fix the handling of colors with percentage values in alpha channel.
  • bridge: fix a resource leak in BaseScriptingEnvironment.
  • codec: improve handling of gray images in PNGEncodeParam.getDefaultEncodeParam().
  • codec: clean up the usage of PNGEncodeParam, PNGDecodeParam and PNGImageWriterParams.
  • transcoder: compute image sizes in CSS context where appropriate [SVG2].
  • Gradle: make xml-apis a compile-only dependency.
  • Upgrade to css4j 4.3.1.
  • Upgrade to wrapper-validation action v4.

1.2

31 Jul 18:04
v1.2
Compare
Choose a tag to compare
1.2

Warning: dependency on xmlgraphics-commons was removed

If you use a Gradle build, be sure to add the following to the repositories configuration for css4j's Maven repository:

includeGroup 'io.sf.graphics'

The configuration for the repository should look like this:

maven {
    url "https://css4j.github.io/maven/"
    mavenContent {
        releasesOnly()
    }
    content {
        includeGroup 'io.sf.graphics'
        includeGroup 'io.sf.carte'
        includeGroup 'io.sf.jclf'
    }
}

Detail of changes

  • anim: share the user agent css loading code between 1.1 and 1.2 implementations.
  • anim,parser: support calc() values in animated rectangles.
  • Remove xmlgraphics-commons.
  • Tests: add more Mermaid tests.
  • Small javadoc tweaks.
  • Upgrade to css4j 4.3.

1.1.1

24 Jul 17:30
v1.1.1
Compare
Choose a tag to compare

Fix Java 8 compatibility of 1.1

A few Java 8 incompatibilities slipped into the codec module in 1.1, and were detected by the secondary CI that checks the artifacts uploaded to the Maven repository. These are fixed in 1.1.1.

Note, however, that on Java 8 the new features introduced in the ImageIO writer will not work, due to lack of support by Java 8.

If you use the default PNGTranscoder you should be fine, but if you are a SVGGraphics2D user you may want to upgrade to Java 11 or later.

1.1

24 Jul 08:19
v1.1
Compare
Choose a tag to compare
1.1

Highlights

Security fixes

Two security vulnerabilities in the util module were fixed:

  • #98 [CWE-22]
  • Set connect and read timeouts in ParsedURLData [BATIK-1366] [CWE-770]

Adapt to new module name of xmlgraphics-commons

The next version of the xmlgraphics-commons dependency will use the org.apache.xmlgraphics.commons module name, different to the one that was being used in EchoSVG until now (based on the Maven filename-based module name).

If you experience any difficulty due to the change, please use a plugin like Moditect for Maven or extra-java-module-info for Gradle. Or you could wait until the next version of xmlgraphics-commons is released and then set an explicit dependency.


More SVG2 compatibility

  • More resilience against missing or wrong href, width, height, rx, ry, x and y attributes.
  • Full support for the namespaceless href attribute even in animations.

PNG codecs now support ICC color profiles

The native PNG codec and the ImageIO ImageWriter now support color profiles automatically.


Color profiles in SVG Generator, in colors and embedded PNG images

See https://github.com/css4j/echosvg/wiki/SVG-Generator


Configurable compression level for embedded PNG images in the SVG Generator

See SVGGeneratorContext.setCompressionLevel().


New rendering hints in the PNG transcoder

Rendering hints KEY_KEYWORD_TEXT, KEY_INTERNATIONAL_TEXT and KEY_COMPRESSED_TEXT allow embedding textual information (like copyright, author, description, etc) in rendered PNG images. And KEY_COMPRESSION_LEVEL sets the compression level used in the PNG encoding (the default native encoder uses 9 by default, which is excessive for some use cases).

All of these hints work with both the native and the ImageIO adapters.


Per-module Fat-jars

If you manage your classpath manually and only require a specific module, get a fat-jar specific for your use case.

See https://github.com/css4j/echosvg/wiki/Uber-Jar


Detail of changes

  • util: fix arbitrary file access during archive extraction. [security, CWE-22]
  • util: set connect and read timeouts in ParsedURLData [BATIK-1366]. [security, CWE-770]
  • Modules: switch to org.apache.xmlgraphics.commons as xmlgraphics-commons module name.
  • Remove a few redundant interface usages, other cleanups.
  • anim: support animatable namespaceless href attribute from SVG2.
  • anim: allow missing width and height attributes in <rect> [SVG2].
  • anim, bridge: the version attribute isn't part of SVG anymore, just check for 1.2.
  • bridge: be tolerant to missing or malformed href attribute in image elements [SVG2].
  • bridge: tolerate wrong width, height, rx and ry attributes in <rect> [SVG2].
  • bridge: tolerate wrong or missing rx and ry attributes in <ellipse>, r in <circle> [SVG2].
  • bridge: more resilience against missing or incorrect shape attributes [SVG2].
  • bridge: nullcheck the animation engine in SVGAnimationEngine.
  • codec: support ICC color profiles in native PNG codec.
  • codec: fix NPE writing the zTXt chunk.
  • codec: support ICC color profiles in ImageIOPNGImageWriter.
  • codec: configure the PNG compression level, support all the text chunks.
  • codec: add a null check in ImageIOJPEGImageWriter, other small improvements.
  • css: remove dependency on xmlgraphics-commons.
  • dom: check the namespaceless href attribute first.
  • extension: simplify ColorSwitchBridge.createPaint().
  • extension: resource was in a directory with wrong name.
  • script: give access to org.mozilla.javascript.EcmaError in the Rhino shutter [BATIK-912].
  • svggen: support colors in non-sRGB color spaces, via color() function.
  • svggen: support images based on ICC color profiles in drawImage().
  • svggen: make the compression level of the embedded PNG images configurable.
  • svggen: add Mac Glyph names for 210 & 257.
  • transcoder: add the KEY_COMPRESSION_LEVEL, KEY_KEYWORD_TEXT, KEY_INTERNATIONAL_TEXT and KEY_COMPRESSED_TEXT hints.
  • transcoder: do not close the output stream in PNGImageEncoder.
  • Unmerge codec packages from transcoder module, except for three classes.
  • dom: fix XPath regression introduced by commit 8164dd7 (BATIK-1329: Remove xalan). Bug reported by Pavel Braginskiy in July 17 to the batik-users mailing list.
  • JMH: move DoubleStringPerformanceMark to a svggen.jmh package for improved modular compatibility.
  • Source formatting (pre-requisite to enable code style tools).
  • Enable checks with the Checkstyle static analysis tool.
  • Tests: test images from canvg's test suite #92.
  • Tests: switch to a SVG 1.1 DTD in a number of test sample files.
  • Tests: refactor to be more IDE-friendly.
  • Tests: fix CodeQL alert 28.
  • Tests: a number of other improvements.
  • Distribution: add a Main-Class attribute to a few manifests.
  • Gradle: use implementation instead of api in several places.
  • Gradle: add the ability to create all-deps jar files for individual modules.
  • Upgrade to Mozilla Rhino 1.7.15.
  • Upgrade to xml-dtd 4.3.
  • Upgrade to JUnit 5.10.3.
  • Upgrade to extra-java-module-info 1.8.
  • Upgrade to grGit 5.2.2.
  • Upgrade Gradle wrapper to 8.9.
  • CI: do not exclude any test.
  • Run CI on Java 11 and 21.

1.0.1

20 Nov 15:06
v1.0.1
Compare
Choose a tag to compare

This is a bugfix release and all users are encouraged to upgrade.

Detail of changes

  • svg-dom: fix a bug copying transforms [BATIK-1361].
  • transcoder: improve the @supports logic in CSSTranscodingHelper.
  • Gradle: remove redundant module dependencies.
  • Gradle: use dependency-license-report to check dependency licensing.
  • Upgrade to css4j 4.2.2.
  • Upgrade to JMH 1.37.
  • Upgrade to JUnit 5.10.1.
  • Upgrade to GrGit 5.2.1.
  • Upgrade to extra-java-module-info version 1.6.
  • Upgrade to org.owasp.dependencycheck 8.4.2.

1.0

21 Sep 10:30
v1.0
Compare
Choose a tag to compare
1.0

This is the first major release since the fork from Batik, and a number of improvements have been introduced.

Here is the list of changes since the fork, starting with the improvements after the last milestone release (0.3.3). Several items that were just refinements over previous updates were removed from the list, or merged, in order to improve readability.

Detail of changes

since 0.3.3

  • transcoder: support the KEY_USER_STYLESHEET_URI hint in CSSTranscodingHelper.
  • transcoder: throw a TranscoderException in case of error in KEY_SVG_SELECTOR, instead of a DOM exception.
  • transcoder: fix KEY_ALTERNATE_STYLESHEET support in CSSTranscodingHelper.
  • transcoder: avoid useless null check.
  • util: remove useless null checks.
  • util: remove useless null checks.
  • bridge: remove useless null check.
  • bridge: fix NPE in DefaultXBLManager [BATIK-1313].
  • bridge,css,swing: avoid unnecessary conversions to and from float/double.
  • Improve code readability (code style).
  • Fix several CodeQL alerts.
  • Adjust the precision of operands in several floating-point operations.
  • Add a comment to io.sf.carte.echosvg.awt's module-info.
  • Upgrade to css4j 4.2 and xml-dtd 4.2.1.
  • Upgrade to xmlgraphics-commons 2.9.
  • Upgrade to extra-java-module-info 1.4.2.
  • Enable dependabot for Github actions.
  • Upgrade to actions/checkout@v4.

0.3.3

  • dom: implement matches(), querySelector() and querySelectorAll().
  • transcoder: add the KEY_SVG_SELECTOR transcoding hint.
  • transcoder: use SVGConstants.SVG_SVG_TAG in CSSTranscodingHelper.
  • transcoder: support namespaceless svg elements inside plain HTML (#83).

0.3.2

  • awt: synchronize update of static field with class instead of instance.
  • awt: use Boolean.parseBoolean instead of valueOf in GraphicsUtil.
  • bridge: add null checks in DefaultScriptSecurity and SVGFontFamily.
  • dom: do not call getNodeName() from AbstractElementNS constructor, as it uses a field not yet initialised by subclasses.
  • dom: use a lock instead of synchronized blocks in AbstractDocument and DocumentDescriptor.
  • dom: move a null check to the right place in AbstractDocument.
  • extension: remove protected field from PrefixableStylableExtensionElement that was shadowing a superclass protected field.
  • gwt: make sure that counter increments and decrements are atomic in AWTGlyphGeometryCache.
  • script: remove useless null check from InterpreterPool.
  • swing: remove useless null check from JSVGComponent.
  • transcoder: avoid NPE when transcoding non-SVG documents.
  • Replace StringBuffer with StringBuilder.
  • Tests: use a different interned string than Batik, to synchronize.
  • Tests: safer lazy static initialisation in AbstractRenderingAccuracyTest.
  • Javadoc improvement.

0.3.1

  • awt: statically evaluate isColorConvertOpAplhaSupported. [BATIK-1354]
  • bridge: be tolerant to missing references. #80
  • css: do not stop CSS processing when an unknown or wrong value is found. #78
  • css: support Level 4 CSS Color (and Level 5 color-mix()) values in sRGB gamut. #77
  • css: fix NPE in CSSEngine when the document has no documentURI.
  • dom: support the namespaceless href attribute of SVG2.
  • dom: support surrogate characters.
  • gvt: fix race conditions in AWTGlyphGeometryCache (includes BATIK-1271).
  • gvt: fix SVG to PNG Rendering due to missing Arabic characters from the map. Based on patch by Paritosh Chauhan [BATIK-1355]
  • transcoder: add methods to transcode from a TranscoderInput and a Document instance using the Helper.
  • transcoder: do not overwrite the error handler in the CSSTranscodingHelper.
  • Tests: make less verbose the rendering tests that expect errors.

0.3

  • Improve the security model
  • dom,anim: add InputStream+encoding method variant to DocumentFactory.
  • transcoder,anim,dom: add encoding support to TranscoderInput.
  • anim: throw an IllegalArgumentException on root mismatch in SAXSVGDocumentFactory.
  • bridge: avoid NPE when using non-PX units in an element.
  • Use default implementations for the deprecated getPixelToMM() method (#59)
  • Use JDK's XPath support #76 (ported from: BATIK-1329: Remove xalan, Copyright of that change is ASF)
  • Tests: fix a few null-empty string inconsistencies in OnLoad tests.

0.2.2

  • bridge: default to antialiasing in SVGClipPathElementBridge. May fix #53
  • transcoder: allow SVG embedded into XHTML in XMLAbstractTranscoder. #69
  • transcoder: check for the correct SVGDOM implementation version in XML transcoding. #68
  • transcoder: accurate computation of stringWidth in CSSTranscodingHelper.
  • transcoder: adjust visibility of non-public types that were being referenced by SVGTranscoder public fields.
  • dom: deprecate XMLReader variant of DocumentFactory.createDocument, add setXMLReader. #71
  • Small javadoc fixes.

0.2.1

  • Deprecate getPixelToMM() and getPixelToMillimeter() for removal (#59).
  • Support the transparent color identifier.
  • awt: remove commented code from ImageTagRegistry.
  • bridge: initial fix to SVGBrokenLinkProvider. (#52)
  • css: accept display: inline-block as valid CSS.
  • css: do not stop processing when finding a custom property.
  • css: ignore rules that are not supported instead of stopping processing.
  • css: add a constructor with initial capacity in StringMap.
  • gvt: remove unreachable conditional blocks.
  • svg-dom: fix relative move after path closure in getNormalizedPathSegList (#50)
  • transcoder: add a CSS rendering helper utility.
  • transcoder: provide the old PNGRegistryEntry in module-info.
  • transcoder: correctly parse the KEY_ALLOWED_SCRIPT_TYPES hint (#56)
  • transcoder: reorder the module-info exports and requires.
  • util: add method Platform.isOSX(), deprecate public field isOSX (#51)
  • Use try-with-resources in several places.
  • Tests: explicitly set SVG version in samples that are not compatible with 1.2.
  • Tests: use SVG 1.1 DTD instead of 1.0 in some 1.2 sample files.
  • Tests: new normalizedPathSegList test.
  • Tests: anim: add a test for getNormalizedPathSegList(), see #50
  • Tests: fix non-conformant font-size style declarations in test files.
  • Tests: split the ECMAScript tests for easier debugging.
  • Add RELEASE_HOWTO.md with release steps.

0.2

  • Migrate from Apache Xalan to EchoXSL. See #46
  • bridge: rename finalize() to close(), implement Closeable in BridgeContext. See #38
  • transcoder: remove finalize() method from SeekableStream. See #38
  • bridge,script: remove public methods returning an AccessControlContext (final part of #36).
  • script: simplify the SecurityManager implementation of EchoSVGSecurityController.getDynamicSecurityDomain() (related to #36).
  • anim: round values to nearest integer during the interpolation.
  • Tests: improve the rendering tests documentation.

0.1.2

  • Refactor classes that use deprecated Security APIs, deprecate as needed. #36
  • svg1.2: support attribute text-align="center" in SVG 1.2 flow elements. #33
  • anim: avoid potential NPE.
  • anim: remove protected fields that were shadowing superclass fields.
  • awt: avoid an undesirable cast in AbstractRable.
  • awt: implement SVGComposite.hashCode().
  • awt: fix rounding in a mathematical expression.
  • awt: prevent three NPEs.
  • awt: change class DisplacementMapRed.TileOffsets visibility to public.
  • awt: remove commented code.
  • bridge: implement DefaultXBLManager.DefinitionRecord.hashCode().
  • bridge: fix conditional in GlyphLayout.
  • gvt: fix implementation of GVTAttributedCharacterIterator.getRunLimit(Set).
  • gvt: avoid potential NPE in DynamicRenderer.
  • svgrasterizer: prevent NPE.
  • transcoder: return null on null input in WMFTranscoder.getCompatibleInput().
  • util: use a volatile field in HaltingThread.
  • util: add a method to shut down CleanerThread, use a timeout when retrieving the queue.
  • util: prevent two NPEs in ClassFileUtilities.
  • Tests: deploy a new image comparison infrastructure.
  • Tests: update test references with more accurate images.
  • Tests: replace resources for scripting jar files.
  • Tests: use free font in flowTextAlign test, accept Xfce variation on systemColors.
  • Tests: fix scripting/domSVGColor test.
  • Tests: fix samples/tests/spec12/text/flowText4.svg
  • Tests: improved error message in MemoryLeakTest.
  • Tests: throw error that was being ignored in JPainterCompare.
  • Javadoc fixes.

0.1.1

  • Generator: support decoration attributes in text elements #16
  • Generator: conversions to SVG fonts now support strikethrough-* and underline-* attributes #17
  • Script service provider metadata is at wrong module #20
  • DOM: Node.isEqualNode() gives incorrect results #18
  • Tests: the old Batik tests were overhauled and converted to JUnit (version 4 first, later version 5).

0.1

  • New CSS engine supporting level 4 selectors and RGBA colors (with alpha channel).
  • codec and transcoder packages were merged, runtime circular dependency removed. See #11.
  • Pyhton and Tcl scripting removed (they were already commented out in Batik), see #12 and #13.
  • Removed support for PDF vector image format (which introduced a hidden FOP-Batik circular dependency, see #10).
  • Remove the useless shared-resources package, those resources are now inserted into the META-INF directory of the jar files.
  • Build system switched to Gradle (#8).
  • BATIK-1296: AbstractDocument.importNode(Node, boolean) does not set the attributes of elements.
  • BATIK-1227: Image filters encoded with Base64 in the SVG throw "Content not allowed in prolog" exception. Fix by Dan Caprioara.
  • BATIK-1285: Batik fails to parse an svg with missing 'offset' attribute. Based on fix by Konstantin Bulenkov.
  • BATIK-1290: `AbstractGraphicsNode.pai...
Read more

Version 0.3.3

19 Aug 12:51
v0.3.3
Compare
Choose a tag to compare

Highlights

DOM

The matches(), querySelector() and querySelectorAll() methods were added.

See

Transcoder

  • When transcoding an SVG image embedded in an HTML document that has several embedded SVGs, the KEY_SVG_SELECTOR transcoding hint can now be used to select which one we want. Otherwise the first svg element in the document will be rendered.

  • SVG files embedded in HTML documents that do not use namespaces at all (no namespace in the html nor the svg elements) are now supported. Note that if the html element explicitly defines a namespace but the svg doesn't, the transcoding fails (this is also the behaviour on web browsers).


Detail of changes

  • dom: implement matches(), querySelector() and querySelectorAll().
  • transcoder: add the KEY_SVG_SELECTOR transcoding hint.
  • transcoder: use SVGConstants.SVG_SVG_TAG in CSSTranscodingHelper.
  • transcoder: support namespaceless svg elements inside plain HTML.
  • transcoder: add a two-argument method to CSSTranscodingHelper, deprecate 3-args version.
  • Tests: add a test for the selector argument of CSSTranscodingHelper.
  • Tests: restore namespace settings to defaultFontFamily test.
  • Upgrade to css4j 4.1.

Version 0.3.2

08 Aug 14:14
v0.3.2
Compare
Choose a tag to compare

Highlights

  • Support namespaceless documents.
  • Performance: a number of small performance and reliability improvements.

Detail of changes

  • awt: synchronize update of static field with class instead of instance.
  • awt: use Boolean.parseBoolean instead of valueOf in GraphicsUtil.
  • bridge: add null checks in DefaultScriptSecurity and SVGFontFamily.
  • dom,transcoder: support namespaceless documents (#83).
  • dom: do not call getNodeName() from AbstractElementNS constructor, as it
    uses a field not yet initialised by subclasses.
  • dom: use a lock instead of synchronized blocks in AbstractDocument and
    DocumentDescriptor.
  • dom: move a null check to the right place in AbstractDocument.
  • extension: remove protected field from PrefixableStylableExtensionElement
    that was shadowing a superclass protected field.
  • gwt: make sure that counter increments and decrements are atomic in
    AWTGlyphGeometryCache.
  • script: remove useless null check from InterpreterPool.
  • swing: remove useless null check from JSVGComponent.
  • transcoder: avoid NPE when transcoding non-SVG documents.
  • Replace StringBuffer with StringBuilder.
  • Add a few missing @Override annotations.
  • Tests: add a namespaceless test for the default font family.
  • Tests: use the original Lucida Sans Typewriter in textDecoration2 test.
  • Tests: use a different interned string than Batik, to synchronize.
  • Tests: safer lazy static initialisation in AbstractRenderingAccuracyTest.
  • Javadoc improvement.
  • Upgrade to JUnit 5.10.0.
  • Upgrade Gradle wrapper to 8.2.1.
  • Add a paragraph about supported versions to SECURITY.md.