Commit 0dfd5937 authored by Okthane's avatar Okthane

arf

parent 2ff8ce08
img_bg/pierremarqueNO-BG.png

152 KB | W: | H:

img_bg/pierremarqueNO-BG.png

192 KB | W: | H:

img_bg/pierremarqueNO-BG.png
img_bg/pierremarqueNO-BG.png
img_bg/pierremarqueNO-BG.png
img_bg/pierremarqueNO-BG.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<!-- <button onclick="defaultBtnActive()" class="btn-form" id="custom-fileUpload">Choisissez une photo</button> --> <!-- <button onclick="defaultBtnActive()" class="btn-form" id="custom-fileUpload">Choisissez une photo</button> -->
</div> </div>
<div class="div-btn-form"> <div class="div-btn-form">
<input id="btnSubmit" type="submit" name="submit" value="Upload" class="btn-form"> <input id="btnSubmit" type="submit" name="submit" value="Vérifier" class="btn-form">
</div> </div>
</form> </form>
<script> <script>
......
...@@ -21,7 +21,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST") ...@@ -21,7 +21,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
$ext = pathinfo($filename, PATHINFO_EXTENSION); $ext = pathinfo($filename, PATHINFO_EXTENSION);
if(array_key_exists($ext, $allowed)) if(array_key_exists($ext, $allowed))
{ {
$client = new GuzzleHttp\Client(['verify' => false]); $client = new GuzzleHttp\Client(["verify"=>false]);
$res = $client->post('https://api.remove.bg/v1.0/removebg', [ $res = $client->post('https://api.remove.bg/v1.0/removebg', [
'multipart' => [ 'multipart' => [
[ [
...@@ -34,7 +34,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST") ...@@ -34,7 +34,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
] ]
], ],
'headers' => [ 'headers' => [
'X-Api-Key' => 'qYXf5PimffLjeH1i5B1rySQw' 'X-Api-Key' => 'LeteoyV7qPyWtAJF9Rcxenda'
] ]
]); ]);
......
...@@ -55,6 +55,10 @@ $(document).ready(function(){ ...@@ -55,6 +55,10 @@ $(document).ready(function(){
contentType: false, contentType: false,
processData: false processData: false
}) })
.fail(function(error){
Console.empty();
alert("La requête s'est terminée en échec. Infos : " + JSON.stringify(error));
})
.done(function(data){ .done(function(data){
console.log(data); console.log(data);
src = data['src']; src = data['src'];
...@@ -65,12 +69,6 @@ $(document).ready(function(){ ...@@ -65,12 +69,6 @@ $(document).ready(function(){
format_correct = true; format_correct = true;
//Affichage de la photo //Affichage de la photo
// findFaces(); // findFaces();
})
.fail(function(error){
Console.empty();
alert("La requête s'est terminée en échec. Infos : " + JSON.stringify(error));
})
if(!errorFormat){ if(!errorFormat){
$.ajax({ $.ajax({
//url de la requête //url de la requête
...@@ -92,6 +90,7 @@ $(document).ready(function(){ ...@@ -92,6 +90,7 @@ $(document).ready(function(){
$("#img-ID2").attr('src',data['src']); $("#img-ID2").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