PHP Image Problem

software development

#1

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

$image = imagecreatefromjpeg("BaseImage.jpg");
$insert = imagecreatefrompng("http://avatar2.gaiaonline.com/avatarlocation");
$image = image_overlap($image, $insert);

But It’s throwing an error about “URL file-access is disabled in the server configuration”

So…
Am I able to change this ??


#2

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
Max discount on any plan with promocode SCJESSEYTOTAL


#3

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

But thanks for pointing out the WIKI entry


#4

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.

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color].
More Dreamhost coupons


#5

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.


#6

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


#7

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


Warning: imagecreatefrompng(‰PNG

) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/.tune/pgpprotector/gw4y.com/sig/pgpsig2a.jpg on line 99


#8

Found it :doh:

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