I have a php script called getimage.php. The contents is:
Code: Select all
<?
require ('./api.class.php');
function imageFile() {
$client = new Client; // pay no attention to this. This is a connection string that I took out.
$serverList = $client->getServerList(); // same for this
$bandwith = $client->getBandwidthimage(10702); // and this .. these are all api related things that work
$data = $bandwith['file'];
header("Content-type: ".$bandwith['file_type']);
$image = base64_decode($data);
echo $image;
}
imageFile();
}
?>I want to resize the PNG image. I've looked into GD, however, I keep getting errors:
Code: Select all
imagecreatefrompng() [<a href='function.imagecreatefrompng'>function.imagecreatefrompng</a>]: 'getimage.php' is not a valid PNG file
imagecopyresized(): supplied argument is not a valid Image resource
PHP Warning: imagepng(): supplied argument is not a valid Image resource inMy point is, and my question is, how do I go about getting the dimesions of this PNG file (filename.php)? It appears that GD sees the .php extension and doesn't think its a PNG file, however, the header is PNG file. So, I'm lost.
Any help is appriciated.
Thanks,
Drew