commit 580a2140dca30f4ca97e56aefb8661a837bf9675 Author: luisgulo Date: Fri Jun 7 11:28:29 2024 +0200 Subida Inicial diff --git a/DNI_v3-anverso-protegido.jpg b/DNI_v3-anverso-protegido.jpg new file mode 100644 index 0000000..0a0b683 Binary files /dev/null and b/DNI_v3-anverso-protegido.jpg differ diff --git a/DNI_v3-anverso.png b/DNI_v3-anverso.png new file mode 100644 index 0000000..2663540 Binary files /dev/null and b/DNI_v3-anverso.png differ diff --git a/DNI_v3-reverso-protegido.jpg b/DNI_v3-reverso-protegido.jpg new file mode 100644 index 0000000..0a13d5d Binary files /dev/null and b/DNI_v3-reverso-protegido.jpg differ diff --git a/DNI_v3-reverso.png b/DNI_v3-reverso.png new file mode 100644 index 0000000..5f8c1cb Binary files /dev/null and b/DNI_v3-reverso.png differ diff --git a/DNI_v4-anverso.png b/DNI_v4-anverso.png new file mode 100644 index 0000000..0750efa Binary files /dev/null and b/DNI_v4-anverso.png differ diff --git a/DNI_v4-reverso.png b/DNI_v4-reverso.png new file mode 100644 index 0000000..3b5587f Binary files /dev/null and b/DNI_v4-reverso.png differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d4640f --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Proteger DNI para envĂ­o + +## Paquetes necesarios + +Instalar `convert` y `zenity` + +``` +sudo apt update +sudo apt -y upgrade + +sudo apt -y install imagemagick zenity +``` + + diff --git a/dni-3-0-vs-dni-4-0.jpg b/dni-3-0-vs-dni-4-0.jpg new file mode 100644 index 0000000..600c841 Binary files /dev/null and b/dni-3-0-vs-dni-4-0.jpg differ diff --git a/protege-dni.sh b/protege-dni.sh new file mode 100755 index 0000000..778d3b8 --- /dev/null +++ b/protege-dni.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Tamano oficial DNI (3.0 y 4.0) es 85,60x53,98 mm + +# Ficheros Origen +#ANVERSO="DNI_v4-anverso.png" +#REVERSO="DNI_v4-reverso.png" +ANVERSO=$(zenity --file-selection) +REVERSO=$(zenity --file-selection) + +# Ficheros temporales (escalado) +AnvTMP="${ANVERSO%.*}-tmp.jpg" +RevTMP="${REVERSO%.*}-tmp.jpg" + +# Ficheros Salida +AnvIMG="${ANVERSO%.*}-protegido.jpg" +RevIMG="${REVERSO%.*}-protegido.jpg" + +# Anverso Zona de Bloques de ocultacion +CAN='800,370,1000,605' +SOPORTE='400,440,570,485' +# Reverso Zona de Bloques de ocultacion +EQUIPO='5,177,100,355' +PADRES='280,317,620,376' +IDE='50,430,980,520' +TEXTO='SOLO PARA USO INTERNO DE ABCDEFGHIJKL' + +# Temporales Escalados +echo "Preparando Imagenes temporales (escaladas).." +convert $ANVERSO -resize 1011x638 -units PixelsPerInch -density 150 $AnvTMP 2>/dev/null +convert $REVERSO -resize 1011x638 -units PixelsPerInch -density 150 $RevTMP 2>/dev/null + +echo "Ocultando, fijando texto y escala gris en ANVERSO" +convert $AnvTMP -fill gray -draw "rectangle $CAN" -fill gray -draw "rectangle $SOPORTE" -font helvetica -fill black -pointsize 30 -gravity center -annotate 0 "$TEXTO" -grayscale average -units PixelsPerInch -density 150 $AnvIMG + +echo "Ocultando, fijando texto y escala gris en REVERSO" +convert $RevTMP -fill gray -draw "rectangle $EQUIPO" -fill gray -draw "rectangle $PADRES" -fill gray -draw "rectangle $IDE" -font helvetica -fill black -pointsize 30 -gravity center -annotate 0 "$TEXTO" -grayscale average -units PixelsPerInch -density 150 $RevIMG + +echo "Limpiando temporales..." +rm $AnvTMP $RevTMP + +echo +echo "-----------------------------------------------" +echo "Imagenes de DNI Listas y protegidas para envio" +echo " Anverso: $AnvIMG" +echo " Reverso: $RevIMG" +echo "-----------------------------------------------" +echo +