php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43971 imageFTText error with angle = 180
Submitted: 2008-01-29 17:20 UTC Modified: 2008-10-31 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: raven7370 at yahoo dot com Assigned:
Status: No Feedback Package: GD related
PHP Version: 5.2.5 OS: Linux Debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-01-29 17:20 UTC] raven7370 at yahoo dot com
Description:
------------
When i use imagefttext such with an angle of 180 i get the error:
imagefttext() [function.imagefttext]: Problem rendering glyph

With an angle of close to 180 (between 179 and 184.6) but not equal to 180 i do not get an error but the text simply won't be drawn. 
With an angle between 177 to 179 the text will be drawn but stretched vertically.

This problem occurs with almost all windows fonts with a few exceptiosn, those being the Chinese ones (SIMSUN.TTF and PMINGLIU.TTF)

With:
GD Support  enabled  
GD Version  bundled (2.0.34 compatible)  
FreeType Support  enabled  
FreeType Linkage  with freetype  
FreeType Version  2.1.7  



Reproduce code:
---------------
$image = imagecreate(512,512);
imagecolorallocate($image,0,0,0); 
$color = imagecolorallocate($image,255,0,0);
imagefttext($image, 21, 176.9, 256, 256, $color, 'ARIALNB.TTF', 'Hello World');
imagegif($image);

The font mentioned here is from the windows/fonts directory (just copied directly in the same path as the script)

Expected result:
----------------
I expect to see a pictures with hello world written on it upside down.

Actual result:
--------------
With an angle of 180 the error "imagefttext() [function.imagefttext]: Problem rendering glyph in ..." is thrown, close to 180 the text is either not drawn or is stretched.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-29 17:22 UTC] raven7370 at yahoo dot com
in the reproduce code the angle argument should be 180 such as:
imagefttext($image, 21, 180, 256, 256, $color, 'ARIALNB.TTF', 'Hello
World');

i copied it quickly while i was still testing.
 [2008-01-29 17:34 UTC] pajoye@php.net
I can't reproduce it using php 5.2.5 or CVS. If you use the PHP's package from Debian, I fear that I can't help, they do changes that have nothing to do with any libgd versions (that may change once the politics there is over).

Can you try it using snapshots. Which freetype version do you use?
 [2008-01-30 17:18 UTC] raven7370 at yahoo dot com
Thanks for trying it. My PHP uses FreeType Version 2.1.7
I think you might be right in that it is a package problem and not a php one.The php i use is not standalone but from lampp (linux version of xampp from apache friends).

I will try to get the latest snapshot of 5.2 running separately to see if it works then. Otherwise i will try to get someone from apache friends to test it and see if they can reproduce the problem.
 [2008-10-23 12:30 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-10-31 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 12 17:01:34 2024 UTC