Hi evrybody,
i created fileuploader,user upload photos,the photos arranded in random size.
i need display photos three random size
first image automatically getin width:140,second:190,thrid:240.
more than 10 images user uplaod.
next image getin size 1;
all the images display overlap.
This is my fileuplaod code.
public function executeUpload(sfWebRequest $request)
{
$meetnewpeople_id = $request->getParameter('meetnewpeopleid');
$file_name = $request->getParameter('qqfile');
$userid = $this->getUser()->getAttribute('id');
//initilaze a image related properties
$this->imgMimeType = "";
$this->imgExtension = "";
$this->uploadedFileName = $request->getParameter('qqfile');
$this->newFileName = "";
$this->dirRoot = sfConfig::get('app_planspace_rootdir')."\\".$userid;
$this->thumbDir = "thumb";
$this->hostPath = sfConfig::get('app_planspace_hostpath')."/".$userid;
$this->newFilePath = "";
$this->_getImageProperties();
if($this->_uploadProgress($this->newFileName))
{
$this->newFilePath = $this->hostPath."/".$this->newFileName;
$get_image = getimagesize($this->newFilePath);
$this->imgMimeType = $get_image['mime'];
//$this->_tranformImage();
$obj = new stdClass();
$obj->fileName = $this->hostPath."/".$this->newFileName;
$obj->success = true;
$obj->mime = $this->imgMimeType;
print json_encode($obj);
}
return sfView::NONE;
}
private function _getImageProperties()
{
$arr_temp = explode(".",trim($this->uploadedFileName));
$this->imgExtension = $arr_temp[count($arr_temp)-1];
if(is_dir(sfConfig::get('app_planspace_rootdir')))
{
if(!is_dir($this->dirRoot))
mkdir($this->dirRoot);
if(!is_dir($this->dirRoot."\\".$this->thumbDir))
mkdir($this->dirRoot."\\".$this->thumbDir);
$planspace_files = scandir($this->dirRoot);
//$this->newFileName = md5(count($planspace_files)+1).".".$this->imgExtension;
$this->newFileName =md5(count($planspace_files)).".".$this->imgExtension;
}
}
anybody ,plz help me.
how to create randomsize images.