Warning: imagesx(): supplied argument is not a valid Image resource in

Discussion in 'PHP' started by definitive, Sep 1, 2008.

  1. #1
    is the error that just started appearing when im expecting to see an image.

    i dont know much about php but here is the file and line the error is referring to

    imagecopymerge($image, $profile_image, 10, 10, 0, 0, imagesx($profile_image), imagesy($profile_image), 100);

    Any ideas? i would be happy to toss a couple bucks to anyone who can fix this for me/
     
    definitive, Sep 1, 2008 IP
  2. broco

    broco Peon

    Messages:
    706
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    don't want your buck!

    please copy some more lines above that line, something like $profile_image = ...
     
    broco, Sep 1, 2008 IP
  3. definitive

    definitive Well-Known Member

    Messages:
    790
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Thanks for taking a look at this for me.


    <?php
    if (!$color) {
    $image = imagecreatefromjpeg("bgs/".$twitter['source'].".jpg");
    } else {
    $image = imagecreatefromjpeg("bgs/".$twitter['source']."_".$color.".jpg");
    }
    $clr_white = imagecolorallocate($image, 255, 255, 255);
    $tx = wordwrap($twitter['text'], 63, "\n"); // Word Wrap Text
    imagettftext($image, 13, 0, 72, 18, $clr_white, 'fonts/CALIBRIB.TTF', $twitter['name']." is..."); // Name
    imagettftext($image, 10, 0, 72, 33, $clr_white, 'fonts/CALIBRI.TTF', $tx); // Text
    imagecopymerge($image, $profile_image, 10, 10, 0, 0, imagesx($profile_image), imagesy($profile_image), 100);
    ?>
     
    definitive, Sep 1, 2008 IP
  4. broco

    broco Peon

    Messages:
    706
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    checking..
     
    broco, Sep 1, 2008 IP
  5. definitive

    definitive Well-Known Member

    Messages:
    790
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    125
    #5
    i get the error on line 11 if that helps, it's also an intermittent issue, the site is working fine now.

    tweeterized dot com is the site in question
     
    definitive, Sep 1, 2008 IP
  6. broco

    broco Peon

    Messages:
    706
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    broco, Sep 1, 2008 IP