Tag Archive > animated

Detecting an animated GIF in PHP

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 while ($count < 2) { $where1=strpos($filecontents,"\x00\x21\xF9\x04", $str_loc); if ($where1 === FALSE) { break; […]

Continue reading

, ,