#34925 [NEW]: imagettftext broken on 64 bit
| From: | keith dot miller at ricardo dot com | Date: | Thu, 20 Oct 2005 08:15:23 +0000 |
| Subject: | #34925 [NEW]: imagettftext broken on 64 bit | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-86784@lists.php.net to get a copy of this message | ||
From: keith dot miller at ricardo dot com
Operating system: RHEL 2.6.9-11.EL SMP
PHP version: 5.0.5
PHP Bug Type: GD related
Bug description: imagettftext broken on 64 bit
Description:
------------
imagettftext() ignores absolute positions in this version of PHP.
The same code works properly in previous versions. TrueType fonts are now
always aligned on the LHS of the image, and positioning is completely
broken.
This is built on 64-bit Red Hat Enterprise with gcc (GCC) 3.4.3 20050227
(Red Hat 3.4.3-22.1).
gcc -m64 (other flags are default produced by configure)
Everything else on the system in stock redhat (with latest patches applied
under support contract)
Reproduce code:
---------------
<?php
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 255, 255, 255);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = '/var/www/ttf/arial.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 111, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 101, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
Expected result:
----------------
Text should be aligned offset from the LHS of the image, not at the LHS.
In previous versions of PHP, this works correctly.
Actual result:
--------------
Text is aligned at the LHS of the image, regardless of the X & Y values.
--
Edit bug report at http://bugs.php.net/?id=34925&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34925&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34925&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34925&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34925&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34925&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34925&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34925&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34925&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34925&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34925&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34925&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34925&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34925&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34925&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34925&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34925&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34925&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34925&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34925&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34925&r=mysqlcfg