Commit 46dc8baf authored by Okthane's avatar Okthane

on_depasse

parent d932ee42
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
define('WHERE_TO_PUT','img_bg'); define('WHERE_TO_PUT','img_bg');
define('PATH_TO_BG', "img_bg"); define('PATH_TO_BG', "img_bg");
define('TEMP','temp'); define('TEMP','temp');
define('KEY','qtU9bhJqBxu4aYUsjJYJMWXC'); define('KEY','n6CkFXudANRCubRKMKG5hjNa');
require_once "vendor/autoload.php"; require_once "vendor/autoload.php";
...@@ -44,11 +44,11 @@ if($_SERVER["REQUEST_METHOD"] == "POST") ...@@ -44,11 +44,11 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
// $deletefile=unlink(TEMP.'/'.$newfilename); // $deletefile=unlink(TEMP.'/'.$newfilename);
//On crée et stocke l'image détourée //On crée et stocke l'image détourée
$fp = fopen('img_bg/'.pathinfo($newfilename, PATHINFO_FILENAME).".png", "wb"); $fp = fopen('img_bg/'.pathinfo($newfilename, PATHINFO_FILENAME)."NO-BG.png", "wb");
fwrite($fp, $res->getBody()); fwrite($fp, $res->getBody());
fclose($fp); fclose($fp);
$path = 'img_bg/'.pathinfo($filename, PATHINFO_FILENAME).".png"; $path = 'img_bg/'.pathinfo($filename, PATHINFO_FILENAME)."NO-BG.png";
$type = pathinfo($path, PATHINFO_EXTENSION); $type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path); $data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
......
...@@ -232,7 +232,7 @@ async function photoDetourage(formData){ ...@@ -232,7 +232,7 @@ async function photoDetourage(formData){
console.log(data); console.log(data);
//Affichage de la photo //Affichage de la photo
$("#img-ID2").attr('src',data['src']); ImgBG.attr('src',data['src']);
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment