Profile picture png format supported

This commit is contained in:
dignajar 2015-11-20 01:00:52 -03:00
parent 434f4acdc2
commit eed44ff34a
1 changed files with 10 additions and 6 deletions

View File

@ -33,16 +33,20 @@ if(empty($tmpName)) {
} }
// --- PROFILE PICTURE --- // --- PROFILE PICTURE ---
if($type=='profilePicture') { if($type=='profilePicture')
$username = Sanitize::html($_POST['username']); {
$tmpName = $username.'.jpg'; // Move to tmp file
move_uploaded_file($source, PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension);
move_uploaded_file($source, PATH_UPLOADS_PROFILES.$tmpName);
// Resize and crop profile image. // Resize and crop profile image.
$username = Sanitize::html($_POST['username']);
$tmpName = $username.'.jpg';
$Image = new Image(); $Image = new Image();
$Image->setImage(PATH_UPLOADS_PROFILES.$tmpName, '200', '200', 'crop'); $Image->setImage(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension, '200', '200', 'crop');
$Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, true); $Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, true);
// Remove tmp file
unlink(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension);
} }
// --- OTHERS --- // --- OTHERS ---
else { else {