note 15048 deleted from function.imagecolortransparent by jimw

From: Date: Thu, 20 Dec 2001 22:01:25 +0000
Subject: note 15048 deleted from function.imagecolortransparent by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23465@lists.php.net to get a copy of this message
If u want to get the index of existing transparent color, u can use GetImageTransparent function. function GetImageTransparent ($path) { /* Get the index of the transparent color of a GIF image int getimagetransparent (string filename); The GetImageTransparent function will determine the transparent color index of a Gif89a image Returns false on error. Note: This function does not require the GD image library. */ $fp=@fopen($path,'r'); if(!$fp || @fgets($fp,7)!="GIF89a") { @fclose($fp); return FALSE; } fseek($fp,10); fseek($fp,(3*pow(2,bindec(substr(decbin(ord(fgets($fp,2))),5,7))+1))+13); if(dechex(ord(fgets($fp,2))).dechex(ord(fgets($fp,2)))=='21f9') { fgets($fp,5); $temp =fgets($fp,2); fclose($fp); return ord($temp); } return false; } send me any suggestion else.

« previous php.notes (#23465) next »