diff --git a/photo_mem.html b/photo_mem.html index de70330..3cf0697 100644 --- a/photo_mem.html +++ b/photo_mem.html @@ -15,11 +15,8 @@ Licence AGPL v3.0+ - - - - +
@@ -31,25 +28,23 @@ Licence AGPL v3.0+

- - - - - + + + + + +
-
-
+
@@ -62,13 +57,14 @@ Licence AGPL v3.0+ NOUVELLE PERSONNE
- +
- +
- +
@@ -81,17 +77,13 @@ Licence AGPL v3.0+
- - - -
-
@@ -101,21 +93,30 @@ Licence AGPL v3.0+ - + +
+
+

Info

+
+
+ Sélectionnez une nouvelle photo pour la marquer. Vous pouvez aussi importer une photo et son fichier xml d'information en même temps.
+
+
+ + diff --git a/scripts/detection_opencv.js b/scripts/detection_opencv.js index c7e7f2c..9302b95 100644 --- a/scripts/detection_opencv.js +++ b/scripts/detection_opencv.js @@ -5,7 +5,7 @@ function onOpenCvReady() { console.info('OpenCV.js est chargé !'); document.getElementById('status').remove() - gestion_souris(); + } function detection_de_visages() { diff --git a/scripts/main.js b/scripts/main.js index 56b5fc5..4509d65 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -22,6 +22,10 @@ inputElement.addEventListener('change', (e) => { lecture_photo(e.target.files) }, false); +function init(){ + console.log("lancement de l'initialisation"); + gestion_souris(); +} function lecture_photo(fichier) { nb_fichier = fichier.length let i_xml = 1, i_img = 0; @@ -130,7 +134,7 @@ function affiche_etiquette() { let canv = document.createElement("canvas"); canv.id = id; canv.setAttribute('class', 'people_label') - document.body.appendChild(canv); + document.querySelector('#main').appendChild(canv); can_etiq[i] = document.getElementById(canv.id); can_etiq[i].className = "etiq"; can_etiq[i].height = 30; @@ -206,6 +210,7 @@ function supprimer_personne() { } cercle.style.visibility = "hidden"; lecture_xml(); + menu.style.visibility='hidden'; } function creation_data_xml() { @@ -401,9 +406,9 @@ function enregistrer_fichier(fichier) { a.setAttribute('download', fichier); a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(texte_xml)); a.style.display = 'none'; - document.body.appendChild(a); + document.querySelector('#main').appendChild(a); a.click(); - document.body.removeChild(a); + document.querySelector('#main').removeChild(a); } } @@ -423,7 +428,7 @@ function image_finale() { let decalx = 5 + image.offsetLeft; let decaly = 29 + image.offsetTop; let can_imf = document.createElement("canvas"); - document.body.appendChild(can_imf); + document.querySelector('#main').appendChild(can_imf); imf_ctx = can_imf.getContext("2d"); can_imf.width = ima_fond.width; can_imf.height = ima_fond.height; @@ -449,10 +454,10 @@ function image_finale() { a.setAttribute('download', enreg_noms); a.setAttribute('href', can_imf.toDataURL("image/png").replace("image/png", "image/octet-stream")); a.style.display = 'none'; - document.body.appendChild(a); + document.querySelector('#main').appendChild(a); a.click(); - document.body.removeChild(a); - document.body.removeChild(can_imf); + document.querySelector('#main').removeChild(a); + document.querySelector('#main').removeChild(can_imf); function roundedRect(ctx, x, y, width, height, radius, couleur_fond, couleur_trait) { ctx.beginPath();