php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35255 imagettftext, imagettfbbox and imageFTBBox broken on 64 bit
Submitted: 2005-11-17 09:34 UTC Modified: 2005-11-17 14:28 UTC
From: phpbugs at exozet dot com Assigned: pajoye (profile)
Status: Not a bug Package: GD related
PHP Version: 4.4.1 OS: OpenSuSE 10.0 x86_64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at exozet dot com
New email:
PHP Version: OS:

 

 [2005-11-17 09:34 UTC] phpbugs at exozet dot com
Description:
------------
imagettftext() ignores x coordiantes in this PHP 4.3.11 (#34951). The same code works properly in the SAME version but compiled on the same machine with SuSE/Linux 9.2 x64_64.
On a 32bit Machine with OpenSuSE 10.0 and the same configure and so on it works.

In addition I tested PHP 4.4.1 and the stable snapshot php4-STABLE-200511161138. The result are totaly out of range and not the same as in 4.3.11.

I put the results, the "make test" output, the rpm list and the source code under http://www.exozet.com/phpbug-1/

So I need a patch / workaround for PHP 4.3.11 and PHP 4.4.1 (yes, yes, PHP 4.3.11, but many applications didn't work under 4.4.1 so we need the 4.3.11!)

Thanks a lot...


Reproduce code:
---------------
<?php
$im = imagecreatetruecolor(400, 30);

$grey = imagecolorallocate($im, 128, 128, 128);

$text = 'Testing...';
$font = 'arial.ttf';

echo "imagettftext:\n";
print_r ( imagettftext ( $im, 20, 0, 110, 21, $grey, $font, $text ) );

echo "imagettfbbox:\n";
print_r ( imagettfbbox ( 20, 0, $font, $text ) );

echo "imageFTBBox:\n";
print_r ( imageFTBBox ( 20, 0, $font, $text ) );
?>

Expected result:
----------------
imagettftext:
Array
(
    [0] => 111
    [1] => 27
    [2] => 219
    [3] => 27
    [4] => 219
    [5] => 1
    [6] => 111
    [7] => 1
)
imagettfbbox:
Array
(
    [0] => 0
    [1] => 5
    [2] => 108
    [3] => 5
    [4] => 108
    [5] => -21
    [6] => 0
    [7] => -21
)
imageFTBBox:
Array
(
    [0] => 0
    [1] => 5
    [2] => 108
    [3] => 5
    [4] => 108
    [5] => -21
    [6] => 0
    [7] => -21
)


Actual result:
--------------
imagettftext:
Array
(
    [0] => 0
    [1] => 27
    [2] => 108
    [3] => 27
    [4] => 108
    [5] => 0
    [6] => 0
    [7] => 0
)
imagettfbbox:
Array
(
    [0] => -1
    [1] => 5
    [2] => 107
    [3] => 5
    [4] => 107
    [5] => -21
    [6] => -1
    [7] => -21
)
imageFTBBox:
Array
(
    [0] => -1
    [1] => 5
    [2] => 107
    [3] => 5
    [4] => 107
    [5] => -21
    [6] => -1
    [7] => -21
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-17 09:38 UTC] sniper@php.net
Please try using this CVS snapshot:

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

We only start supporting 64bit support in 5.1 and above.
 [2005-11-17 10:10 UTC] phpbugs at exozet dot com
Sorry, but PHP 5 didn't helps us.
I compiled PHP in 32bit mode but the same results.
So please give us a hint to fix that problem in our configuration.
In the moment I compile your PHP5-lastest. First the t1lib is outdatet and I compile my own.
Now, configure is done, and make is in progress...
btw. you find the loggings of the configure's and make's in the directorys under the URL I provided.
Can't make it! Errors with T1_StrError. I try w/o t1lib. You can find the make-failed_t1.log here: http://www.exozet.com/phpbug-1/64bit/php5-200511170730/make-failed_t1.log
 [2005-11-17 11:32 UTC] phpbugs at exozet dot com
configure and make w/o t1lib successful.
But the result of testpic.php is nearly the same as in 4.4.1!
Get a look:
http://www.exozet.com/phpbug-1/64bit/php5-200511170730/
 [2005-11-17 12:29 UTC] pajoye@php.net
Please provide the font you use.

I fail to see the relation between t1lib and the ttf functions.

4.3.x is a dead branche. 4.4.x is the active php4 branche. 
 [2005-11-17 12:54 UTC] tony2001@php.net
I can see the very same result on x86 host.
Doesn't look like a bug to me (yes, it's perfectly fine to have negative coordinates).
 [2005-11-17 13:10 UTC] phpbugs at exozet dot com
@tony2001
in PHP 4.3.11 I have allway a x coordiante = 0:
http://www.exozet.com/phpbug-1/64bit/php-4.3.11/stdout.txt
in PHP => 4.4.1 the coordiantes are like this high values:
http://www.exozet.com/phpbug-1/64bit/php-4.4.1/stdout.txt

it must be:
http://www.exozet.com/phpbug-1/32bit/php-4.3.11/stdout.txt
http://www.exozet.com/phpbug-1/32bit/php-4.4.1/stdout.txt
 [2005-11-17 13:13 UTC] phpbugs at exozet dot com
here is the font:
http://www.exozet.com/phpbug-1/arial.ttf

Normally I didn't configure with 'ttf' (freetype1). But I tried it and nothing changed.

May it helps to disable t1lib and ttf? (on 32bit it es enables and it works, grrr... :-)
 [2005-11-17 13:59 UTC] sniper@php.net
Are you sure it isn't a problem with the t1lib itself..?

 [2005-11-17 14:28 UTC] pajoye@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

I tried 4.4 cvs, 5.1 cvs, it works both on x86, x86_64 and ppc_64.

You are certainly messing libs on your system. But it is not a php bug.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 18:01:34 2024 UTC