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
179ce411
Commit
179ce411
authored
May 02, 2022
by
Okthane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit Final Partie Code
parent
39631691
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
124 deletions
+116
-124
byebye.html
byebye.html
+1
-1
index.php
index.php
+8
-7
removeBackground2.php
removeBackground2.php
+3
-3
script.js
script.js
+98
-105
upload.php
upload.php
+4
-6
web_server.php
web_server.php
+2
-2
No files found.
byebye.html
View file @
179ce411
...
...
@@ -8,6 +8,6 @@
<title>
Merci pour votre participation
</title>
</head>
<body>
<img
src=
"img/.jpg"
height=
"400px"
>
<img
src=
"img/.jpg"
height=
"400px"
>
</body>
</html>
\ No newline at end of file
index.php
View file @
179ce411
...
...
@@ -16,7 +16,7 @@
<script
src=
"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface"
></script>
<script
src=
"jquery.js"
></script>
<script
src=
"script.js"
></script>
<title>
Formulaire d'upload de fichiers
</title>
<!-- API TenserFlow -->
</head>
...
...
@@ -64,9 +64,9 @@
</div>
<div
id=
conditions
class=
"col-md-3 my-5 d-flex justify-content-center"
>
<ul
class=
"list-group"
>
<li
id=
"li-oneface"
class=
"list-group-item list-group-item-secondary"
>
Un seul visage
<span></span></li>
<li
id=
"li-format"
class=
"list-group-item list-group-item-secondary"
>
Format (jpg/png)
<span></span></li>
<li
id=
"li-taille"
class=
"list-group-item list-group-item-secondary"
>
Poids (
<
1
Mo
)
<
span
></span></li>
<li
id=
"li-oneface"
class=
"list-group-item list-group-item-secondary"
>
Un seul visage
<span></span></li>
<li
id=
"li-format"
class=
"list-group-item list-group-item-secondary"
>
Format (jpg/png)
<span></span></li>
<li
id=
"li-taille"
class=
"list-group-item list-group-item-secondary"
>
Poids (
<
1
Mo
)
<
span
></span></li>
</ul>
</div>
<div
class=
"col-md-3 my-auto d-flex justify-content-center"
>
...
...
@@ -77,7 +77,7 @@
<div
class =
"row d-flex justify-content-center"
>
<div
class=
"div-form"
>
<form
id =
"form"
action=
""
method=
"
"
enctype=
"multipart/form-data"
>
<form
id =
"form"
action=
""
method=
"POST
"
enctype=
"multipart/form-data"
>
<!-- <label for="fileUpload">Fichier:</label> -->
<div
class=
"div-btn-form"
>
<input
type=
"file"
name=
"photo"
id=
"fileUpload"
required=
"required"
class=
"btn-form"
accept=
"image/png, image/jpeg"
>
...
...
@@ -92,7 +92,7 @@
const
inpFile
=
document
.
getElementById
(
"fileUpload"
);
const
previewImage
=
document
.
getElementById
(
"img-ID"
);
const
file
=
inpFile
.
files
[
0
];
console
.
log
(
"ok"
);
console
.
log
(
file
);
if
(
file
){
const
reader
=
new
FileReader
();
console
.
log
(
"ok"
);
...
...
@@ -105,7 +105,7 @@
}
inpFile
.
addEventListener
(
"change"
,
function
(){
const
file
=
inpFile
.
files
[
0
];
console
.
log
(
"ok"
);
console
.
log
(
file
);
if
(
file
){
const
reader
=
new
FileReader
();
console
.
log
(
"ok"
);
...
...
@@ -125,6 +125,7 @@
// defaultBtn.click();
// }
</script>
<script
src=
"script.js"
></script>
</div>
</div>
...
...
removeBackground2.php
View file @
179ce411
<?php
// phpinfo();
define
(
'PATH'
,
"img_bg"
);
define
(
'KEY'
,
'n6CkFXudANRCubRKMKG5hjNa'
);
define
(
'PATH'
,
'img_bg'
);
define
(
'KEY'
,
'n6CkFXudANRCubRKMKG5hjNa'
);
require_once
"vendor/autoload.php"
;
...
...
@@ -21,7 +21,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
$ext
=
pathinfo
(
$filename
,
PATHINFO_EXTENSION
);
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'
,
[
'multipart'
=>
[
[
...
...
script.js
View file @
179ce411
This diff is collapsed.
Click to expand it.
upload.php
View file @
179ce411
<?php
//dossier temporaitre pour les images
define
(
'PATH_TO_TEMP'
,
"temp"
);
define
(
'PATH_TO_TEMP'
,
"temp"
);
// Vérifier si le formulaire a été soumis
if
(
$_SERVER
[
"REQUEST_METHOD"
]
==
"POST"
)
{
// Vérifie si le fichier a été uploadé sans erreur.
//format de la réponse
// Format de la réponse
if
(
isset
(
$_FILES
[
"photo"
])
&&
$_FILES
[
"photo"
][
"error"
]
==
0
)
{
$allowed
=
array
(
"jpg"
=>
"image/jpeg"
,
"jpeg"
=>
"image/jpeg"
,
"jpeg"
=>
"image/jpeg"
,
"png"
=>
"image/png"
,
"PNG"
=>
"image/PNG"
,
"JPG"
=>
"image/JPG"
...
...
@@ -44,7 +42,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST")
}
}
$error
=
$errorMIME
||
$errorSize
;
$data
=
array
(
$data
=
array
(
"errorMIME"
=>
$errorMIME
,
"errorSize"
=>
$errorSize
,
...
...
web_server.php
View file @
179ce411
...
...
@@ -7,8 +7,8 @@ if($_SERVER["REQUEST_METHOD"]=="POST"){
"prenom"
=>
"jean-patrick"
,
"nom"
=>
"doe.remifa.sollasi"
,
"mailCalcule"
=>
"patrick.doe.remifa.sollasi@ext.imt-nord-europe.fr"
,
//
"mailsPossibles" => array()
"mailsPossibles"
=>
array
(
"jean-patrick.doe@ext.imt-nord-europe.fr"
,
"jean.doe@ext.imt-nord-europe.fr"
,
"patrick.doe@ext.imt-nord-europe.fr"
,
"jean.remifa.sollasi@ext.imt-nord-europe.fr"
,
"jp.doeremifasollasi@ext.imt-nord-europe.fr"
)
"mailsPossibles"
=>
array
()
//
"mailsPossibles"=>array("jean-patrick.doe@ext.imt-nord-europe.fr","jean.doe@ext.imt-nord-europe.fr","patrick.doe@ext.imt-nord-europe.fr","jean.remifa.sollasi@ext.imt-nord-europe.fr","jp.doeremifasollasi@ext.imt-nord-europe.fr")
);
echo
json_encode
(
$data
);
...
...
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