I think you should make up your mind what u display to user... image or text... Andrei BBC wrote: > >> 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) > { Well either you display an image (which you should do bcuz you set already the header) or you display a text... > 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