php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: frederic dot lamsens at rug dot ac dot be
New email:
PHP Version: OS:

 

 [2001-01-03 17:33 UTC] frederic dot lamsens at rug dot ac dot be
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 ...

Patches

Pull Requests

History

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

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

http://www.php.net/~andi/php-4.0.6RC2.tar.gz

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC