|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-23 14:44 UTC] haafiz at ezwebsolutions dot ca
[2003-06-23 17:40 UTC] iliaa@php.net
[2011-01-11 20:31 UTC] rasmus at mindplay dot dk
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
Description: ------------ Every so often, I get this output from my file: <br /> <b>Warning</b>: imagettftext(): Problem loading glyph in <b>g:\hostroot\a0007\default\wwwroot\images\button.php</b> on line <b>81</b><br /> ?PNG IHDR ? ?~? TPLTE ???????߿??ϟ???d?ϟ????ٳ?ر?ӧ__G??~??m?Р???GG5vvY?̙???33&ffLLL9_??r?g"? ?IDATx????? D?????????6iZ?Dġs??x????&?WX,?5i???H5?|???^"$?:V??#>??D??W??X?????Y???syFj*O??? B?uf? ???HM剴????줻5??"?&"?NL????o??4 Q?W? ?|?55?'?9J戓?l?ɦ&?J???D??O4?*???KMzܟ???:?O 6 IEND?B`? And so ofcourse, the image displays as the notorious red X in IE Reproduce code: --------------- <?php define("FONTFILE", "./arial.ttf"); define("FONTSIZE", 8); define("WIDTH", 145); if ($_GET["bottom"] == 1) { define("HEIGHT", 20); $mod = -1; } else { define("HEIGHT", 19); $mod = 0; } $im = imagecreate(WIDTH,HEIGHT); $black = imagecolorallocate($im, 0, 0, 0); //This part of the code was omited because of its length. It basically is a bunch of imagesetpixel(), imageline(), and imagefilledrectangle() functions to give this button a 3d bevel. //text $textdata = imagettfbbox(FONTSIZE, 0, FONTFILE, $_GET["text"]); $bbox_h = $textdata[1] - $textdata[7]; imagettftext($im, FONTSIZE, 0, 4, 14, $black, FONTFILE, $_GET["text"]); imagepng($im); ?> Expected result: ---------------- Most of the time this works, but it randomly gives the error described above. This problem only occurs on PHP 4.3.2 and worked fine under 4.2.3.