note 51471 deleted from function.imagecolortransparent by cmb
| From: | cmb@php.net | Date: | Sun, 01 Dec 2019 08:46:59 +0000 |
| Subject: | note 51471 deleted from function.imagecolortransparent by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213320@lists.php.net to get a copy of this message | ||
Note Submitter: partyheld at HATESPAMgmail dot com
----
Fred wrote:
<?php
$file['signatur']= substr($result,0,3);
$file['version']= substr($result,3,3);
$file['width']=
ord(substr($result,6,1))+ord(substr($result,7,1))*256;
$file['height']= ord(substr($result,8,1))+ord(substr($rsult,9,1))*256;
$file['flag']= ord(substr($result,10,1))>>7;
$file['trans_red']= ord(substr($result,ord(substr($result,11))*3,1));
$file['trans_green']= ord(substr($result,ord(substr($result,11))*3+1,1));
$file['trans_blue']= ord(substr($result,ord(substr($result,11))*3+2,1)) ;
?>
You should write such code like this:
<?php
$file = array(
"signatur" => substr ($result, 0, 3),
"version" => substr ($result, 3, 3),
"width" => ord (substr ($result, 6, 1)) + ord (substr ($result, 7,
1)) * 256,
"height" => ord (substr ($result, 8, 1)) + ord(substr ($result, 9,
1)) * 256,
"flag" => ord (substr ($result, 10, 1)) >> 7,
"trans_red" => ord (substr ($result, ord (substr ($result, 11)) * 3,1)),
"trans_green" => ord (substr ($result, ord (substr($result, 11)) * 3 + 1,
1)),
"trans_blue" => ord (substr ($result, ord (substr($result, 11)) * 3 + 2,
1))
);
?>
And there's a typo in line 4, sayin "rsult" instead of "result". I've
got no time for checking your code any further, sorry.