php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1607 ImageTTFString draws mirrored text
Submitted: 1999-06-27 01:59 UTC Modified: 1999-07-02 12:42 UTC
From: php-user at mindcontrol dot org Assigned: markonen (profile)
Status: Closed Package: Misbehaving function
PHP Version: 3.0.9 OS: Linux 2.0 (RedHat 4.2)
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: php-user at mindcontrol dot org
New email:
PHP Version: OS:

 

 [1999-06-27 01:59 UTC] php-user at mindcontrol dot org
<?
   Header("Content-type: image/gif");

   $image = @imagecreate(200,100);
   $white = @imagecolorallocate($image, 255, 255, 255);
   $black = @imagecolorallocate($image, 0, 0, 0);
   $red = @imagecolorallocate($image, 255, 0, 0);
   $blue = @imagecolorallocate($image, 0, 0, 255);
   @imagefilledrectangle($image, 0, 0, 199, 99, $red);
   @imagefilledrectangle($image, 10, 10, 190, 90, $black);
   @imagettftext($image, 12, 90, 20, 25, $blue, "ARIAL.TTF", "Good-bye, world!");
   imagegif($image);
   @imagedestroy($image);
?>


I'm running Apache 1.3.6, PHP 3.0.9 built as a static module, GD 1.5 and libttf 1.2.

I built using:
./configure --with-pgsql --with-apache=../apache_1.3.6 --with-gd=/home/hplus/src/gd1.5

PS: I also had to add extra LDFLAGS and LIBS to the Apache config when doing this, as the config process doesn't do it for me. I also had to define HAVE_LIBTTF manually in config.h. Maybe that should be another bug report.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-02 11:26 UTC] markonen at cvs dot php dot net
You are specifying an angle of 90 degrees for your type. In PHP3, that means the text angle is rotated 90 degrees counter-clockwise from the default left-to-right angle (0?). Change the angle to 0. Does this fix your problem?
 [1999-07-02 11:52 UTC] php-user at mindcontrol dot org
No, I tried 0 degrees first. It gives me mirror-imaged text drawn 
in the up->down direction, i e baseline goes out at 6 o'clock 
and characters extend towards 9 o'clock. The value 90 gives me a 
baseline extending to 9 o'clock and characters extending to 12 
o'clock, which is a vertical-axis mirror of what I really want, 
which is regular text (baseline 3 o'clock, characters 12 o'clock).
 [1999-07-02 12:32 UTC] php-user at mindcontrol dot org
It seems that when I installed GD (version 1.5), configure wasn't 
smart enough to change HAVE_LIBGD13 from 0 to 1 (I had no GD at all 
before that). HAVE_LIBGD is also defined twice inside config.h.

Personally I'm no fan of autoconf :-) How about building everything 
as dynamic modules that get scanned at start time? Then you don't 
need to re-configure or re-build anything other than what you're 
adding.

Thank you to rasmus@php.net who zoomed in on the problem. (The build 
is still going, but it seems likely this was it).
 [1999-07-02 12:42 UTC] php-user at mindcontrol dot org
That was it. It now works. Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 22:01:32 2024 UTC