Package dev.matrixlab.webp4j.gif
Class GifDecoderJava
java.lang.Object
dev.matrixlab.webp4j.gif.GifDecoderJava
Java-based GIF decoder using ImageIO.
This is used as a fallback when native giflib is unavailable,
or for testing purposes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHolds all decoded GIF data including frames and metadata.static classRepresents a single frame in a GIF animation. -
Method Summary
Modifier and TypeMethodDescriptionstatic GifDecoderJava.GifDatadecodeGif(byte[] gifBytes) Decodes a GIF from a byte array using Java ImageIO.static booleangetGifInfo(byte[] gifBytes, AnimationInfo info) Gets GIF information without full decoding.
-
Method Details
-
decodeGif
Decodes a GIF from a byte array using Java ImageIO. Extracts all frames, delays, disposal methods, and loop count.- Parameters:
gifBytes- Byte array containing the GIF image data- Returns:
- GifData containing all frames and metadata
- Throws:
IOException- If decoding fails
-
getGifInfo
Gets GIF information without full decoding. This is a lightweight operation for querying GIF properties.- Parameters:
gifBytes- Byte array containing the GIF image datainfo- AnimationInfo object to populate- Returns:
- true on success, false on failure
-