PHP 4.0 Bug #8544: ImageTTFText
| From: | frederic dot lamsens at rug dot ac dot be | Date: | Wed, 03 Jan 2001 22:33:42 +0000 |
| Subject: | PHP 4.0 Bug #8544: ImageTTFText | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42886@lists.php.net to get a copy of this message | ||
From: frederic.lamsens@rug.ac.be
Operating system: Madrake Linux 7.2
PHP version: 4.0.4
PHP Bug Type: GD related
Bug description: ImageTTFText
System:
Linux 2.2.17-21mdksecure #1 SMP Thu Oct 5
Asus Dual PIII 450 Mhz
NVidia Riva128
256 Mb SDRam
PHP Configuration:
./configure --with-mysql
--with-apxs=/usr/local/apache/bin/apxs
--with-ttf --with-gd --with-ldap
GD:
GD Version 1.8.1 (static)
Freetype Version 1.3
FreeType Support enabled
FreeType Linkage with TTF library
PNG Support enabled
When I compiled PHP and used ImageTTFText, the result was not what I expected. Although I can see my
input string, the text was shown at an angle of 270 degrees and mirrored. So 'The' looks
like '|-' and the 2 next charachters are below the '|-'.
I have been able to solve the problem by changing the php code and recompile the whole thing.
Filename: gdttf.c (located in ext\gd)
Line: around 743
Original code:
#if HAVE_LIBGD13
pixel = &im->pixels[y3][x3];
#else
pixel = &im->pixels[x3][y3];
#endif
New code:
pixel = &im->pixels[y3][x3];
By reversing the arguments, the image is now correct.
I hope this information helps ...
--
Edit Bug report at: http://bugs.php.net/?id=8544&edit=1