PHP Image Problem

PHP Image Problem

Posted by: pgp_protector
Posted on: 2007-12-22 14:03:00

I'm working on a custom sig for Gaia Online, and want the PHP image to grab my current avatar and place it in the sig image.

Now I was going to do it using the following code
[code]
$image = imagecreatefromjpeg("BaseImage.jpg");
$insert = imagecreatefrompng("http://avatar2.gaiaonline.com/avatarlocation");
$image = image_overlap($image, $insert);
[/code]

But It's throwing an error about "URL file-access is disabled in the server configuration"

So....
Am I able to change this ??


Re: PHP Image Problem

Posted by: scjessey
Posted on: 2007-12-22 14:39:00

Did you try searching the forum for the error message? It has been answered about eleventy-billion times - but just to make it eleventy-billion and one, you will find the answer here: http://wiki.dreamhost.com/Allow_url_fopen

-- si-blog --

Re: PHP Image Problem

Posted by: pgp_protector
Posted on: 2007-12-22 14:45:00

Actually yes I did search the FORUM
But didn't search the WIKI.

But thanks for pointing out the WIKI entryEdited by pgp_protector on 12/22/07 02:47 PM (server time).

Re: PHP Image Problem

Posted by: Lensman
Posted on: 2007-12-22 15:00:00

In reply to:

Actually yes I did search the FORUM


What did you search under? I'm curious because a lot of people claim to have trouble searching on the forum. I did a search on "URL file-access is disabled in the server configuration" as a phrase on all forums and got about 25 posts in 5-10 different threads with that exact error message.

I'm sure it's just some horrible default setting on the search page...

BTW, I searched one year back. The default of one week isn't really helpful for most searches, I find.

-

Re: PHP Image Problem

Posted by: wholly
Posted on: 2007-12-22 15:25:00

That 7 day restriction is great for speed, but useless for searching.

That's probably why it seems no one ever searches.

Wholly - Use promo code WhollyMindless for discount.

Re: PHP Image Problem

Posted by: Åland
Posted on: 2007-12-22 15:46:00

So FAQs do not repeat faster than 52 times per year. Too bad. When they do, default search will work much better.

Re: PHP Image Problem

Posted by: pgp_protector
Posted on: 2007-12-31 12:53:00

Ok, I've been trying to get this to wrok using the CURL binary example

*************************************
$image_url = "http://avatar2.gaiaonline.com/gaia/members/ava/46/47/386a20bba54746_flip.png?t=1198351001_6.00_11";
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $image_url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);

$image = curl_exec($ch);
curl_close($ch);

// output to browser


$insert = imagecreatefrompng($image); // Will hopefully have live version of the Avatar :beg:

*************************************
But I get an error

<br />
<b>Warning</b>: imagecreatefrompng(‰PNG

) [<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]: failed to open stream: No such file or directory in <b>/home/.tune/pgpprotector/gw4y.com/sig/pgpsig2a.jpg</b> on line <b>99</b><br />



Re: PHP Image Problem

Posted by: pgp_protector
Posted on: 2007-12-31 13:47:00

Found it :doh:

Needed to use imagecreatefromstring vs imagecreatefrompng
Even though I'm getting a PNG image from the remote server.


Tags: image imageserver configurationavatar