示例#1
0
 public function uploadImage($dir, $width, $height)
 {
     $imgmanager = new ImageManager();
     $imgmanager->createImageFromFile($this->data->tmpDir, $this->data->name);
     $imgmanager->resizeImage($width, $height, null);
     if (!file_exists($dir)) {
         mkdir($dir, 0777, true);
     }
     $dir = $dir . $this->data->name;
     $imgmanager->saveImage('png', $dir);
     $this->img64 = $imgmanager->getImageBase64();
     //$this->moveFileToServer();
     $this->saveLoginImageInDB($dir);
 }