offset attribute should be set to 0 if it is missing in the stop tag

2020-10-07 Thread Konstantin Bulenkov
Hello everyone,

Some time ago, I've submitted a PR at but had no attention
since then.

Many modern design tools like Figma and others do not put offset attribute
when generating an SVG image if offset equals 0. See

Batik fails with exception while trying to read such Ss. Other programs
successfully open these files.
The pull request sets offset to 0 when the attribute is missing.

The patch is available here

or as a patch file

Please review and merge if possible.

With best regards,


Example of an icon:;>

Converting SVG to SVG and replacing viewBox

2021-03-11 Thread Konstantin Bulenkov
Hello everyone,

What's a proper way to convert an SVG image file and replace its viewBox
size, and then save?

For example, loading 32x32 svg file, and save it as 16x16.


output (using Figma):;>

My first attempt was to use SVGGraphics2D with loaded svg document and
then change svgCanvasSize. However, I got invalid file with missing
defs and invalid formatting.

Thank you in advance for any help.