Profile picture png format supported
This commit is contained in:
parent
434f4acdc2
commit
eed44ff34a
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue