Class GifDecoder


  • public class GifDecoder
    extends Object
    Class reads Gif image as BufferedImage

    Example 1 (Using raw byte data):

    
     GifDecoder decoder = new GifDecoder();
     BufferedImage decodedImage = decoder.read(bmpBytes);
     

    Example 2 (Using File):

    
     GifDecoder decoder = new GifDecoder();
     BufferedImage decodedImage = decoder.read(bmpFile);
     
    • Constructor Detail

      • GifDecoder

        public GifDecoder()
    • Method Detail

      • read

        public BufferedImage read​(byte[] gifData)
                           throws IOException
        Decodes and returns the gif image as a BufferedImage from bytes
        Parameters:
        gifData - gif image as data bytes
        Returns:
        BufferedImage The decoded image
        Throws:
        IOException
      • read

        public BufferedImage read​(File gifFile)
                           throws IOException
        Decodes and returns the gif image as a BufferedImage from file
        Parameters:
        gifFile -
        Returns:
        BufferedImage The decoded image
        Throws:
        IOException