Hi everybody
i created a form for editing profile picture
I want to make sure that all the pictures are jpg, so i want to convert the file uploaded to .jpg
How can I do it.
i looked at this:
http://www.yiiframework.com/extension/imgresizer/
but i don’t knoy how to use the convert function in my controler
class UserController extends Controller{
...
public function actionEditPicture(){
$model = new User();
if(isset($_POST["User"])){
//get the picture from the form
$model->picture = CUploadedFile::getInstance($model, 'picture');
//Save the Original picture with the User PublicID
$model->picture->saveAs($_SERVER['DOCUMENT_ROOT'].Yii::app()->request->baseUrl.'/images/user/'.$userid;.'.jpg');
$this->redirect('user-picture');
//redirect to success page
}
$profileUser = User::model()->findByPk(Yii::app()->user->id);
$this->render('profile_editpicture', array('profileUser'=>$profileUser,'model'=>$model));
}
Thank you for your help