Dump image object information

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • georg116

    Dump image object information

    Hi,

    can someone tell me, if it's possible to "dump" an image object, created
    like with the snippet below?

    <?php
    $im = ImageCreate (50, 100);
    $background_col or = ImageColorAlloc ate ($im, 255, 255, 255);
    $text_color = ImageColorAlloc ate ($im, 233, 14, 91);
    ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color);
    ?>

    'var_dump($im)' only shows me the name of the handler, which is obvious.
    Is there a way to show the elements of the image "behind" the handler,
    like it is with a object?

    Thanks for any help,
    georg
  • Pedro Graca

    #2
    Re: Dump image object information

    georg116 wrote:[color=blue]
    > can someone tell me, if it's possible to "dump" an image object, created
    > like with the snippet below?
    >
    > <?php
    > $im = ImageCreate (50, 100);
    > $background_col or = ImageColorAlloc ate ($im, 255, 255, 255);
    > $text_color = ImageColorAlloc ate ($im, 233, 14, 91);
    > ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color);
    > ?>
    >
    > 'var_dump($im)' only shows me the name of the handler, which is obvious.
    > Is there a way to show the elements of the image "behind" the handler,
    > like it is with a object?[/color]

    Maybe like this (not tested)?

    <?php
    if (ob_start()) {
    if (!imagepng($im) ) {
    exit('Unable to create image.');
    }
    $contents = ob_get_contents ();
    ob_end_clean();
    var_dump($conte nts);
    }
    ?>

    --
    Mail sent to my "From:" address is publicly readable at http://www.dodgeit.com/
    == ** ## !! !! ## ** ==
    TEXT-ONLY mail to the complete "Reply-To:" address ("My Name" <my@address>) may
    bypass the spam filter. I will answer all pertinent mails from a valid address.

    Comment

    Working...