Professional Web Applications Themes

#26033 [Opn->Bgs]: imageftbbox gives anomalous values when first called - PHP Development

ID: 26033 Updated by: [email]sniperphp.net[/email] Reported By: robertks at hotmail dot com -Status: Open +Status: Bogus Bug Type: GD related Operating System: OpenBSD 3.1 PHP Version: 4.3.1 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from [url]http://www.php.net/downloads.php[/url] If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status ...

  1. #1

    Default #26033 [Opn->Bgs]: imageftbbox gives anomalous values when first called

    ID: 26033
    Updated by: [email]sniperphp.net[/email]
    Reported By: robertks at hotmail dot com
    -Status: Open
    +Status: Bogus
    Bug Type: GD related
    Operating System: OpenBSD 3.1
    PHP Version: 4.3.1
    New Comment:

    Thank you for taking the time to report a problem with PHP.
    Unfortunately you are not using a current version of PHP --
    the problem might already be fixed. Please download a new
    PHP version from [url]http://www.php.net/downloads.php[/url]

    If you are able to reproduce the bug with one of the latest
    versions of PHP, please change the PHP version on this bug report
    to the version you tested and change the status back to "Open".
    Again, thank you for your continued support of PHP.

    And use the bundled GD. (--with-gd)



    Previous Comments:
    ------------------------------------------------------------------------

    [2003-10-29 20:15:24] robertks at hotmail dot com

    Description:
    ------------
    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
    [url]ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP[/url]
    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

    Reproduce code:
    ---------------
    <?
    $text = "Lorem ipsum dolor sit amet,\n\rconsetetur sadipscing elitr,
    sed diam nonumy eirmod tempor invidunt";
    $size = 15;
    $fontfile = "Cyberbit.ttf"; // from
    [url]ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP[/url]
    print_r(imageftbbox($size, 0, $fontfile, $text, array()));
    echo '<br />';
    print_r(imageftbbox($size, 0, $fontfile, $text, array()));
    ?>

    Expected result:
    ----------------
    Output:
    Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
    [6] => -1 [7] => -16 )
    Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
    [6] => -1 [7] => -16 )

    Actual result:
    --------------
    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 )


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=26033&edit=1[/url]
    sniper@php.net Guest

  2. #2

    Default #26033 [Opn->Bgs]: imageftbbox gives anomalous values when first called

    ID: 26033
    User updated by: robertks at hotmail dot com
    Reported By: robertks at hotmail dot com
    -Status: Open
    +Status: Bogus
    Bug Type: GD related
    Operating System: OpenBSD 3.1
    PHP Version: 4.3.3
    New Comment:

    Compiling with the built-in version of gd fixed the issue.

    --with-gd

    is to be used instead of

    --with-gd={$LOCALBASE}


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-10-31 06:03:57] robertks at hotmail dot com

    Note in the above that I updated to an October 31st, 2003 snapshot of
    PHP in the 4.3.x-dev category from [url]http://snaps.php.net/[/url], and not the
    August 25th, 2003 distribution available from
    [url]http://www.php.net/downloads.php[/url].

    ------------------------------------------------------------------------

    [2003-10-31 06:00:07] robertks at hotmail dot com

    I updated to PHP 4.3.3.

    Now I get

    Array ( [0] => -1 [1] => 1393 [2] => 598 [3] => 1393 [4] => 598 [5] =>
    -16 [6] => -1 [7] => -16 )
    Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
    [6] => -1 [7] => -16 )

    the first time I run the test code. Note this is still an anomalous
    result (the two outputted arrays should be identical) but different
    than the result I was posted before. Refresh, and I get the same.
    Refresh again, and I get the same. Refresh a third time, and I get

    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 )

    which was the anomalous result I posted before. Refresh thrice more
    and it goes back to the first result, and stays at that result ever
    after with further refreshes.

    All the best,
    Robert K S

    ------------------------------------------------------------------------

    [2003-10-30 20:53:05] [email]sniperphp.net[/email]

    Thank you for taking the time to report a problem with PHP.
    Unfortunately you are not using a current version of PHP --
    the problem might already be fixed. Please download a new
    PHP version from [url]http://www.php.net/downloads.php[/url]

    If you are able to reproduce the bug with one of the latest
    versions of PHP, please change the PHP version on this bug report
    to the version you tested and change the status back to "Open".
    Again, thank you for your continued support of PHP.

    And use the bundled GD. (--with-gd)


    ------------------------------------------------------------------------

    [2003-10-29 20:15:24] robertks at hotmail dot com

    Description:
    ------------
    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
    [url]ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP[/url]
    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

    Reproduce code:
    ---------------
    <?
    $text = "Lorem ipsum dolor sit amet,\n\rconsetetur sadipscing elitr,
    sed diam nonumy eirmod tempor invidunt";
    $size = 15;
    $fontfile = "Cyberbit.ttf"; // from
    [url]ftp://ftp.netscape.com/pub/communicator/extras/fonts/windows/Cyberbit.ZIP[/url]
    print_r(imageftbbox($size, 0, $fontfile, $text, array()));
    echo '<br />';
    print_r(imageftbbox($size, 0, $fontfile, $text, array()));
    ?>

    Expected result:
    ----------------
    Output:
    Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
    [6] => -1 [7] => -16 )
    Array ( [0] => -1 [1] => 37 [2] => 598 [3] => 37 [4] => 598 [5] => -16
    [6] => -1 [7] => -16 )

    Actual result:
    --------------
    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 )


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=26033&edit=1[/url]
    robertks at hotmail dot com Guest

Similar Threads

  1. database called form posting 'null' values
    By Jeremy in forum ASP Database
    Replies: 4
    Last Post: February 17th, 11:17 AM
  2. #26309 [NEW]: imageftbbox() requires the optional parameter
    By kputnam at putnamcabinets dot com in forum PHP Development
    Replies: 0
    Last Post: November 19th, 06:05 AM
  3. #26033 [Opn]: imageftbbox gives anomalous values when first called
    By robertks at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: October 31st, 11:04 AM
  4. #26033 [Bgs->Opn]: imageftbbox gives anomalous values when first called
    By robertks at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: October 31st, 11:01 AM
  5. #26033 [NEW]: imageftbbox gives anomalous values when first called
    By robertks at hotmail dot com in forum PHP Development
    Replies: 0
    Last Post: October 30th, 01:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139