Log in

View Full Version : Resolved Problem with ImageGD,



Nile
04-09-2009, 06:37 PM
Hello!

I'm having a problem with my ImageGD library I created a while ago, it doesn't work when I try on my localhost, but it works when I do it online (http://unlinkthis.net/scripts/imagegd/imagegd.php).

You can view my code here. (http://unlinkthis.net/scripts/imagegd/imagegd.phps)

Thanks for any help given!

techietim
04-09-2009, 07:18 PM
I'm guessing you have WAMP. If you comment out the header function, you'll see it's spitting out the following errors:



Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

Notice: Array to string conversion in C:\wamp\www\gd.php on line 137

That should help you fix your code up.

Nile
04-09-2009, 09:24 PM
It didn't really help, I tried changing:


if(strlen($color) == 7 || strlen($color) == 4 && substr($color, 0, 1) == "#"){
To:


if(is_string($color) && strlen($color) == 7 || strlen($color) == 4 && substr($color, 0, 1) == "#"){


But it still gives me the same error. Yes, I am using Wamp.

Nile
04-12-2009, 04:04 PM
No body can help me? :(

Solution:


if((strlen((string)$color) == 7 || strlen((string)$color) == 4) && substr((string)$color, 0, 1) == "#"){