Following function detects if the GIF contains an animation (it has more than 1 frame) or is just a static file.
function isAnimatedGif($filename)
{
$filecontents=file_get_contents($filename);
$str_loc=0;
$count=0;
// There is no point in continuing after we find a 2nd frame
[...]
Español