php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15568 ImageTTFText doesn't work in 4.1.1
Submitted: 2002-02-15 09:21 UTC Modified: 2002-03-21 02:42 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:0 (0.0%)
From: reweiner at yahoo dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.1.1 OS: Linux
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: reweiner at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-02-15 09:21 UTC] reweiner at yahoo dot com
The following code works in 4.0.6 but doesn't in 4.1.1

Both are compiled with the same flags:
--with-freetype --with-gd --with-ttf

For 4.1.1 I added:
--enable-gd-native-ttf --with-freetype-dir=/usr

( you need a font to test this. In this case - shelley.ttf )

<?php
Header ("Content-type: image/png");
$im = imagecreate (400, 30);
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 10, 20, $white, "shelley.ttf",
              "Testing... Omega: &#937;");
ImagePNG($im);
ImageDestroy ($im);
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-15 09:37 UTC] mrobinso@php.net
What error message do you get when running this
code?
 [2002-02-15 09:50 UTC] reweiner at yahoo dot com
No errors. Just a black square.
 [2002-02-21 17:25 UTC] taco at sun dot com
Remove the header line and take a look at the output. You will probably see the error now ....
 [2002-02-24 19:12 UTC] matt at zevi dot net
I have come across the same issue on Win2K running PHP4.1.1.
The code worked in 4.0.6 though.

The error message I am getting (if I comment out the ImagePNG line) is a strange one:
Warning: ??O in (file) on line 6

Those funny characters (if you can see them) are what PHP outputs - they seem to be fairly random though - sometimes I get different funny characters.
 [2002-02-27 12:15 UTC] reweiner at yahoo dot com
Tried with PHP 4.1.2. It still doesn't work.
 [2002-03-12 16:26 UTC] matt at zevi dot net
Tried with PHP 4.1.2 on Win2K/Apache - still doesn't work - still getting those funny characters as the error message I noted earlier on.
 [2002-03-13 07:22 UTC] reweiner at yahoo dot com
Again, unfortunately no messages. Just the black square.
 [2002-03-21 02:01 UTC] matt at zevi dot net
Just tried using 4.2.0RC1 on Win2K/Apache - seems to be working fine.
 [2002-03-21 02:42 UTC] derick@php.net
Closing then
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Apr 28 21:01:30 2025 UTC