|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-02-09 06:39 UTC] sks76543210 at gmail dot com
Description: ------------ imagettftext() and imagettfbbox() both return wrong bounding box if the angle is not set to 0. This sounds similar to a bug closed last year at http://bugs.php.net/bug.php?id=43073 See http://www.yessum.org/gdbug2/ for font and samples. This bug appears to be in 5.1.6, and has since gotten worse in the latest svn. Also, in 5.3.3-dev, the text doesn't seem to even be on the same baseline on many of the angles. Reproduce code: --------------- <?php $font = './cour.ttf'; // Courier New $im = imagecreatetruecolor(600, 600); imagefill($im, 0, 0, imagecolorallocate($im, 224, 224, 224)); $black = imagecolorallocate($im, 0, 0, 0); $red = imagecolorallocate($im, 255, 0, 0); $angle = 0; do { $bbox = imagettftext($im, 16, $angle, 299, 299, $black, $font, 'The quick brown fox'); imagepolygon($im, $bbox, 4, $red); $angle += 45; } while ($angle < 360); header('content-type: image/png'); imagepng($im); Expected result: ---------------- The bounding box should be a bounding box Actual result: -------------- The string is not contained in the bounding box. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 23:00:01 2025 UTC |
***** failures from 'make test' of 5.2.12 ***** these types of problems keep recurring (since 2001) so it seems that svn changes sometimes never make it to a stable release or there is no co-ordination with gd developers to prevent them from popping up again. i am normally happy with the centos lag away from fresh releases, but i need at least 5.2.12 for nginx and that is why i am trying to compile from source. 1.) 'Bug #43073/#48732 (TrueType bounding box is wrong for angle<>0) [ext/gd/tests/bug43073.phpt]'; 2.) 'Bug #48801/#48732 (Problem with imagettfbbox) [ext/gd/tests/bug48801.phpt]'; also (maybe) 3.) 'Test imagecolorallocate() function : usage variations - passing different data types to fourth argument [ext/gd/tests/imagecolorallocate_variation4.phpt]' using: Linux 2.6.18-128.1.1.el5.028stab062.3 #1 SMP MSD 2009 x86_64 x86_64 x86_64 GNU/Linux 2.0.33 of gd.x86_64, gd-devel.x86_64, & gd-progs.x86_64 2.2.1 of freetype.x86_64 & freetype-devel.x86_64 5.1.0 of t1lib.x86_64 & t1lib-devel.x86_64 .\configure \ --disable-cgi \ --disable-ipv6 \ --enable-bcmath \ --enable-calendar \ --enable-dom \ --enable-exif \ --enable-fastcgi \ --enable-force-cgi-redirect \ --enable-ftp \ --enable-gd-jis-conv \ --enable-gd-native-ttf \ --enable-json \ --enable-pdo \ --enable-short-tags \ --enable-soap \ --enable-sockets \ --enable-zip \ --with-Xpm-dir \ --with-apxs2=\usr\sbin\apxs \ --with-bz2 \ --with-curl \ --with-db4 \ --with-freetype-dir \ --with-gd \ --with-gettext \ --with-imap \ --with-imap-ssl \ --with-jpeg-dir \ --with-kerberos \ --with-libdir=lib64 \ --with-mcrypt \ --with-mhash \ --with-mysql \ --with-mysql-sock \ --with-mysqli \ --with-ncurses \ --with-pdo-mysql \ --with-png-dir \ --with-pspell \ --with-snmp \ --with-t1lib \ --with-ttf \ --with-xpm-dir \ --with-xsl \ --with-zlib-dir -- thank you, johann