php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18252 angle in ImageTTFText now works clockwise
Submitted: 2002-07-09 18:13 UTC Modified: 2002-09-17 06:33 UTC
Votes:3
Avg. Score:4.0 ± 0.0
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: dpetrov at nchcapital dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.0-dev OS: FreeBSD 4.6
Private report: No CVE-ID: None
 [2002-07-09 18:13 UTC] dpetrov at nchcapital dot com
In accordance with the manual, positive angle should cause rotation counter-clockwise, but with the latest version this is not true.

I am not sure where the problem lies. Just in case, I have Freetype 2.1.2 abd GD 2.0.1.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-09 18:33 UTC] sniper@php.net
I can't reproduce this. Please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz

(setting angle to 90 makes the text to be readable when you bend your head to left..)



 [2002-07-09 18:49 UTC] dpetrov at nchcapital dot com
I will try to test it  - but it is going to take some time.

For now, please could you check this script: http://www.dpetrov.com/misc/ttf/test.php

The source is here:

http://www.dpetrov.com/misc/ttf/test.phps

Another strange thing is that 2 line text now rotated differently too - before it was rotated as 1 rectangle of 2 lines height, now it is like each line is moved to the right.

The bigger the angle, the longer the move.

What is the quick and easy way to check if my ImageTTFText is actually calling ImageFT from GD library or gdTTF from gdttf.c?
 [2002-07-09 18:53 UTC] sniper@php.net
Apparently fixed since your example writes it as expected.
(opposite of your site's result)

 [2002-07-09 18:59 UTC] dpetrov at nchcapital dot com
So, is it a confirmed bug in 4.2.1 fixed in the CVS or you think it is an isolated problem on my server?

Could you please send to me a sample image that you get with my script (with negative angle, so it will be rotated clockwise) or with a similar script that prints a *multi-line* text?
 [2002-07-09 19:30 UTC] sniper@php.net
<?php                                                                                          
                                                                                               
$text = ".          Testing ...";

$im = ImageCreate(600,600);

$blue = ImageColorAllocate($im, 128,128,255);
$black = ImageColorAllocate($im, 0,0,0);
$yel = ImageColorAllocate($im, 255,255,0);
$wh = ImageColorAllocate($im, 255,255,255);
$gr = ImageColorAllocate($im, 0,255,0);

imageFilledRectangle($im, 0, 0, 599, 159, $blue);
                
for ($a=0; $a <= 180 ; $a=$a+20) {
    ImageTtfText($im, 12, $a, 300, 300, $wh, "/usr/share/fonts/default/TrueType/arial.ttf", $text);
}               

header("Content-Type: image/png");
ImagePng($im);
ImageDestroy($im);
  
  
?>

This script produces nice half of a circle.. No bugs.
In your setup it will draw the lower half of the cirlce.
Please try the snapshot.

 [2002-07-10 17:31 UTC] dpetrov at nchcapital dot com
I installed the latest version of PHP - still same problem.

Apparently, it is somehow related to versions of GD/Freetype I have or it is something to do with the configuration.
 [2002-07-10 18:20 UTC] sniper@php.net
Check first what version you have for GD in phpinfo() output. And did you mean with latest version this snapshot:

  http://snaps.php.net/php4-latest.tar.gz

 [2002-07-11 09:00 UTC] dpetrov at nchcapital dot com
Yes, I used the latest snapshot (yesterday's).

I tried it both with GD 2.0.1 and with bundled version (2.0 compatible).

I guess the problem is somewhere else. I am going to look into patches applied to GD on FreeBSD platform.
 [2002-07-15 13:28 UTC] dpetrov at nchcapital dot com
I made further tests - even installed lastest snaphot and also 4.2.1 on a completely different computer (all other things - GD, Freetype, PNG, Jpeg were installed from scratch also), and I still have same problem.

I also tried to compile latest snapshot with bundled GD, and tried it with and without --enable-gd-native-ttf.

So, the bug is easily reproduced - at least under FreeBSD 4.6.
 [2002-07-18 13:23 UTC] dpetrov at nchcapital dot com
I think the bug should be reopened, since it is reproducable.
 [2002-07-18 13:44 UTC] sniper@php.net
Just note that I could NOT reproduce this with latest CVS.
(with Linux)


 [2002-08-09 00:45 UTC] kalowsky@php.net
The sample image provided by dams, http://www.deadmime.org/~dank/test.png

Is this what you were looking for?

Mind you this is GD 2.0.1 built without FreeType support (apparently on OSX the two don't mix nicely).  

If this is what you were looking for, any chance you can try rebuilding GD without FreeType support, just to narrow down the differences of course. 
 [2002-09-09 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, 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".
 [2002-09-11 08:57 UTC] dpetrov at nchcapital dot com
I am still having this same problem - tried everything.

Here is what script produces:

http://www.dpetrov.com/misc/ttf/test4.php

And here is the source:

http://www.dpetrov.com/misc/ttf/test4.phps
 [2002-09-17 06:32 UTC] sesser@php.net
Reproduced!

This is a problem within libfreetype. Depending on the
freetype version the angles are counted in different
directions.
 [2002-09-17 06:33 UTC] derick@php.net
Not a php bug -> bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 07:01:30 2024 UTC