[ https://issues.apache.org/jira/browse/BATIK-1111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124016#comment-15124016 ]
Erich Schubert commented on BATIK-1111: --------------------------------------- This is a bug in the packages uploaded to Maven. Essentially: the Maven packages do not include working PNG/TIFF/JPEG export. When the packages were built, they excluded the imageio classes, but fall back to the sun codecs only (because they are available). The sun codecs however, are commented in the META-INF/service file: Patch-2 - enable the sun codecs (service loader will detect when they do not exist). https://github.com/kno10/batik/commit/eddef81b1f0a3e9db285737d2f1db1a07292ca50 Patch-3 - always build the imageio codecs by ignoring maybe-present sun codecs: https://github.com/kno10/batik/commit/e49fd7336565055e68a38f7453c5e763cdf68f21 Patch-1 - fix a bug in the ImageTagRegistry not updating when register() is called, and the new class is not of last priority: https://github.com/kno10/batik/commit/ebe07c24a52619ed90601562059f3ac01865f7e6 > SVG to PNG > ---------- > > Key: BATIK-1111 > URL: https://issues.apache.org/jira/browse/BATIK-1111 > Project: Batik > Issue Type: Bug > Reporter: Andrey > Priority: Blocker > Attachments: noValid.png, valid.png > > > I try transcode SVG to PNG > {code:title=Bar.java|borderStyle=solid} > public byte[] svgToPNG(String svg) { > TranscoderInput transcoderInput = new TranscoderInput(new > StringReader(svg)); > ByteArrayOutputStream output = new ByteArrayOutputStream(); > TranscoderOutput transcoderOutput = new TranscoderOutput(output); > PNGTranscoder pngTranscoder = new PNGTranscoder(); > try { > pngTranscoder.transcode(transcoderInput, transcoderOutput); > } catch (TranscoderException e) { > LOGGER.error(e.getMessage(), e); > } > return output.toByteArray(); > } > this._getSvgStringAp = function ($mapSvg) { > if ($mapSvg[0] === undefined){ > return ""; > } > var svgDomNode = $mapSvg[0]; > var svgXML = (new XMLSerializer()).serializeToString(svgDomNode); > return svgXML; > }; > {code} > In my SVG i have marker: > <image xlink:href="/img/mypath/..." ...></image> > But in transcode error: > org.apache.batik.transcoder.TranscoderException: null > Enclosed Exception: > null:0 > The URI "http://localhost/img/mgm/71094611/71094691/2" > on element <image> can't be opened because: > The URI can't be opened: > Server returned HTTP response code: 500 for URL: > http://localhost/img/mgm/71094611/71094691/2 > This situation only novalid.png. > Valid.png - it's ok -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org