php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51902 imagettftext() - wrong character aligning in the textbox
Submitted: 2010-05-24 23:09 UTC Modified: 2010-05-25 04:55 UTC
From: tgabor72 at freemail dot hu Assigned:
Status: Duplicate Package: GD related
PHP Version: 5.3.2 OS: WinXP - IIS -fastcgi
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 + 16 = ?
Subscribe to this entry?

 
 [2010-05-24 23:09 UTC] tgabor72 at freemail dot hu
Description:
------------
 imagettftext($image,$FontSize,$RotationAngle=90,$x,$y,$Color,$font,$value);

This function worked well in the previous version of PHP (5.3.1), after updating PHP package, the next bug can be realized:

When you work with image processing functions and using imagettftext() function to write some text to the image area, and if you use for example 90 degrees rotating for the text (that is the 3rd parameter of this funcion), a wrong text align is visible on the image, because all characters are fitted to the upper edge of the textbox. It is a new problem, because there are not available any kind of text aligning functions under image processing extension...

To corrigate this bug, strongly advised to use the previous version of PHP (v5.3.1)

Test script:
---------------
$image=@imagecreate(500,500);
$background_color=imagecolorallocate($image,40,40,40);
$font="./arial.ttf";
$Color=imagecolorallocate($image,255,0,255);
imagettftext($image,12,90,10,100,$Color,$font,"Something, Text.");
imagepng($image);
imagedestroy($image);


Expected result:
----------------
This function worked well in the previous version of PHP (5.3.1), after updating PHP package, the next bug can be realized:

When you work with image processing functions and using imagettftext() function to write some text to the image area, and if you use for example 90 degrees rotating for the text (that is the 3rd parameter of this funcion), a wrong text align is visible on the image, because all characters are fitted to the upper edge of the textbox. It is a new problem, because there are not available any kind of text aligning functions under image processing extension...

To corrigate this bug, strongly advised to use the previous version of PHP (v5.3.1)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-25 04:55 UTC] aharvey@php.net
-Status: Open +Status: Duplicate
 [2010-05-25 04:55 UTC] aharvey@php.net
Bug #51263 deals with this.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 01:01:24 2021 UTC