Version final
BIN
DNI_v3-anverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 136 KiB |
BIN
DNI_v3-anverso-protegido.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
DNI_v3-anverso.png
Normal file
After Width: | Height: | Size: 586 KiB |
BIN
DNI_v3-reverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 129 KiB |
BIN
DNI_v3-reverso-protegido.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
DNI_v3-reverso.png
Normal file
After Width: | Height: | Size: 509 KiB |
BIN
DNI_v4-anverso-protegido.jpg
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
DNI_v4-anverso.png
Normal file
After Width: | Height: | Size: 752 KiB |
BIN
DNI_v4-reverso-protegido.jpg
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
DNI_v4-reverso.png
Normal file
After Width: | Height: | Size: 506 KiB |
BIN
DNIs-REALES/alicia-anverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
DNIs-REALES/alicia-anverso.png
Normal file
After Width: | Height: | Size: 377 KiB |
BIN
DNIs-REALES/alicia-reverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 154 KiB |
BIN
DNIs-REALES/alicia-reverso.png
Normal file
After Width: | Height: | Size: 344 KiB |
BIN
DNIs-REALES/diego-anverso.png
Normal file
After Width: | Height: | Size: 350 KiB |
BIN
DNIs-REALES/diego-reverso.png
Normal file
After Width: | Height: | Size: 353 KiB |
BIN
DNIs-REALES/luis-anverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 212 KiB |
BIN
DNIs-REALES/luis-anverso.png
Normal file
After Width: | Height: | Size: 409 KiB |
BIN
DNIs-REALES/luis-reverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 226 KiB |
BIN
DNIs-REALES/luis-reverso.png
Normal file
After Width: | Height: | Size: 410 KiB |
BIN
DNIs-REALES/pilar-anverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 209 KiB |
BIN
DNIs-REALES/pilar-anverso.png
Normal file
After Width: | Height: | Size: 411 KiB |
BIN
DNIs-REALES/pilar-reverso-MarcaAgua.jpg
Normal file
After Width: | Height: | Size: 227 KiB |
BIN
DNIs-REALES/pilar-reverso.png
Normal file
After Width: | Height: | Size: 412 KiB |
51
README.md
Normal file
@ -0,0 +1,51 @@
|
||||
# Proteger DNI para envío
|
||||
|
||||
Script Bash para enviar/compartir el DNI por medios electrónicos de forma segura.
|
||||
|
||||
* Crea bloque ocultando zonas de información.
|
||||
* Escribe texto sobre la imagen.
|
||||
* Genera resultado en "tonos grises".
|
||||
* Utiliza `convert` (parte del programa ImageMagick para transformar imagenes).
|
||||
* Usa `zenity` para pedir datos.
|
||||
|
||||

|
||||
|
||||
## Paquetes necesarios
|
||||
|
||||
Instalar `convert` y `zenity`
|
||||
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt -y upgrade
|
||||
|
||||
sudo apt -y install imagemagick zenity
|
||||
```
|
||||
|
||||
## Uso protección completa
|
||||
|
||||
Simplemente desde la consola "invoca" al script:
|
||||
|
||||
```
|
||||
./protege-dni.sh
|
||||
```
|
||||
|
||||
## Uso con 'Marca de agua'
|
||||
|
||||
Simplemente desde la consola ejecuta el script:
|
||||
|
||||
```
|
||||
./protege-dni-MarcaAgua.sh
|
||||
```
|
||||
|
||||
En ambos casos saldrá asistente para seleccionar cada cara del DNI a proteger
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
El resultado dependiendo del script usado será:
|
||||
|
||||

|
||||
|
||||

|
||||
|
BIN
cabecera-dni.png
Normal file
After Width: | Height: | Size: 546 KiB |
BIN
dni-3-0-vs-dni-4-0.jpg
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
imagenes/seleccione-anverso.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
imagenes/seleccione-reverso.png
Normal file
After Width: | Height: | Size: 11 KiB |
52
protege-dni-MarcaAgua.sh
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# Tamano oficial DNI (3.0 y 4.0) es 85,60x53,98 mm
|
||||
|
||||
# Solicitar ficheros origen del DNI (Anverso y Reverso)
|
||||
zenity --info --text="Seleccione la imagen con el ANVERSO"
|
||||
ANVERSO=$(zenity --file-selection)
|
||||
zenity --info --text="Seleccione la imagen con el REVERSO"
|
||||
REVERSO=$(zenity --file-selection)
|
||||
|
||||
# Ficheros temporales (escalado)
|
||||
AnvTMP="${ANVERSO%.*}-tmp.jpg"
|
||||
RevTMP="${REVERSO%.*}-tmp.jpg"
|
||||
|
||||
# Ficheros Salida
|
||||
AnvIMG="${ANVERSO%.*}-MarcaAgua.jpg"
|
||||
RevIMG="${REVERSO%.*}-MarcaAgua.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'
|
||||
|
||||
# Pedimos texto al usuario
|
||||
TEXTO=$(zenity --entry --text="Escriba el mensaje a poner en la imagen" --entry-text="** SOLO PARA VERIFICACION EMPRESA **")
|
||||
|
||||
# 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" -font courier -fill blue -pointsize 40 -gravity center -annotate 0 "$TEXTO" -units PixelsPerInch -density 150 "$AnvIMG"
|
||||
convert "$AnvTMP" -font courier -fill blue -pointsize 40 -density 80 -gravity center -annotate 0 "$TEXTO" -units PixelsPerInch -density 150 "$AnvIMG"
|
||||
|
||||
echo "Ocultando, fijando texto y escala gris en REVERSO"
|
||||
#convert "$RevTMP" -font courier -fill blue -pointsize 40 -gravity center -annotate 0 "$TEXTO" -units PixelsPerInch -density 150 "$RevIMG"
|
||||
convert "$RevTMP" -font courier -fill blue -pointsize 40 -density 80 -gravity center -annotate 0 "$TEXTO" -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
|
||||
|
50
protege-dni.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Tamano oficial DNI (3.0 y 4.0) es 85,60x53,98 mm
|
||||
|
||||
# Solicitar ficheros origen del DNI (Anverso y Reverso)
|
||||
zenity --info --text="Seleccione la imagen con el ANVERSO"
|
||||
ANVERSO=$(zenity --file-selection)
|
||||
zenity --info --text="Seleccione la imagen con el REVERSO"
|
||||
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'
|
||||
|
||||
# Pedimos texto al usuario
|
||||
TEXTO=$(zenity --entry --text="Escriba el mensaje a poner en la imagen" --entry-text=">> SOLO USO INTERNO Empresa <<")
|
||||
|
||||
# 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 -density 90 -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 -density 90 -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
|
||||
|