ID: 50971
Comment by: jvp at 4ssl dot us
Reported By: sks76543210 at gmail dot com
Status: Open
Bug Type: GD related
Operating System: CentOS 5
PHP Version: 5.*, 6
New Comment:
***** 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
Previous Comments:
------------------------------------------------------------------------
[2010-02-09 13:04:41] sks76543210 at gmail dot com
The bug occurs in the two PHP versions I have available to test on
here. Perhaps I can try on a win32 box when I get to work.
PHP 5.3.3-dev compiled from src
-------------------------------
GD Version: bundled (2.0.34 compatible)
Freetype Version: 2.2.1
./configure --with-apxs2=/home/user/bin/httpd/bin/apxs
--prefix=/home/user/bin/php --with-pdo-mysql --with-zlib --with-gd
--with-gettext --with-freetype-dir --enable-gd-native-ttf
PHP 5.1.6 from centos rpms
--------------------------
GD Version: bundled (2.0.28 compatible)
FreeType Version 2.2.1
------------------------------------------------------------------------
[2010-02-09 09:53:59] [email protected]
Which GD library do you use? Bundled?
------------------------------------------------------------------------
[2010-02-09 06:39:41] 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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50971&edit=1