Class ImageLoader


  • public class ImageLoader
    extends Object
    A convenience class with static methods to load images from files using JIU codecs. The load methods of this class try to load an image with all codecs registered with this class. This includes almost every codec that resides in the net.sourceforge.jiu.codecs package. You can register additional codecs with registerCodecClass(net.sourceforge.jiu.codecs.ImageCodec) or remove the usage of codecs with removeCodecClass(net.sourceforge.jiu.codecs.ImageCodec).

    A Codec that cannot safely identify a file to be in the format that it supports must not be used with ImageLoader. The failure to identify typically comes from the lack of magic byte sequences defined for the format. In order to load such a file, use the codec manually. Example: PalmCodec.

    In order to load an image via Toolkit (JPEG, PNG or GIF), use ToolkitLoader. It combines the loading features of java.awt.Toolkit and JIU's ImageLoader.

    Usage example

     PixelImage image = null;
     try
     {
       image = ImageLoader.load("image.tif");
     }
     catch (Exception e)
     {
       // handle exception
     }
     
    Author:
    Marco Schmidt