andrea antonello ha scritto:
> Hi, I am trying to get graphics to be rendered along lines.
> 
> When I try to use the smiley from the geoserver cookbook through:
> 
>          File smileyFile = new File(smileyPng);
>          ExternalGraphic exGraphic =
> sf.createExternalGraphic(smileyFile.toURI().toURL(),
>          "image/png");
> 
> 
> I get an exception:
> 
> SEVERE: Unknown image type 0
> java.lang.IllegalArgumentException: Unknown image type 0
>       at java.awt.image.BufferedImage.<init>(BufferedImage.java:490)
>       at 
> org.geotools.renderer.lite.StyledShapePainter.drawWithGraphicsStroke(StyledShapePainter.java:420)
>       at 
> org.geotools.renderer.lite.StyledShapePainter.paint(StyledShapePainter.java:222)
>       at 
> org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:2108)
>       at 
> org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:2032)
> .....
> 
> 
> Instead if I use an svg graphics, the thing works. The same graphics
> works fine in a point symbolizer.
> 
> Any idea what that might be?

There is an image cloning going on there, which uses the original image
type. However, not sure why the image cloning is there to start with,
as I told you on IRC that portion of the code should be rewritten.

For the time being maybe try to use BufferedImage.TYPE_4BYTE_ABGR
in the line of code that's failing instead of image.getType()

Cheers
Andrea


-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to