[geotk] applet to display raster

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Wed Jan 12 04:54:01 EST 2011


Hello Ramzi

Le 11/01/11 18:00, Ramzi Oueslati a écrit :
> I tried the code you suggest and the output is a little different
> whether it runs from the web browser or the appletviewer. (...)
>
>  From web browser
>
> (...snip...)
> org.geotoolkit.image.io.plugin.RawTiffImageReader$Spi at 395aaf
> (...snip...)
>
>  From appletviewer
>
> (...snip...)
> org.geotoolkit.image.io.plugin.GeoTiffImageReader$TIFF at 1a99347
> (...snip...)
> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi at 778255
> (...snip...)
> org.geotoolkit.image.io.plugin.RawTiffImageReader$Spi at 1a78071

The GeoTiffImageReader needs an other "plain" TIFF reader for reading the pixel 
values: it basically just wraps a plain TIFF reader and adds metadata parsing to 
it. It appears that all JAI Image I/O plugins, including TIFFImageReader, are 
missing in the web browser (JAI plugins are in the 
com.sun.media.imageioimpl.plugins package). Maybe jai_imageio-1.1.jar were not 
found?

The standard Java library also provides an other TIFF reader, 
com.sun.imageio.plugins.tiff.TIFFImageReader, which could be used instead. 
However for some mysterious Sun's JDK implementation raison, that 
TIFFImageReader appears magically in IIORegistry only after the first AWT frame 
has been shown to the screen. Note also that the JAI TIFFImageReader seems 
better than the JDK one (the TIFF format is the exception; for other formats 
like PNG or JPEG, the JDK implementation seems better than the JAI one).

If the TIFF images are uncompressed, a third alternative could be to use the 
Geotk RawTiffImageReader, which is significantly faster than both the JDK and 
JAI implementations. I would need to test however that GeoTiffImageReader and 
RawTiffImageReader works well together.

     Martin



More information about the Geotoolkit mailing list