1
0
Fork 0
mirror of https://github.com/Findus23/IM-Arbeitsauftrag.git synced 2024-08-27 19:52:14 +02:00
IM-Arbeitsauftrag/script.sh
2014-12-23 20:18:23 +01:00

50 lines
1.5 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ ! -d done ]
then
mkdir ./done
echo "Neuen Ordner erstellt"
else
rm ./done/*
echo "alte Dateien gelöscht"
fi
format=$(zenity --entry --text "Welches Dateiformat soll ausgegeben werden?" --title "Dateiformat") || exit 1
if [ -z $format ]
then
format="png"
fi
name=$(zenity --entry --text "Welchen Namen sollen die Dateien haben?" --title "Dateiname") || exit 1
if [ -z $name ]
then
name="2008­-Sanierung­-"
fi
convert -monitor -resize 100x Logo-ohne-BRG-klein.png ./done/logo.png
a=1
exec 3> >(zenity --progress --title="Konvertierung..." --percentage=0 --width=400)
echo "# Ermittle Dateien..." >&3
dateien=(*.JPG)
dateianzahl=${#dateien[@]}
for i in ${dateien[@]}
do
echo "# Datei '$i' wird konvertiert... ($a von $dateianzahl)" >&3;
a_f="$(printf "%02d" $a)" # Darstellung mit führender Null
convert -monitor -caption '%f' -resize 640x $i \
-gravity SouthEast ./done/logo.png -geometry +15+15 \
-composite \
-bordercolor snow -background black \
-gravity center -font 'Liberation Sans' -pointsize 26 \
+polaroid \
./done/$name­$a_f.$format
echo "$a/$dateianzahl*100" | bc -l >&3
((a++))
done
echo "# Thumbnails werden erstellt..." >&3
montage -monitor -label '%f\n%wx%h' -geometry '300x+5+5' ./done/$name*.$format -caption '%f\n%wx%h' -font 'Liberation Sans' -pointsize 20 -background transparent -frame 5 ./done/Thumbnails.$format
echo "# Das Programm ist fertig." >&3
notify-send --app-name=imagemagick --icon=imagemagick -t 5000 Imagemagick "Konvertierung abgeschlossen" #im Paket libnotify-bin
rm ./done/logo.png