From:             phpbugs at exozet dot com
Operating system: OpenSuSE 10.0 x86_64
PHP version:      4.4.1
PHP Bug Type:     GD related
Bug description:  imagettftext, imagettfbbox and imageFTBBox broken on 64 bit

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
)


-- 
Edit bug report at http://bugs.php.net/?id=35255&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35255&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35255&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35255&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35255&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35255&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35255&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35255&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35255&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35255&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35255&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35255&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35255&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35255&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35255&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35255&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35255&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35255&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35255&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35255&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35255&r=mysqlcfg

Reply via email to