An example of PHP image watermark, cut head image and automatic scaling code, he can upload your uploaded images to generate a specified size and can be automatically cut the picture, see the example below.
An example of PHP tutorial picture watermark, cut head image and auto-scaling code, he can upload your uploaded images to generate a specified size with the picture can be automatically cut, see the example below.
Upload file test
Http://code.google.com/p/queryphp/downloads/list
IMG Classes in the frameworklibimg.class.php
/*
PHP image watermark, cut head image and auto-scaling code
*/
Class Uploadrouter extends controller{
Function index ()
{
Output upload form, see View File
}
function Webimages ()
{
Print_r ($_files);
$img =c ("img");
$img->setinfo (//Set upload file properties
Array ("Files" = "upload",//Upload file Box name name
"Uploadpath" = $globals [' config '] [' Webprojectpath ']. " Upimages/",//Upload Directory
"Icopath" = $globals [' config '] [' Webprojectpath ']. " Upimages/",//Small map directory if not set will be used to upload directory
"Icowidth" = "128",//Small picture width
"Icoheight" = "98",//Tugau
"Fangpath" = $globals [' config '] [' Webprojectpath ']. " upimages/_ico/",//Cefanto, is cut head, etc.
"Fangsize" = "75",//Fanthou How big if the Cefanto is set up then upload will generate Cefanto, do not have to set
"Nzsize" = "180",//automatic setting wide or high does not exceed this
"Uploadsize" =>420000//Upload image size
)
)->setbasename ($_files[' upload ' [' name '],true)->init ();//, ' Size_ico ', ' Auto_ico ', ' Fix_ico ', ' fill_size ' Fix_side '
You can set the Setbasename name yourself, or the date name will be automatically generated, which will automatically change the Chinese into Pinyin and filter the last initialization of Init ()
After initialization, you can upload the
if ($img->upload (' fix_side '))//uploaded, set to not generate a small graph. There are many formats if it is empty then only upload pictures other ignore.
{
Echo ("Upload success");
}else{
Echo ("Upload failed");
Echo $img->message;
}
return false;
}
}
?>
http://www.bkjia.com/PHPjc/444842.html www.bkjia.com true http://www.bkjia.com/PHPjc/444842.html techarticle An example of PHP image watermark, cut head image and automatic scaling code, he can upload your uploaded images to generate a specified size with the image can be automatically cut, see the example below ...