commit d36b15b9eae11aa35bd114928ecafc959fde0a25 Author: kj Date: Mon Jul 15 13:44:29 2019 -0400 Initial commit. diff --git a/index.html b/index.html new file mode 100644 index 0000000..3ea7f9c --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + + + + + Eliminar datos Exif de imágenes + + + +
+
+

Elije una o varias imágenes:

+
+ (Advertencia: Sólo funciona con imágenes JPG, JPEG y PNG.) +

+
+

Descargar Resultados:

+
+
+ + + + diff --git a/script.js b/script.js new file mode 100644 index 0000000..1973ce9 --- /dev/null +++ b/script.js @@ -0,0 +1,37 @@ +const input = document.getElementById('imgI') +const dlarea = document.getElementById('dlarea') +input.addEventListener('change', load) +var files +function load(){ + files = this.files; + for(var i= 0; files.length > i ; i++){ + process(files[i]) + } +} + +function process(file){ + if(!file.type.match('image.*')){ + return alert('Solo funciona con imágenes') + } + var fr = new FileReader() + fr.readAsDataURL(file) + fr.onload = (e)=>{ + if( e.target.readyState == FileReader.DONE) { + var img = new Image() + var cv = document.createElement('canvas') + var ctx = cv.getContext('2d') + img.src = e.target.result + img.onload = ()=>{ + cv.width = img.width + cv.height = img.height + ctx.drawImage(img, 0, 0) + var url = cv.toDataURL(file.type) + var a = document.createElement('a') + a.href = url + a.innerHTML = file.name + a.download = file.name + dlarea.appendChild(a) + } + } + } +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..728349d --- /dev/null +++ b/style.css @@ -0,0 +1,40 @@ +body{ + background: #f8f8f8 +} + +.container{ + text-align: center; + margin-top: 5vh; + color: #fff; +} + +.footer{ + font-size: 10px; + position: absolute; + bottom: 10px; + right: 10px; +} + +#dlarea a { + display: block; + color: #fff; + padding: 5px; + text-decoration: none; + border: 1px solid; +} + +#input-area, #dlarea { + display: inline-block; + border-radius: 5px; + padding: 15px; + margin: 5px; + box-shadow: 0px 0px 5px black; +} + +#input-area{ + background: cornflowerblue; +} + +#dlarea{ + background: #4caf50; +}