diff --git a/html/compte.php b/html/compte.php index f25f820b..bfd78f2f 100644 --- a/html/compte.php +++ b/html/compte.php @@ -59,6 +59,8 @@ if (isset($_FILES['profile_picture']) && $_FILES['profile_picture']['error'] == $imageResized = imagecreatetruecolor($newWidth, $newHeight); $imageOriginal = imagecreatefromstring(file_get_contents($tempPath)); imagecopyresampled($imageResized, $imageOriginal, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); + imagealphablending($imageResized, false); + imagesavealpha($imageResized, true); // Enregistrement de l'image redimensionnée imagepng($imageResized, $rootPath); @@ -90,6 +92,8 @@ if (isset($_FILES['banner']) && $_FILES['banner']['error'] == 0) { $newWidth = 600; $newHeight = ($height / $width) * $newWidth; $imageResized = imagecreatetruecolor($newWidth, $newHeight); + imagealphablending($imageResized, false); + imagesavealpha($imageResized, true); $imageOriginal = imagecreatefromstring(file_get_contents($tempPath)); imagecopyresampled($imageResized, $imageOriginal, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);