Update file compte.php
This commit is contained in:
parent
6f6b5df137
commit
a5f02d7c3e
@ -56,6 +56,9 @@ if (isset($_FILES['profile_picture']) && $_FILES['profile_picture']['error'] ==
|
|||||||
// Redimensionnement de l'image
|
// Redimensionnement de l'image
|
||||||
list($width, $height) = getimagesize($tempPath);
|
list($width, $height) = getimagesize($tempPath);
|
||||||
|
|
||||||
|
$imageInfo = getimagesize($tempPath);
|
||||||
|
|
||||||
|
if ($imageInfo[2] === IMAGETYPE_PNG || $imageInfo[2] === IMAGETYPE_JPEG) {
|
||||||
$newWidth = 128;
|
$newWidth = 128;
|
||||||
$newHeight = 128;
|
$newHeight = 128;
|
||||||
$imageResized = imagecreatetruecolor($newWidth, $newHeight);
|
$imageResized = imagecreatetruecolor($newWidth, $newHeight);
|
||||||
@ -80,6 +83,9 @@ if (isset($_FILES['profile_picture']) && $_FILES['profile_picture']['error'] ==
|
|||||||
} else {
|
} else {
|
||||||
$status = "Erreur SQL";
|
$status = "Erreur SQL";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$status = "Le fichier doit être au format PNG ou JPG";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) {
|
if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) {
|
||||||
@ -91,6 +97,9 @@ if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) {
|
|||||||
|
|
||||||
// Redimensionnement de l'image
|
// Redimensionnement de l'image
|
||||||
list($width, $height) = getimagesize($tempPath);
|
list($width, $height) = getimagesize($tempPath);
|
||||||
|
$imageInfo = getimagesize($tempPath);
|
||||||
|
|
||||||
|
if ($imageInfo[2] === IMAGETYPE_PNG || $imageInfo[2] === IMAGETYPE_JPEG) {
|
||||||
$newWidth = 800;
|
$newWidth = 800;
|
||||||
$newHeight = ($height / $width) * $newWidth;
|
$newHeight = ($height / $width) * $newWidth;
|
||||||
$imageResized = imagecreatetruecolor($newWidth, $newHeight);
|
$imageResized = imagecreatetruecolor($newWidth, $newHeight);
|
||||||
@ -115,6 +124,9 @@ if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) {
|
|||||||
} else {
|
} else {
|
||||||
$status = "Erreur SQL";
|
$status = "Erreur SQL";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$status = "Le fichier doit être un PNG ou JPG"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user