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] [Updated] (BATIK-1228) NPE in SVGGen not working due to non-registered image writers
Date Fri, 01 Jun 2018 12:36:00 GMT

     [ https://issues.apache.org/jira/browse/BATIK-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ansgar Radermacher updated BATIK-1228:
--------------------------------------
    Description: 
There is an NPE in class ImageHandlerBase64Encoder (in batik-svggen) 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.

  was:
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.


> 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 ImageHandlerBase64Encoder (in batik-svggen) 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
(v7.6.3#76005)

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


Mime
View raw message