xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ansgar Radermacher (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BATIK-1228) NPE in SVGGen not working due to non-registered image writers
Date Fri, 01 Jun 2018 12:00:02 GMT

    [ https://issues.apache.org/jira/browse/BATIK-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16497896#comment-16497896

Ansgar Radermacher commented on BATIK-1228:

I understand that the problem might be specific to theOSGI context in Eclipse (classloader.getResource
will not find files in other bundles), but it's not a good solution that other Eclipse tools
define work-arounds, as for instance in case of Sirius, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=522740#c46


> NPE in SVGGen not working due to non-registered image writers
> -------------------------------------------------------------
>                 Key: BATIK-1228
>                 URL: https://issues.apache.org/jira/browse/BATIK-1228
>             Project: Batik
>          Issue Type: Bug
>          Components: SVGGraphics2D, Utilities
>    Affects Versions: 1.9
>         Environment: Eclipse
>            Reporter: Ansgar Radermacher
>            Priority: Critical
> There is an NPE in class ImageHandlerBase64 encoder in the 1.9.1 build for Eclipse photon
in the following code (which gets triggered by a "File->Save as Image" in Papyrus).
> ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor("image/png");
> writer.writeImage(buf, os);
> ...
> No ImageWriter is registered for "image/png", i.e writer is null after the assignment.
The ImageIOPNGImageWriter (and others) from the batik codec package are not "visible" for
the class Service in utils which it used by the ImageWriterRegistry to detect available writers.
> This is due to a missing dependency from batik.util to batik.codec, as proposed in [https://bz.apache.org/bugzilla/show_bug.cgi?id=44682]
and [https://stackoverflow.com/questions/16138850/batik-svggraphics2d-nullpointerexception-when-drawing-image]. 
However, this solution is not possible (at least not on Eclipse level), since batik.codec
also depends on batik.util, i.e. would introduce a dependency cycle.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org

View raw message