|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8544 ImageTTFText
Submitted: 2001-01-03 17:33 UTC Modified: 2001-06-03 06:47 UTC
From: frederic dot lamsens at rug dot ac dot be Assigned:
Status: Closed Package: GD related
PHP Version: 4.0.4 OS: Madrake Linux 7.2
Private report: No CVE-ID: None
 [2001-01-03 17:33 UTC] frederic dot lamsens at rug dot ac dot be
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-ttf --with-gd --with-ldap

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:

             pixel = &im->pixels[y3][x3];
             pixel = &im->pixels[x3][y3];

New code:        

pixel = &im->pixels[y3][x3];

By reversing the arguments, the image is now correct.

I hope this information helps ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-03 17:39 UTC] frederic dot lamsens at rug dot ac dot be

ImageTTFText ($theImage, 40, 0, 30, 150, $black, "/home/httpd/html/flwi/pcroom/arial.ttf", "Testing... Omega: Ω");
 [2001-06-03 06:47 UTC]
This should be fixed in PHP 4.0.6. Please try the latest
release candidate:


PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 03:01:31 2024 UTC