SRL Archive - Web Development

PHP dynamic image help


Gu3st...

2011-05-16 21:35:35

I'm trying to load an image from the url "http://images1.wikia.nocookie.net/runescape/images/1/10/RuneScape_Worldmap.png" into memory and draw some other .png's on top of that (with transparency). I can't even get it to load the image from an url :(
I've been trying to do this for hours now!
Any PHP-gurus out there that could help me?

E: This is what I've done:
header("Content-type: image/png");

$src = 'http://images1.wikia.nocookie.net/runescape/images/1/10/RuneScape_Worldmap.png';

$ch = curl_init();
$timeout = 0;
curl_setopt($ch, CURLOPT_URL, $src);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);

$worldmap_image = imagecreatefromstring($image);

imagepng($worldmap_image);
imagedestroy($worldmap_image);

Sex

2011-05-16 21:46:59

Looked good, so I put it on my own web server and it works just fine.

Gu3st...

2011-05-16 21:55:36

From: Sex
Looked good, so I put it on my own web server and it works just fine. http://www.kwollaston.com/img.php
Ah, so it's my hoster that's messing with me… Hit me up @ msn :)