Subida Inicial

This commit is contained in:
luisgulo 2024-06-07 11:28:29 +02:00
commit 580a2140dc
9 changed files with 62 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
DNI_v3-anverso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
DNI_v3-reverso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 KiB

BIN
DNI_v4-anverso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 KiB

BIN
DNI_v4-reverso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 KiB

14
README.md Normal file
View file

@ -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
```

BIN
dni-3-0-vs-dni-4-0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

48
protege-dni.sh Executable file
View file

@ -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