All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sksamuel.scrimage.nio.AnimatedGifReader Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package com.sksamuel.scrimage.nio;

import com.sksamuel.scrimage.nio.internal.GifSequenceReader;

import java.io.ByteArrayInputStream;
import java.io.IOException;

public class AnimatedGifReader {
   public static AnimatedGif read(ImageSource source) throws IOException {
      GifSequenceReader reader = new GifSequenceReader();
      int status = reader.read(new ByteArrayInputStream(source.read()));
      if (status != 0)
         throw new IOException("Error loading animated GIF");
      return new AnimatedGif(reader);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy