本文整理汇总了PHP中imagefilledellipse函数的典型用法代码示例。如果您正苦于以下问题:PHP imagefilledellipse函数的具体用法?PHP imagefilledellipse怎么用?PHP imagefilledellipse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了imagefilledellipse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _drawLine
private function _drawLine($image, $x1, $y1, $x2, $y2)
{
$thick = $this->_thickness->getThickness();
$color = $this->_getDrawColor($image);
if ($thick == 1) {
return imageline($image, $x1, $y1, $x2, $y2, $color);
}
if ($this->hasTransparency() && $this->_transparency->getTransparency() != ParamTransparency::$minAlpha) {
$t = $thick / 2 - 0.5;
if ($x1 == $x2 || $y1 == $y2) {
return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);
}
$k = ($y2 - $y1) / ($x2 - $x1);
//y = kx + q
$a = $t / sqrt(1 + pow($k, 2));
$points = array(round($x1 - (1 + $k) * $a), round($y1 + (1 - $k) * $a), round($x1 - (1 - $k) * $a), round($y1 - (1 + $k) * $a), round($x2 + (1 + $k) * $a), round($y2 - (1 - $k) * $a), round($x2 + (1 - $k) * $a), round($y2 + (1 + $k) * $a));
imagefilledpolygon($image, $points, 4, $color);
imagepolygon($image, $points, 4, $color);
} else {
imagesetthickness($image, $thick);
imageline($image, $x1, $y1, $x2, $y2, $color);
imagesetthickness($image, 1);
imagefilledellipse($image, $x1, $y1, $thick, $thick, $color);
imagefilledellipse($image, $x2, $y2, $thick, $thick, $color);
imageellipse($image, $x1, $y1, $thick, $thick, $color);
imageellipse($image, $x2, $y2, $thick, $thick, $color);
}
}
示例2: __construct
public function __construct($width = '120', $height = '40', $characters = '6')
{
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.75;
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
$background_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 20, 40, 100);
$noise_color = imagecolorallocate($image, 100, 120, 180);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font, $code) or die('Error in imagettftext function');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
/* @var $CI My_Controller */
$CI = get_instance();
$CI->session->set_userdata('security_code', $code);
}
示例3: index
public function index()
{
$code = substr(sha1(mt_rand()), 17, 6);
$this->session->set_userdata('captcha_code', $code);
$width = '120';
$height = '40';
$font = APPPATH . 'modules/contact/assets/fonts/monofont.ttf';
$font_size = $height * 0.75;
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
$background_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 20, 40, 100);
$noise_color = imagecolorallocate($image, 100, 120, 180);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $font, $code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $font, $code) or die('Error in imagettftext function');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
}
示例4: showImage
function showImage()
{
$image = imagecreatetruecolor($this->width, $this->height);
$width = imagesx($image);
$height = imagesy($image);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocatealpha($image, 255, 0, 0, 75);
$green = imagecolorallocatealpha($image, 0, 255, 0, 75);
$blue = imagecolorallocatealpha($image, 0, 0, 255, 75);
imagefilledrectangle($image, 0, 0, $width, $height, $white);
$tam = ceil(rand(10, 30));
imagefilledellipse($image, ceil(rand(5, 100)), ceil(rand(0, 30)), $tam, $tam, $red);
$tam = ceil(rand(10, 30));
imagefilledellipse($image, ceil(rand(5, 100)), ceil(rand(0, 30)), $tam, $tam, $green);
$tam = ceil(rand(10, 30));
imagefilledellipse($image, ceil(rand(5, 100)), ceil(rand(0, 30)), $tam, $tam, $blue);
imagefilledrectangle($image, 0, 0, $width, 0, $black);
imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black);
imagefilledrectangle($image, 0, 0, 0, $height - 1, $black);
imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black);
imagestring($image, 15, intval(($width - strlen($this->code) * 9) / 2), intval(($height - 15) / 2), $this->code, $black);
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
}
示例5: __construct
/**
* Generate captcha
*
* @param integer $characters Amount of characters to draw
* @param integer $width
* @param integer $height
*/
public function __construct($characters = 10, $width = 140, $height = 24)
{
if (!file_exists($this->font)) {
throw new RuntimeException("Font " . $this->font . " is missing. Can't proceed.");
}
$this->code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.7;
$image = imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
$noise_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 44, 44, 44);
$text_color2 = imagecolorallocate($image, 244, 1, 1);
$line_color = imagecolorallocate($image, 244, 0, 0);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background of text */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $this->font, $this->code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font, $this->code) or die('Error in imagettftext function');
imagettftext($image, $font_size, 0, $x + 1, $y + 1, $text_color2, $this->font, substr($this->code, 0, 4));
imagettftext($image, $font_size + 2, 0, $width - 50, 20, $line_color, $this->font, substr($this->code, -3));
$this->image = $image;
}
示例6: showimage
/**
*
*/
public function showimage()
{
$image = imagecreateTruecolor($this->width, $this->height);
$width = imagesx($image);
$height = imagesy($image);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocatealpha($image, 255, 0, 0, 75);
$green = imagecolorallocatealpha($image, 0, 255, 0, 75);
$blue = imagecolorallocatealpha($image, 0, 0, 255, 75);
imagefilledrectangle($image, 0, 0, $width, $height, $white);
for ($i = 0; $i < 50; $i++) {
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $red);
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $green);
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $blue);
}
imagefilledrectangle($image, 0, 0, $width, 0, $black);
imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black);
imagefilledrectangle($image, 0, 0, 0, $height - 1, $black);
imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black);
imagettftext($image, 15, 0, intval(($width - strlen($this->code) * 10) / 2), intval($height / 2 + 7), $black, $this->font, $this->code);
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
}
示例7: __construct
public function __construct($width = '120', $height = '40', $characters = '6')
{
$fontPath = getcwd() . '/' . $this->font;
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.75;
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 20, 40, 100);
$noise_color = imagecolorallocate($image, 100, 120, 180);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $fontPath, $code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $fontPath, $code) or die('Error in imagettftext function');
/* output captcha image to browser */
$context = Context::getContext();
// $context->cookie->ssmartblogcaptcha = $code;
$context->cookie->__set('ssmartblogcaptcha', $code);
$context->cookie->write();
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
//$_SESSION['ssmartblogcaptcha'] = $code;
}
示例8: showImage
function showImage()
{
$image = imagecreatetruecolor($this->height, $this->width);
$width = imagesx($image);
$height = imagesy($image);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocatealpha($image, 255, 0, 0, 75);
$green = imagecolorallocatealpha($image, 0, 255, 0, 75);
$blue = imagecolorallocatealpha($image, 0, 0, 255, 75);
imagefilledrectangle($image, 0, 0, $width, $height, $white);
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $red);
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $green);
imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $blue);
imageline($image, 108, 23, 40, 23, $black);
$pixel_color = imagecolorallocate($image, 100, 100, 100);
for ($i = 0; $i < 1000; $i++) {
imagesetpixel($image, rand() % 200, rand() % 50, $pixel_color);
}
imagefilledrectangle($image, 0, 0, $width, 0, $black);
imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black);
imagefilledrectangle($image, 0, 0, 0, $height - 1, $black);
imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black);
imagestring($image, 10, intval(($width - strlen($this->code) * 9) / 2), intval(($height - 15) / 2), $this->code, $black);
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
exit;
}
示例9: CaptchaSecurityImages
/**
* @param int $width
* @param int $height
* @param int $characters
*/
public function CaptchaSecurityImages($width = 120, $height = 40, $characters = 6)
{
$code = $this->generateCode($characters);
// Font size will be 75% of the image height
$fontSize = $height * 0.45;
$image = imagecreate($width, $height);
// Set the colours
$backgroundColor = imagecolorallocate($image, 255, 255, 255);
$textColor = imagecolorallocate($image, 46, 118, 126);
$noiseColor = imagecolorallocate($image, 118, 173, 201);
// Generate random dots in background
for ($i = 0; $i < $width * $height / 10; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noiseColor);
}
// Generate random lines in background
for ($i = 0; $i < $width * $height / 310; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noiseColor);
}
// Create textbox and add text
$textbox = imagettfbbox($fontSize, 0, $this->config['font'], $code);
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $fontSize, 0, $x, $y, $textColor, $this->config['font'], $code);
// Output captcha image to browser
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
$_SESSION['security_code'] = $code;
}
示例10: genterate_flag
function genterate_flag($hex)
{
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
// create a true colour, transparent image
// turn blending OFF and draw a background rectangle in our transparent colour
$default_size = 30;
$size = $_REQUEST["size"];
if ($size == '') {
$size = $default_size;
}
$iwidth = $size;
$iheight = $size;
$image = imagecreatetruecolor($iwidth, $iheight);
//
imagealphablending($image, false);
$col = imagecolorallocatealpha($image, 255, 255, 255, 127);
$newc = imagecolorallocate($image, $r, $g, $b);
$black = imagecolorallocatealpha($image, 0, 0, 0, 50);
imagefilledrectangle($image, 0, 0, $iwidth, $iheight, $col);
//imagefilledrectangle($image,10,10,($iwidth -10) ,($iheight-10),$newc);
$values = array(0, $size / 10, 0, $size / 2, $size / 2, $size, $size, $size / 2, $size / 2, 0, $size / 10, 0);
imagefilledpolygon($image, $values, 6, $newc);
//imagefilledellipse($image, $size / 5, $size / 5 , $size / 8 , $size / 8, $black);
imagefilledellipse($image, $size / 5, $size / 5, $size / 6, $size / 6, $col);
//imagefilledpolygon($image , $values , 4 , $col );
// imagealphablending($image,true);
// ^^ Alpha blanding is back on.
// insert image manipulation stuff in here
// output the results...
imagealphablending($image, true);
// imagesavealpha($image,true);
return $image;
}
示例11: CaptchaSecurityImages
function CaptchaSecurityImages($width = '120', $height = '40', $characters = '6')
{
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.75;
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
$background_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 20, 40, 100);
$noise_color = imagecolorallocate($image, 100, 120, 180);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font, $code) or die('Error in imagettftext function');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Fri, 19 Jan 1994 05:00:00 GMT');
header('Pragma: no-cache');
imagejpeg($image);
imagedestroy($image);
$_SESSION["gblSecurityCode"] = $code;
}
示例12: create_image
function create_image()
{
// Seed string
$this->generate_string();
$this->im = imagecreatetruecolor($this->height, $this->width);
// Create image
// Get width and height
$img_width = imagesx($this->im);
$img_height = imagesy($this->im);
// Define some common colors
$black = imagecolorallocate($this->im, 0, 0, 0);
$white = imagecolorallocate($this->im, 255, 255, 255);
$red = imagecolorallocatealpha($this->im, 255, 0, 0, 75);
$green = imagecolorallocatealpha($this->im, 0, 255, 0, 75);
$blue = imagecolorallocatealpha($this->im, 0, 0, 255, 75);
$yellow = imagecolorallocatealpha($this->im, 255, 255, 0, 75);
$pink = imagecolorallocatealpha($this->im, 102, 102, 153, 75);
// Background
imagefilledrectangle($this->im, 0, 0, $img_width, $img_height, $white);
// Ellipses (helps prevent optical character recognition)
imagefilledellipse($this->im, ceil(rand(5, $img_width - 5)), ceil(rand(0, $img_height)), 40, 40, $red);
imagefilledellipse($this->im, ceil(rand(5, $img_width - 5)), ceil(rand(0, $img_height)), 40, 40, $green);
imagefilledellipse($this->im, ceil(rand(5, $img_width - 5)), ceil(rand(0, $img_height)), 40, 40, $blue);
imagefilledellipse($this->im, ceil(rand(5, $img_width - 5)), ceil(rand(0, $img_height)), 40, 40, $yellow);
imagefilledellipse($this->im, ceil(rand(5, $img_width - 5)), ceil(rand(0, $img_height)), 40, 40, $pink);
// Borders
//imagefilledrectangle($this->im, 0, 0, $img_width, 0, $black);
//imagefilledrectangle($this->im, $img_width - 1, 0, $img_width - 1, $img_height - 1, $black);
//imagefilledrectangle($this->im, 0, 0, 0, $img_height - 1, $black);
//imagefilledrectangle($this->im, 0, $img_height - 1, $img_width, $img_height - 1, $black);
imagestring($this->im, 6, intval(($img_width - strlen($this->string) * 9) / 2), intval(($img_height - 15) / 2), $this->string, $black);
// Write string to photo
}
示例13: applyFilter
/**
* (non-PHPdoc)
* @see \imagemanipulation\filter\IImageFilter::applyFilter()
*/
public function applyFilter(ImageResource $resource)
{
if ($this->radius === 0) {
return;
}
$source_image = $resource->getResource();
$source_width = $resource->getX();
$source_height = $resource->getY();
$corner_image = imagecreatetruecolor($this->radius, $this->radius);
$clear_colour = imagecolorallocate($corner_image, 0, 0, 0);
imagecolortransparent($corner_image, $clear_colour);
$solid_colour = imagecolorallocate($corner_image, $this->color->getRed(), $this->color->getGreen(), $this->color->getBlue());
imagefill($corner_image, 0, 0, $solid_colour);
imagefilledellipse($corner_image, $this->radius, $this->radius, $this->radius * 2, $this->radius * 2, $clear_colour);
/*
* render the top-left, bottom-left, bottom-right, top-right corners by rotating and copying the mask
*/
imagecopymerge($source_image, $corner_image, 0, 0, 0, 0, $this->radius, $this->radius, 100);
$corner_image = imagerotate($corner_image, 90, 0);
imagecopymerge($source_image, $corner_image, 0, $source_height - $this->radius, 0, 0, $this->radius, $this->radius, 100);
$corner_image = imagerotate($corner_image, 90, 0);
imagecopymerge($source_image, $corner_image, $source_width - $this->radius, $source_height - $this->radius, 0, 0, $this->radius, $this->radius, 100);
$corner_image = imagerotate($corner_image, 90, 0);
imagecopymerge($source_image, $corner_image, $source_width - $this->radius, 0, 0, 0, $this->radius, $this->radius, 100);
}
示例14: create
function create($width = '120', $height = '40', $characters = '6')
{
if ($this->font == null) {
$this->font = App::pluginPath($this->Controller->plugin) . DS . 'webroot' . DS . 'monofont.ttf';
}
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.7;
$image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream');
/* set the colours */
$background_color = imagecolorallocate($image, 220, 220, 220);
$text_color = imagecolorallocate($image, 10, 30, 80);
$noise_color = imagecolorallocate($image, 150, 180, 220);
/* generate random dots in background */
for ($i = 0; $i < $width * $height / 3; $i++) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $noise_color);
}
/* generate random lines in background */
for ($i = 0; $i < $width * $height / 150; $i++) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function');
$x = ($width - $textbox[4]) / 2;
$y = ($height - $textbox[5]) / 2;
$y -= 5;
$slope = rand(3, 8);
$slope = rand(0, 1) == 1 ? $slope : -$slope;
imagettftext($image, $font_size, $slope, $x, $y, $text_color, $this->font, $code) or die('Error in imagettftext function');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
$this->Controller->Session->write('security_code', $code);
}
示例15: creatImage
public function creatImage()
{
$md5_hash = md5(uniqid());
$security_code = substr($md5_hash, 15, 5);
$this->CI->session->set_flashdata('security_code', $security_code);
$width = 80;
$height = 22;
$font_size = $height * 0.75;
$font = "monofont.ttf";
$image = imagecreate($width, $height);
$white = imagecolorallocate($image, 50, 0, 60);
$black = imagecolorallocate($image, 140, 140, 140);
$grey = imagecolorallocate($image, 200, 150, 150);
imagefill($image, 0, 0, $black);
$i = 0;
for (; $i < $width * $height / 3; ++$i) {
imagefilledellipse($image, mt_rand(0, $width), mt_rand(0, $height), 1, 1, $grey);
}
$i = 0;
for (; $i < $width * $height / 150; ++$i) {
imageline($image, mt_rand(0, $width), mt_rand(0, $height), mt_rand(0, $width), mt_rand(0, $height), $grey);
}
if (!imagestring($image, $font_size, 15, 2, $security_code, 10)) {
exit("Error in imagestring function");
}
header("Content-Type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
}