iblis
09-02-2004, 12:21 PM
Could you guys try the following code, and report back bugs if there are any?
This snipplet detects if an avatar is animated (or any other .gif)
function isAnimated($filename)
{
$fp = fopen($filename, "rb");
$whole = fread($fp, filesize($filename));
$i = -1;
while($i = strpos($whole, 0x2C, $i+1))
{
if(strpos($whole, 0x00, $i-1) == $i-1)
$c++;
}
if($c > 1)
return true;
return false;
}
This snipplet detects if an avatar is animated (or any other .gif)
function isAnimated($filename)
{
$fp = fopen($filename, "rb");
$whole = fread($fp, filesize($filename));
$i = -1;
while($i = strpos($whole, 0x2C, $i+1))
{
if(strpos($whole, 0x00, $i-1) == $i-1)
$c++;
}
if($c > 1)
return true;
return false;
}