note 74790 added to function.imagecolorstotal
| From: | bisqwit at iki dot fi | Date: | Fri, 27 Apr 2007 15:07:51 +0000 |
| Subject: | note 74790 added to function.imagecolorstotal | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125919@lists.php.net to get a copy of this message | ||
This code shows the palettes for all .gif files in the current working directory. (Output is HTML.)
<?php
print '<pre>';
foreach(glob('*.gif') as $src_fn)
{
$im2 = ImageCreateFromGif($src_fn);
echo '<a href="',htmlspecialchars($src_fn),'">';
print sprintf('%-30s', $src_fn);
echo '</a>';
$cc = ImageColorsTotal($im2);
for($n=0; $n<$cc; ++$n)
{
$c = ImageColorsForIndex($im2, $n);
print
sprintf('<span
style="background:#%02X%02X%02X"> </span>',
$c['red'], $c['green'], $c['blue']);
}
ImageDestroy($im2);
print "\n";
}
print '</pre>';
?>
----
Server IP: 80.81.171.181
Probable Submitter: 194.157.58.35
----
Manual Page -- http://www.php.net/manual/en/function.imagecolorstotal.php
Edit -- https://master.php.net/note/edit/74790
Del: integrated -- https://master.php.net/note/delete/74790/integrated
Del: useless -- https://master.php.net/note/delete/74790/useless
Del: bad code -- https://master.php.net/note/delete/74790/bad+code
Del: spam -- https://master.php.net/note/delete/74790/spam
Del: non-english -- https://master.php.net/note/delete/74790/non-english
Del: in docs -- https://master.php.net/note/delete/74790/in+docs
Del: other reasons-- https://master.php.net/note/delete/74790
Reject -- https://master.php.net/note/reject/74790
Search -- https://master.php.net/manage/user-notes.php