Re: Why does imageftbbox give anomalous values when first called?
From: Robert K S (robertks_at_hotmail.com)
Date: 10/31/03
- Next message: Gareth Williams: "Re: [PHP] Session for creating a unique shopping cart for each user"
- Previous message: Spyproductions Support Team: "Handling a BLOB (zip file) called from MySQL"
- In reply to: Robert K S: "Why does imageftbbox give anomalous values when first called?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Oct 2003 07:00:20 -0800
Fixed by updating to latest PHP 4.3.x snapshot and compiling with the
built-in GD (--with-gd) rather than the external GD
(--with-gd={$LOCALBASE}).
robertks@hotmail.com (Robert K S) wrote in message news:<a03d2f41.0310290336.3830ee16@posting.google.com>...
> Can anyone explain the bizarre behavior of this code?
>
> <?
> $text = "Lorem ipsum dolor sit amet,\n\rconsetetur sadipscing elitr,
> sed diam nonumy eirmod tempor invidunt";
> $size = 15;
> $fontfile = "Cyberbit.ttf"; // from
> ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP
> print_r(imageftbbox($size, 0, $fontfile, $text, array()));
> echo '<br />';
> print_r(imageftbbox($size, 0, $fontfile, $text, array()));
> ?>
>
> Output:
> Array ( [0] => -1 [1] => 5 [2] => 598 [3] => 5 [4] => 598 [5] =>
> -33554432 [6] => -1 [7] => -33554432 )
> Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
> [6] => -1 [7] => -16 )
>
> Particulars:
> Freetype 2.0.4
> GD 2.0.9
> PHP 4.3.1
>
> What's going on? The [5] and [7] values of the output array (Y
> positions of the upper corners of the bounding box) are anomalous the
> first time the imageftbbox function is called. When the function is
> called again in an identical manner, the values are good.
>
> imagettfbbox does not exhibit this behavior on my system.
>
> If this is a known bug, cursory searches haven't brought up anything
> about it.
>
> Help!
>
> All the best,
> Robert K S
- Next message: Gareth Williams: "Re: [PHP] Session for creating a unique shopping cart for each user"
- Previous message: Spyproductions Support Team: "Handling a BLOB (zip file) called from MySQL"
- In reply to: Robert K S: "Why does imageftbbox give anomalous values when first called?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|