[geotk] applet to display raster

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Wed Jan 12 08:49:05 EST 2011


Hello Ramzi

Le 12/01/11 13:05, Ramzi Oueslati a écrit :
> org.geotoolkit.image.io.plugin.GeoTiffImageReader$TIFF
> org.geotoolkit.image.io.plugin.WorldFileImageReader$TIFF
> com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderSpi
> com.sun.media.imageioimpl.plugins.pnm.PNMImageReaderSpi
> com.sun.media.imageioimpl.plugins.raw.RawImageReaderSpi
> com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi
> com.sun.media.imageioimpl.plugins.wbmp.WBMPImageReaderSpi
> com.sun.media.imageioimpl.plugins.bmp.BMPImageReaderSpi

The two Geotk ones are missing because they depend on a "plain" TIFF reader, and 
none were found.

> IIORegistry.getDefaultInstance().registerServiceProvider(new
> GeoTiffImageReader.Spi("TIFF"), ImageReaderSpi.class);
> No problem at all when the applet runs from the appletviewer. However,
> within the web browser it says:
>
> java.lang.IllegalArgumentException: Image format "TIFF" is unknown.
Yes, again this is because the JAI TIFF image reader is not registered. I 
suggest to try the following line first:

IIORegistry.getDefaultInstance().registerServiceProvider(new
com.sun.media.imageioimpl.plugins.tiff.TIFFImageReaderSpi(), ImageReaderSpi.class);

As a side effect, if there is a problem with the classpath (i.e. if 
jai_imageio-1.1.jar is not loaded for whatever reason), we should have a 
ClassNotFoundError now...

     Martin



More information about the Geotoolkit mailing list