<?php 
class Editimg_Controller extends Base_Controller {
	function __construct(){
		parent::__construct();
	}
	function index($is_delete_source=1){
		$this->view						=	new View("editimg/index");
		$this->view->pic 				= 	"upload/tmp/1235836551tzxc888_1206847807215040.jpg";
		$this->view->is_delete_source	=	$is_delete_source;
		$this->view->render(true);
	}
	function cutpic(){
		extract($_POST);
		settype($x,"int");			//剪切位置 X轴
		settype($y,"int");			//剪切位置 Y轴
		settype($iw,"int");		//调整图片大小的宽度
		settype($c_w,"int");
		settype($ih,"int");		//调整图片大小的高度
		settype($c_h,"int");
		settype($w,"int");			//剪切宽度
		settype($h,"int");			//剪切高度
		settype($pic,"string");	//路径
		//制作缩略图
		$image	=	Image::factory($pic)->resize($iw,$ih,Image::AUTO)->crop($w,$h,$y,$x)->save($pic);
		echo "url:".trim($pic);
	}
}