130){ die(); } if($imagef<>""){ if (eregi("(jpg)$|(jpeg)$", $imagef)) { $wit=getimagesize($diect.$imagef); header("Content-type: image/jpeg"); if($wit[0]>$wit[1]){ $rat=$wit[1]/$wit[0]; $new_width=200; $new_height=round($new_width*$rat); }else{ $rat=$wit[1]/$wit[0]; $new_width=112; $new_height=round($new_width*$rat); } $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($diect.$imagef); imagecopyresampled($image_p, $image,0,0,0,0,$new_width,$new_height,$wit[0],$wit[1]); imagejpeg($image_p,Null,70); ob_end_flush(); imagedestroy($image_p); imagedestroy($image); }else{ $text = $imagef; $image = imagecreate(200, 20); // background $back = imagecolorallocate ($image,240,250,255); //text $textColor = imagecolorallocate ($image,0,0,0); imagestring ($image,2,5,2, $text,$textColor); // send the content type header so the image is displayed properly header('Content-type: image/jpeg'); imagejpeg($image); imagedestroy($image); } } ?>