Code:
<? $percent="30"; if($_GET['pic']){ $image = $_GET['pic']; if($_GET['type']=="jpg"){ header("Content-type: image/jpeg"); }elseif($_GET['type']=="gif"){ header("Content-type: image/gif"); }elseif($_GET['type']=="png"){ header("Content-type: image/png"); }else{ if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){header("Content-type: image/jpeg");} elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){header("Content-type: image/gif");} elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){header("Content-type: image/png");} } if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){$im = imagecreatefromjpeg($image);} elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){$im = imagecreatefromgif($image);} elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){$im = imagecreatefrompng($image);} $x = round((imagesx($im)*$percent)/100); $y = round((imagesy($im)*$percent)/100); $yyy=0; $xxx=0; $imw = imagecreatetruecolor($x,$y); imagecopyresampled($imw, $im, $xxx,$yyy,0,0,$x,$y,imagesx($im), imagesy($im)); $watermark_color="fffff"; $text = "Grim-Reaper.ws"; $red=hexdec(substr($watermark_color,0,2)); $green=hexdec(substr($watermark_color,2,2)); $blue=hexdec(substr($watermark_color,4,2)); $text_col = imagecolorallocate($imw, $red,$green,$blue); $font = "font/georgia.ttf"; $font_size = 7; $angle = 90; $box = imagettfbbox($font_size, $angle, $font, $text); $x = round((imagesx($im)*30)/100); $y = round((imagesy($im)*30)/100); imagettftext($imw, $font_size, $angle, $x, $y, $text_col, $font, $text ); if($_GET['type']=="jpg") { imagejpeg($imw); } else if($_GET['type']=="gif") { imagegif($imw); } else if($_GET['type']=="png") { imagepng($imw); }else{ if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){imagejpeg($imw); }else if(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){imagegif($imw); } else if(substr($image, -3)=="png" || substr($image, -3)=="PNG"){imagepng($imw); } } imagedestroy($imw); } ?>
edit the text to your site
Comment