@@ -0,0 +1,1359 @@
+package imj3.draft;%0A%0Aimport static multij.tools.Tools.debugPrint;%0A%0Aimport java.io.File;%0A%0Aimport org.w3c.dom.Document;%0Aimport org.w3c.dom.Element;%0A%0Aimport imj3.core.Image2D;%0Aimport imj3.tools.IMJTools;%0A%0Aimport multij.tools.CommandLineArgumentsParser;%0Aimport multij.tools.IllegalInstantiationException;%0Aimport multij.xml.XMLTools;%0A%0A/**%0A * @author codistmonk (creation 2015-09-23)%0A */%0Apublic final class AddDimensionsToSVG %7B%0A%09%0A%09private AddDimensionsToSVG() %7B%0A%09%09throw new IllegalInstantiationException();%0A%09%7D%0A%09%0A%09/**%0A%09 * @param commandLineArguments%0A%09 * %3Cbr%3EMust not be null%0A%09 */%0A%09public static final void main(final String%5B%5D commandLineArguments) %7B%0A%09%09final CommandLineArgumentsParser arguments = new CommandLineArgumentsParser(commandLineArguments);%0A%09%09final File svgFile = new File(arguments.get(%22svg%22, %22%22));%0A%09%09final String imagePath = arguments.get(%22image%22, %22%22);%0A%09%09%0A%09%09debugPrint(%22svg:%22, svgFile);%0A%09%09debugPrint(%22image:%22, imagePath);%0A%09%09%0A%09%09final Image2D image = IMJTools.read(imagePath);%0A%09%09%0A%09%09debugPrint(%22width:%22, image.getWidth(), %22height:%22, image.getHeight());%0A%09%09%0A%09%09final Document svg = SVGTools.readXML(svgFile);%0A%09%09final Element svgRoot = svg.getDocumentElement();%0A%09%09%0A%09%09svgRoot.setAttribute(%22width%22, %22%22 + image.getWidth());%0A%09%09svgRoot.setAttribute(%22height%22, %22%22 + image.getHeight());%0A%09%09%0A%09%09debugPrint(%22Writing%22, svgFile);%0A%09%09%0A%09%09XMLTools.write(svg, svgFile, 0);%0A%09%7D%0A%09%0A%7D%0A

Add tool AddDimensionsToSVG.