php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28885 imagettftext fails
Submitted: 2004-06-23 03:22 UTC Modified: 2004-07-03 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: aderyn at gentoo dot se Assigned:
Status: No Feedback Package: GD related
PHP Version: 5.0.0RC3 OS: Linux 2.6.7 (Gentoo)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-23 03:22 UTC] aderyn at gentoo dot se
Description:
------------
This code (See below) leaves the image empty, without returning any kind of error. I've verified that it really remains empty several times. The intresting thing is that if I replace imagecreatetruecolor with imagecreate it works.

Configure-line:
'./configure' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-xsl' '--with-gd' '--with-pspell' '--with-ttf' '--with-zlib' '--with-jpeg-dir=/usr/lib' '--enable-sockets' '--enable-ftp' '--with-mysql=/usr/local/mysql40/' '--enable-exif'

No gd-related changes to php.ini.

Reproduce code:
---------------
list($ll['x'],$ll['y'],$lr['x'],$lr['y'],$ur['x'],$ur['y'],$ul['x'],$ul['y']) = imagettfbbox(10,0,FONT,$text);
//echo abs($lr['x'])+abs($ur['x']),' ',abs($ur['y'])+abs($lr['y']);
$img2 = imagecreatetruecolor(abs($lr['x'])+abs($ul['x']),abs($ur['y'])+abs($lr['y']));
imagecolorallocate($img2,0,0,0);
imagettftext($img2,10,0,$ul['x'],8,imagecolorallocate($img2,255,0,0),FONT,$text);
imagepng($img2,'foo.png');
imagedestroy($img2);

Expected result:
----------------
The text outputted on the image canvas.

Actual result:
--------------
A blank image.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-23 22:17 UTC] moriyoshi@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


- What's the content of FONT ?
- What's the content of $text?
- What's the exact size of the produced image?

 [2004-06-24 14:28 UTC] pajoye@php.net
Please provide a short script to reproduce your problem (create an image, draw a text, save the image).

Which Freetype version do you use?

--Pierre
 [2004-07-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 23:01:30 2024 UTC