Forum Moderators: coopster
<?phpheader("Content-type: image/jpeg");
$name = stripslashes($_GET['name']);
$line2 = stripslashes($_GET['line2']);
$size = stripslashes($_GET['size']);
$centre = stripslashes($_GET['centre']);
$font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';
$fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED
$fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN
$fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE
$lines = stripslashes($_GET['lines']);
function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
///
}
if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '63')
{
$bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg';
}
$im = imagecreatefromjpeg($bgpic);
//Calculate, the centre:
for(;;){
list($image_width, $image_height) = getimagesize($bgpic);
list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
$text_width = $right_x - $left_x;
if($image_width > $text_width+5){
break;
}
$size = $size - .5;
if($size == 1){
die('Script not responding to decreasing font size, in other words: try using less letters.');
}
}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height/2);
$textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
if($centre== 'y'){
imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);
imagettftext($im, $size -10,0,$hpadding,$vpadding+$size,$textcolor,$font,$line2);
}else{
imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);
imagettftext($im,$size - 10,$angle,$x,$y+$size,$textcolor,$font,$line2);
}
imagegif($im);
imagedestroy($im);
?>
I know i have to do something to the
$im = imagecreatefromjpeg($bgpic);
but i dont know what. Also if it is possible i would like the user to be able to choose whether to either use the images off my site (selected using a radio button) or by specifying a url.
Thanks. Any help would be much appreciated as i cant seem to work this out at all as i have limited self taught knowledge. Cheers.