From: kees at tweakers dot net Operating system: Linux PHP version: 5.0.0 PHP Bug Type: GD related Bug description: imagettfbbox / imagettfbbox returning wrong values w/ linebreaks
Description: ------------ The imagettfbbox / imagettftext should return an array with the boundaries on texts. This works fine with a single string, but if you use a multiline string (with \n in it) it fails to report the actual size, and returns the size / box of a single line. The string _is_ writen normally on the image, ie; with a newline instead of an \n, but the sizes are wrong. Reproduce code: --------------- // string with a line break, try imagettftext, it'll put the correct string on the image, but return the wrong results $bounds = imagettfbbox(8, 0, 'tahoma.ttf', 'j\nj'); print_r($bounds); // no line break here, just a \ instead of a /, which is the same size. $bounds = imagettfbbox(8, 0, 'tahoma.ttf', 'j/nj'); print_r($bounds); Expected result: ---------------- The first line should return something like a box with an x/y of 3 / 26 (or close), the second result should return (and does ;)) an x/y box of 15 / 12. Actual result: -------------- Both will give the same result, a box of x: 15 y: 26. -- Edit bug report at http://bugs.php.net/?id=29249&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29249&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29249&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29249&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29249&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29249&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29249&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29249&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29249&r=support Expected behavior: http://bugs.php.net/fix.php?id=29249&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29249&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29249&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29249&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29249&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29249&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29249&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29249&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29249&r=float