Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet ISIS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MARQUE Pierre
Projet ISIS
Commits
ab940e0c
Commit
ab940e0c
authored
Mar 14, 2022
by
Okthane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Le détourage ne fonctionne qu'avec une image en ligne
parent
3afe14f4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
39 deletions
+43
-39
certif.cer
certif.cer
+0
-21
no-bg.png
no-bg.png
+1
-0
removeBackground.php
removeBackground.php
+30
-18
rmbg2.php
rmbg2.php
+12
-0
No files found.
certif.cer
deleted
100644 → 0
View file @
3afe14f4
-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----
no-bg.png
0 → 100644
View file @
ab940e0c
{"errors":[{"title":"No image given","code":"missing_source","detail":"Please provide the source image in the image_url, image_file or image_file_b64 parameter."}]}
\ No newline at end of file
removeBackground.php
View file @
ab940e0c
<?php
<?php
// phpinfo();die;
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
// if($_SERVER["REQUEST_METHOD"] == "POST")
// if($_SERVER["REQUEST_METHOD"] == "POST")
// {
// {
...
@@ -11,34 +12,45 @@
...
@@ -11,34 +12,45 @@
// $ext = pathinfo($filename, PATHINFO_EXTENSION);
// $ext = pathinfo($filename, PATHINFO_EXTENSION);
// if(array_key_exists($ext, $allowed))
// if(array_key_exists($ext, $allowed))
// {
// {
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
$curl
=
curl_init
(
'https://api.remove.bg/v1.0/removebg'
);
// curl_setopt($ch, CURLOPT_CAINFO,__DIR__ . DIRECTORY_SEPARATOR . 'certif.cer');
// curl_setopt($ch, CURLOPT_CAPATH,__DIR__ . DIRECTORY_SEPARATOR);
// curl_setopt($curl, CURLOPT_URL, 'https://api.remove.bg/v1.0/removebg');
curl_setopt
(
$ch
,
CURLOPT_URL
,
'https://api.remove.bg/v1.0/removebg'
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYHOST
,
false
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
// curl_setopt($curl, CURLOPT_CAINFO,__DIR__ . DIRECTORY_SEPARATOR . 'certif.cer');
// curl_setopt($curl, CURLOPT_CAPATH,__DIR__ . DIRECTORY_SEPARATOR);
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
curl_setopt
(
$curl
,
CURLOPT_POST
,
true
);
$post
=
array
(
$post
=
array
(
// 'image_file' => '@' .realpath('/img'.$_FILES["photo"]["name"]),
// 'image_file' => '@' .realpath('/img'.$_FILES["photo"]["name"]),
'image_file'
=>
'@'
.
realpath
(
'/img/'
.
'pierremarque.jpg'
)
,
// 'image_url' => 'https://img.buzzfeed.com/buzzfeed-static/static/2019-04/18/5/asset/buzzfeed-prod-web-05/sub-buzz-18749-1555581339-1.jpg',
'image_file'
=>
'img'
.
'/pierremarque.jpg'
,
'size'
=>
'auto'
,
'size'
=>
'auto'
,
'format'
=>
'JPG'
);
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$post
);
// $post = http_build_query($post);
echo
$post
[
'image_file'
];
echo
'<br></br>'
;
curl_setopt
(
$curl
,
CURLOPT_POSTFIELDS
,
$post
);
$headers
=
array
();
$headers
=
array
();
// $headers[] = 'Content-type: plain/text';
$headers
[]
=
'X-Api-Key:qYXf5PimffLjeH1i5B1rySQw'
;
$headers
[]
=
'X-Api-Key:qYXf5PimffLjeH1i5B1rySQw'
;
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$headers
);
// echo $headers[0]." ".$headers[1];echo'<br></br>';
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
$headers
);
$result
=
curl_exec
(
$ch
);
$result
=
curl_exec
(
$curl
);
if
(
curl_errno
(
$ch
))
{
echo
$result
;
echo
'Error:'
.
curl_error
(
$ch
);
if
(
curl_errno
(
$curl
))
{
echo
'Error:'
.
curl_error
(
$curl
);
}
}
curl_close
(
$c
h
);
curl_close
(
$c
url
);
// $fp = fopen($_FILES["photo"]["name"]."no-bg.png", "wb");
// $fp = fopen($_FILES["photo"]["name"]."no-bg.png", "wb");
//
$fp = fopen("no-bg.png", "wb");
$fp
=
fopen
(
"no-bg.png"
,
"wb"
);
//
fwrite($fp, $result);
fwrite
(
$fp
,
$result
);
//
fclose($fp);
fclose
(
$fp
);
// }
// }
// }
// }
// }
// }
...
...
rmbg2.php
0 → 100644
View file @
ab940e0c
<?php
// $curl = curl_init('http://api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=efa3ab7641e003e1076a68002b0880a4');
// curl_setopt($curl, CURLOPT_CAINFO,__DIR__ . DIRECTORY_SEPARATOR . 'certif.cer');
// curl_setopt($curl, CURLOPT_CAPATH,__DIR__ . DIRECTORY_SEPARATOR);
// $data = curl_exec($curl);
// if ($data === false || curl_errno($curl))
// {
// var_dump(curl_error($curl));
// }
// curl_close($curl);
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment