#24280 [NEW]: imagettftext() randomly returns a warning

From: Date: Sat, 21 Jun 2003 21:18:30 +0000
Subject: #24280 [NEW]: imagettftext() randomly returns a warning
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42317@lists.php.net to get a copy of this message
From: haafiz at ezwebsolutions dot ca Operating system: Windows 2000 Server PHP version: 4.3.2 PHP Bug Type: GD related Bug description: imagettftext() randomly returns a warning 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. -- Edit bug report at http://bugs.php.net/?id=24280&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24280&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24280&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24280&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24280&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24280&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24280&r=support Expected behavior: http://bugs.php.net/fix.php?id=24280&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24280&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24280&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24280&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24280&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24280&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24280&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24280&r=gnused

« previous php.bugs (#42317) next »