function isImageAnimated($file) { $nb_image_frame = 0; $image = new Imagick($file); foreach($image->deconstructImages() as $i) { $nb_image_frame++; if ($nb_image_frame > 1) { return true; } } return false; }
Note that this function uses imagick php extension.
Discussion