PHP Thumb » Help & Bugs » Help

Header Restriction Errors

(4 posts)
  1. leafy34
    Member

    UPDATE: Found previous post, and was referred here:

    http://trac.gxdlabs.com/projects/phpthumb/wiki/Docs/BasicUsage#ShowingImages

    Hi there,

    First off, nice application, I am really looking forward to using its functionality except, I seem to run into an error with headers.

    Here is what I am thrown:

    Fatal error: Uncaught exception 'RuntimeException' with message 'Cannot show image, headers have already been sent' in /home/user/public_html/domain/includes/GdThumb.inc.php:569 Stack trace: #0 /home/user/public_html/domain/testthis.php(9): GdThumb->show() #1 {main} thrown in /home/user/public_html/domain/includes/GdThumb.inc.php on line 569

    Here is the code from the page "testthis.php":


    <?php require_once('includes/ThumbLib.inc.php'); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title></title></head>
    <body>
    <?php
    $thumb = PhpThumbFactory::create('quotemark1.png');
    $thumb->resize(100, 100);
    $thumb->show();
    ?>
    </body>
    </html>

    I really am unsure as to why this is happening, since there is no output before ThumbLib.inc.php is required.

    Any help will be very appreciated!
    Cheers, Lea

    Posted 6 months ago #
  2. leafy34
    Member

    Oh, and how did the site manage to get a photo of me? hahaha... I most certainly didnt upload this... OpenID maybe?

    Posted 6 months ago #
  3. Yeah, but you have output before you show the image :)

    Basically, you can't have ANY output whatsoever before showing the image. You'll basically need to wrap the functionality in a script that you call from an img tag in your HTML. Check out "Showing Images" on http://wiki.github.com/masterexploder/PHPThumb/basic-usage (towards the bottom of the page)

    As far as your image goes, that's actually Gravatar ;)

    Posted 6 months ago #
  4. Doh, didn't see your update... either way, sounds like you got things figured out

    Posted 6 months ago #

RSS feed for this topic

Reply

You must log in to post.