Package com.idrsolutions.image.gif
Class GifDecoder
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.gif.GifDecoder
- All Implemented Interfaces:
com.idrsolutions.image.Decoder
public class GifDecoder
extends com.idrsolutions.image.JDeliImage
implements com.idrsolutions.image.Decoder
Class reads Gif image as BufferedImage
Example 1 (Using raw byte data):
GifDecoder decoder = new GifDecoder();
BufferedImage decodedImage = decoder.read(gifBytes);
Example 2 (Using File):
GifDecoder decoder = new GifDecoder();
BufferedImage decodedImage = decoder.read(gifFile);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionread
(byte[] gifData) Decodes and returns the gif image as a BufferedImage from bytesDecodes and returns the gif image as a BufferedImage from filereadDimension
(byte[] gifData) Decodes and returns the width and height of gif imagereadDimension
(File gifFile) Decodes and returns the width and height of gif imageMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImage
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.idrsolutions.image.Decoder
getImageCount, getImageCount, readEmbeddedThumbnail, readEmbeddedThumbnail, readImageAt, readImageAt, readImageSpecificMetaData, readImageSpecificMetaData, setMetadata
-
Constructor Details
-
GifDecoder
public GifDecoder()
-
-
Method Details
-
read
Decodes and returns the gif image as a BufferedImage from bytes- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
gifData
- gif image as data bytes- Returns:
- BufferedImage The decoded image
- Throws:
IOException
- if an error occurs in reading image
-
read
Decodes and returns the gif image as a BufferedImage from file- Specified by:
read
in interfacecom.idrsolutions.image.Decoder
- Parameters:
gifFile
- Path to gif image to be read- Returns:
- BufferedImage The decoded image
- Throws:
IOException
- if an error occurs in reading image
-
readDimension
Decodes and returns the width and height of gif image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
gifFile
- image image contained in raw data if present- Returns:
- width and height of image
- Throws:
IOException
- if problem reading image
-
readDimension
Decodes and returns the width and height of gif image- Specified by:
readDimension
in interfacecom.idrsolutions.image.Decoder
- Parameters:
gifData
- image image contained in raw data if present- Returns:
- Rectangle width and height of image
- Throws:
IOException
- if problem reading image
-