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
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: 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

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: Fri Oct 22 07:03:33 2021 UTC