diff --git a/.env b/.env index 759b611..312e8f9 100644 --- a/.env +++ b/.env @@ -6,4 +6,5 @@ DB_DATABASE=projet_folliow DB_USERNAME= DB_PASSWORD= -IMG_PATH= uploads/projects/ \ No newline at end of file +IMG_PROJECT_PATH = uploads/projects/ +IMG_USER_PATH = uploads/profiles/ \ No newline at end of file diff --git a/controllers/project_controller.php b/controllers/project_controller.php index a354734..7f9033c 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -175,7 +175,7 @@ // Redimensionnement de l'image if (isset($strImageName)){ - $strDest = $_ENV['IMG_PATH'].$strImageName; + $strDest = $_ENV['IMG_PROJECT_PATH'].$strImageName; $strSource = $_FILES['thumbnail']['tmp_name']; list($intWidth, $intHeight) = getimagesize($strSource); @@ -213,6 +213,7 @@ // Sauvegarde du fichier $boolImageOk = imagewebp($objDest, $strDest); + imagedestroy($objDest); imagedestroy($objSource); } @@ -229,7 +230,7 @@ if ($boolOk){ // Suppression de l'ancienne image if(isset($strOldImg) && !empty($strOldImg) && isset($strImageName)){ - $strOldFile = $_ENV['IMG_PATH'].$strOldImg; + $strOldFile = $_ENV['IMG_PROJECT_PATH'].$strOldImg; if (file_exists($strOldFile)) unlink($strOldFile); } diff --git a/uploads/projects/699ca2c207e75.webp b/uploads/projects/699ca2c207e75.webp new file mode 100644 index 0000000..4f5030e Binary files /dev/null and b/uploads/projects/699ca2c207e75.webp differ diff --git a/uploads/projects/699ca2cf9f010.webp b/uploads/projects/699ca2cf9f010.webp new file mode 100644 index 0000000..4f5030e Binary files /dev/null and b/uploads/projects/699ca2cf9f010.webp differ diff --git a/uploads/projects/699ca324b5dbc.webp b/uploads/projects/699ca324b5dbc.webp new file mode 100644 index 0000000..4f5030e Binary files /dev/null and b/uploads/projects/699ca324b5dbc.webp differ diff --git a/views/project_display.tpl b/views/project_display.tpl index 1fe6866..046b5c3 100644 --- a/views/project_display.tpl +++ b/views/project_display.tpl @@ -22,7 +22,7 @@

-
@@ -59,7 +59,7 @@
-