recursive converting
Posted: 2011-03-17T12:55:36-07:00
Hello, Greetings
I have a small question and I think this forum is the right place.
On page ubuntu life and GPL licenced there is a script that generates imagemagick DVD cover from a *. jpg.
I modifiec a little to work with CD cover and the script works fine, but I like to modify it to operate in 1 sub-directory. I mean: select a directory and generate the images in the sub-folders.
Attached the script here:
greetings and thanks.
I have a small question and I think this forum is the right place.
On page ubuntu life and GPL licenced there is a script that generates imagemagick DVD cover from a *. jpg.
I modifiec a little to work with CD cover and the script works fine, but I like to modify it to operate in 1 sub-directory. I mean: select a directory and generate the images in the sub-folders.
Attached the script here:
Code: Select all
#!/bin/bash
#===============================================================================
# Nautilus Script para crear caratulas de DVD de las imágenes seleccionadas.
# Autor: (http://ubuntulife.wordpress.com)
# Licencia: GPL
# Requiere: Zenity, Imagemagick
#===============================================================================
DIR_ACTUAL=`dirname "$0"`
# Ahora por cada fichero que hayamos seleccionado
for arg do
files=`echo "$arg" | sed 's/ /\\ /g'`
# Me quedo con el nombre y la extension del fichero actual
filename=${files%.*}
extension=${files##*.}
CARATULA=$files
# Redimensiono
convert $CARATULA -resize 458x654 .redimensionada.png
# Le añado fondo transparente
convert $DIR_ACTUAL/DVDvacio.png .redimensionada.png -geometry +75+30 -composite .redimensionada.png
# Creo la composicion de capas (mezcla)
composite -gravity center $DIR_ACTUAL/DVDcompleto.png .redimensionada.png ${filename}_dvdcover.png
# Por defecto genero siempre un Folder.png (que luego usare en estructura carpetas para asignar el icono directamente)
# cp ${filename}_dvdcover.png Folder.png
# composite -gravity center $DIR_ACTUAL/DVDcompleto.png redimensionada.png Folder.png
# Borro el temporal creado
rm .redimensionada.png
#zenity --title=CrearCaratulaDVD --info --text="${files}"
done
# Mostramos mensaje de finalizacion
notify-send --icon '/usr/share/icons/Humanity/status/48/weather-clouds.svg' "Caratulas de DVD creadas."
exit 0