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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tgabor72 at freemail dot hu
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC