Angry  Bug in a module i am writing well trying to

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Bug in a module i am writing well trying to
waterboy
CZ Newbie
waterboy has been a member for over 15 year's 15 Year Member
Status: Offline
Joined: Oct 04, 2008
0.00 posts per day
Posts: 1
Points: 0
   
Hello I have a problem with some code in php.

Warning: imageistruecolor(): supplied argument is not a valid Image resource in .... on line 8


the code on line 8 is
if(imageistruecolor($img))
{...}


$img = null on the 1st run

PHP Version 5.2.3
GD Version bundled (2.0.34 compatible)


I just do not understand this error. The gd lib is loaded, Why do i have this error?

waterboy


Back to top Reply with quote
#2   
Telli
Site Admin
Telli has been a member for over 20 year's 20 Year Member
Occupation: Self Employed
Age: 45
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.06 posts per day
Posts: 8089
Points: 494,430
   
That error is stating that $img does not exist. You may want to make sure the $img exists before trying to work with it.


if (file_exists($img)) {
     //do something
}




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum