Commit 46dc8baf authored by Okthane's avatar Okthane

on_depasse

parent d932ee42
......@@ -5,7 +5,7 @@
define('WHERE_TO_PUT','img_bg');
define('PATH_TO_BG', "img_bg");
define('TEMP','temp');
define('KEY','qtU9bhJqBxu4aYUsjJYJMWXC');
define('KEY','n6CkFXudANRCubRKMKG5hjNa');
require_once "vendor/autoload.php";
......@@ -44,11 +44,11 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
// $deletefile=unlink(TEMP.'/'.$newfilename);
//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());
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);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
......
......@@ -232,7 +232,7 @@ async function photoDetourage(formData){
console.log(data);
//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