Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts

    GD Image Cannot be Displayed

    Can someone please help me pinpoint why this image is not being shown?

    http://jordan.rave5.com/tvshack/latest_movies.png/

    Here is the source code. I have compared it to quite a few GD scripts, and don't see anything wrong with my code. I am actually a bit confused. Might be because I'm picking up PHP after two years of not doing much.

    All I get is
    Code:
    The image “http://jordan.rave5.com/tvshack/latest_movies.png/” cannot be displayed, because it contains errors.
    It isn't a problem with the XML parsing, that is all groovy. Something with the GD rendering.

    [ Code Removed ]
    Last edited by Element; 08-23-2009 at 08:37 AM.

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,151
    Thanks
    2
    Thanked 335 Times in 327 Posts
    If you examine the contents that your code is producing, you will find the following error -
    <br />
    <b>Fatal error</b>: Call to undefined function imagettftext() in <b>/home/amerikan/public_html/tvshack/latest_movies.png/index.php</b> on line <b>32</b><br />
    I'll guess that you don't have the the FreeType library since the other GD functions are not producing any errors.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Hehe, thank you.

  • #4
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    I am now getting the same error with this code, however imagestring() does exist.

    And forgive me, my server is not generating an error file. Or showing me the errors via the problem at http://jordan.rave5.com/tvshack/latest_movies.png

    PHP Code:
    <?php

        
        error_reporting
    E_ALL & ~E_NOTICE );

        
        
    header 'Content-type: image/png' );

        
    $font imageloadfont'./Duepuntozero.tff' );
        
        
    $source './tvs_new_movies_background.png';

        
    $image imagecreatefrompng$source );
        
    imagealphablending$imagefalse );
        
    imagesavealpha$imagetrue );

        
    $blue imagecolorallocate$image1676104 );
        
    $green imagecolorallocate$image11616080 );

        
    $tvs_feed 'http://tvshack.net/rss/movies.xml';

        
    $dom = new DOMDocument();
        
    $dom->load$tvs_feed );
        
        
    $items $dom->getElementsByTagName'item' );
        
    $movies = array();
        
        foreach ( 
    $items as $item ) {
        
              
    $title_tag $item->getElementsByTagName"title" );
              
    $movies[] = $title_tag->item(0)->nodeValue;

        }
        
        
    // Row One
        
    imagestring$image$font12030html_entity_decode$movies[0] ), $green );
        
    imagestring$image$font12045html_entity_decode$movies[0] ), $blue );
        
    imagestring$image$font12060html_entity_decode$movies[0] ), $green );
        
    imagestring$image$font12075html_entity_decode$movies[0] ), $blue );
        

        
    // Row Two
        
    imagestring$image$font25030html_entity_decode$movies[0] ), $blue );
        
    imagestring$image$font25045html_entity_decode$movies[0] ), $green );
        
    imagestring$image$font25060html_entity_decode$movies[0] ), $blue );
        
    imagestring$image$font25075html_entity_decode$movies[0] ), $green );
        
        
    imagepng$image );
        
    imagedestroy$image );

    ?>

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,151
    Thanks
    2
    Thanked 335 Times in 327 Posts
    The current error is not the same. It concerns the file or directory of the .tff file in -

    PHP Code:
        $font imageloadfont'./Duepuntozero.tff' ); 
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    How can this be? THe file is there. I tried three other linking methods. Man. It is weird. No error reporting at all on the server. Can't even upload a .htaccess file to force errors to a log file.

  • #7
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,151
    Thanks
    2
    Thanked 335 Times in 327 Posts
    To see the errors, comment out the header() statement or save the output from the link you have been posting to a file and open that file in a good programming editor.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #8
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    ... Lol Wow, it really has been awhile since I've used PHP.


  •  

    Posting Permissions

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