[Geoserver-devel] Geoserver WMS rendering

I've started looking at the WMS CITE tests, but I havent been able to
get a single test to run!

It appears there's something wrong with the images produced by
geoserver.

1. JPEG seems to be broken (there's two implementations)
    A) com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriter --
this JAI IO doesnt fails completely:

        javax.imageio.IIOException: The provided image cannot be encoded
using: com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriter
       at
com.sun.media.imageioimpl.common.ImageUtil.canEncodeImage(ImageUtil.java:1154)
       at
com.sun.media.imageioimpl.common.ImageUtil.canEncodeImage(ImageUtil.java:1174)
       at
com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageWriter.write(CLibJPEGImageWriter.java:76)
       at javax.imageio.ImageWriter.write(ImageWriter.java:591)
       at
org.vfny.geoserver.wms.responses.helpers.JAISupport.encode(JAISupport.java:148)
  at
org.vfny.geoserver.wms.responses.map.JAIMapProducer.formatImageOutputStream(JAIMapProducer.java:68)
  at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.writeTo(DefaultRasterMapProducer.java:118)
  at
org.vfny.geoserver.wms.responses.GetMapResponse.writeTo(GetMapResponse.java:188)
  at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:465)
  at
org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:247)

    B) com.sun.imageio.plugins.jpeg.JPEGImageWriter
       (you have to call this by hand in JAISupport#encode() - use the
2nd writer given by the iterator)

       This one writes an image, but it isnt renderable in Modzilla:

      error message: The image
"http://localhost:8080/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&LAYERS=cite:BasicPolygons&STYLES=&SRS=EPSG:4326&BBOX=-1,-1,1,+1&WIDTH=400&HEIGHT=400&FORMAT=image/jpeg"
cannot be displayed, because it contains errors.

       I open it up in an image viewer program, and it looks horrible!

2. The PNG and GIF producers seem to work (these are the only ones I
could get to work)
    Unfortunately, they dont give the same image!!
    Compare the two image's I've attached - look at the very bottom of
the image. The GIF's image clipped by about 5 pixels.

3. The capabilities says it supports:
        <Format>image/x-portable-graymap</Format>
        <Format>image/jpeg</Format>
        <Format>image/svg+xml</Format>
        <Format>image/bmp, image/x-bmp, image/x-windows-bmp</Format>
        <Format>image/x-portable-pixmap</Format>
        <Format>image/x-portable-anymap</Format>
        <Format>image/png</Format>
        <Format>image/jp2</Format>
        <Format>image/jpeg2000</Format>
        <Format>image/x-png</Format>
        <Format>image/tiff</Format>
        <Format>image/vnd.wap.wbmp</Format>
        <Format>image/x-portable-bitmap</Format>
        <Format>image/gif</Format>

   But most of these do not produces images or create invalid images
     ie. image/bmp - "There is no support for creating maps in
image/bmp format"
         image/vnd.wap.wbmp - "Only integral single-band bilevel image
is supported."
         image/tiff - gives the same error as the CLibJPEGImageWriter

4. DefaultRasterMapProducer#produceMap() has this:
        BufferedImage curImage = new BufferedImage(width, height,
                BufferedImage.TYPE_INT_ARGB);
   I tried a TYPE_4BYTE_ABGR but it didnt seem to change anything.

Any help on this would be much appreciated!

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

(attachments)

wms.gif
wms.png
wms.jpg
basicpolygon.sld (1.65 KB)

dblasby@anonymised.com wrote:

I've started looking at the WMS CITE tests, but I havent been able to
get a single test to run!

Quick question, what version JRE, ImageIO and JAI are you running.

The JAI docs are great:
-<Oracle Java Technologies | Oracle;

And I have used their advice on JPEG before:
-<Oracle Java Technologies | Oracle;

You will also want to grab their code examples and take them out for a spin.

Cheers,
Jody