Re: PAGE TURNED BECOME SOURCE CODE VIEW..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On 7/9/06, BBC <bbc_danang@xxxxxxxxxx> wrote:
> > I don't know why every time the script run the syntax which uses GD, the page turned
> > becomes source code view. So when we need that page in normal view, we had
> > to push the 'back button' twice.
> 
> I guess we would need to see some code samples to get things going,
> preferrably the GD part which seems to be the issue :-)

Here are the Codes I used :

$tumbsize = 150;
$imgfile = $some_where;
$imgdst = $where_to;
header('Content-type: image/jpeg');
list($width,$height) = getimagesize($imgfile);
$imgratio = $width/$height;
if($imgratio>1)
{
 $newwidth = $tumbsize;
 $newheight = (int)($tumbsize / $imgratio);
}else{
 $newheight = $tumbsize;
 $newwidth = (int)($tumbsize * $imgratio);
}
$tumb = ImageCreateTrueColor($newwidth,$newheight);
$source = ImageCreateFromJpeg($imgfile);
$hai = ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
ImageJpeg($tumb,$imgdst,100);
if ($hai)
{
    echo "Resizing is successful<br> ";
}else{
copy($some_where,$where_to);
}

And thank for your input..

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux