Jump to content

Any UDF to tell me if a GIF file is animated or not?

Recommended Posts

I'm looking for a way to determine if a file with the .GIF extension is a still image or an animated GIF. There are several UDFs here to display or create an animated GIF, but I've been unable to find a way to tell me in a GIF file is animated in the first place.  There are difficult ways to do this, such as forcing all users to install ImageMagick so that my scripts can ask it, but that way obviously sucketh.  I found a UDF to return extended file info, but it doesn't return a frame count or any other way to tell a still GIF from an animated one.

Any ideas, folks?  Thanks.

Link to post
Share on other sites
19 hours ago, Subz said:
ConsoleWrite(_GifAnimated(@ScriptDir & "\filename.gif") & @CRLF)

Func _GifAnimated($_sGifFileName)
    If FileExists($_sGifFileName) = 0 Then Return False
    Local $objImage = ObjCreate("WIA.ImageFile")
    Return $objImage.IsAnimated


Wow! Thank you for your extremely valuable contribution! :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...