06-04-2008, 11:25 PM
|
#24 (permalink)
|
|
The Contributor
Join Date: May 2008
Posts: 30
Thanks: 5
|
Why is that when I call this script from http://localhost:{port}/test.php it comes up. But when I create an html file, and call the script <img src=test.php/>
It comes back w/ and empty image box??
Quote:
<?php
ob_start();
$filename = "http://images.wsdot.wa.gov/nwflow/flowmaps/sysvert.gif";
$newwidth = (isset($_GET['width'])) ? $_GET['width'] : "538";
$format='image/gif';
if($format!='')
{
list($width, $height) = getimagesize($filename);
$newheight=$height*$newwidth/$width;
switch($format)
{
case 'image/gif';
$source = imagecreatefromgif($filename);
break;
}
$dimg = imagecreatetruecolor(640,538);
imagealphablending($dimg, false);
$source = imagecreatefromgif("$filename");
imagecopyresized($dimg, $source, 0,0,0,438, $newwidth, $newheight, $width, $height);
$filename="$output_dir/test1.gif";
ob_end_clean();
header('Content-Type: image/gif');
imagegif($dimg);
imagedestroy($dimg);
}
?>
|
|
|
|
|