Understand an gif is animated or not in JAVA -
i have gif image , able detect whether gif animated gif or not using java. question detection rather displaying gif.
i see mime type of animated gif isn't different of static gif.
how can it?
you need imagereader. if size 1 not animated, above animated. check out:
public snippet() { file f = new file("test.gif"); imagereader = imageio.getimagereadersbysuffix("gif").next(); imageinputstream iis; try { iis = imageio.createimageinputstream(f); is.setinput(iis); int images= is.getnumimages(true); } catch (ioexception e) { e.printstacktrace(); } }
Comments
Post a Comment