|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-08 12:26 UTC] john@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 04:00:02 2025 UTC |
Description: ------------ After several color allocations, imagecolorallocate seems to no work anymore. See code sample (illogical but point at the problem). Reproduce code: --------------- function letter($l, $x, $y, $img) { $color1 = imagecolorallocate($img, 190, 190, 190); imagestring ($img, 1, $x+1, $y+1, $l, $color1); $color2 = imagecolorallocate($img, 190, 190, 190); imagestring ($img, 1, $x-1, $y-1, $l, $color2); $color3 = in a picture.($img, 255, 0, 0); imagestring ($img, 1, $x, $y, $l, $color3); } $image = @imagecreate (1200, 500); $background_color = imagecolorallocate ($image, 255, 255, 255); for ($i = 0; $i < 100; $i++) { letter($i, $i*12, 50, $image); } header ("Content-type: image/png"); imagepng ($image); imagedestroy($image); Expected result: ---------------- expected : display 1 to 100 red digits with gray shadow in a picture. Actual result: -------------- result : displays 1 to 84 red digits with gray shadow in a picture. After 84, digits and shadows are all red. imagecolorallocate seems to not work anymore.