diff options
author | louis <louis.braun@gmx.de> | 2013-09-13 16:38:04 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-09-13 16:38:04 +0200 |
commit | 24262eefa031a9d5ef243205719e8edc45d66ea4 (patch) | |
tree | 3164828d7afbfece68422afbfbe9205cc9051a83 /logoconverter/make_background.sh | |
parent | dcfc3b7083fed403555e0d33907f86699026cd45 (diff) | |
download | skin-nopacity-24262eefa031a9d5ef243205719e8edc45d66ea4.tar.gz skin-nopacity-24262eefa031a9d5ef243205719e8edc45d66ea4.tar.bz2 |
changed channel logo handling and added logo converter script with some backgrounds
Diffstat (limited to 'logoconverter/make_background.sh')
-rw-r--r-- | logoconverter/make_background.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/logoconverter/make_background.sh b/logoconverter/make_background.sh new file mode 100644 index 0000000..a2acbcb --- /dev/null +++ b/logoconverter/make_background.sh @@ -0,0 +1,33 @@ +#!/bin/bash -e +#set -x + +#CONFIG + +SOURCEDIR=/etc/vdr/plugins/skinnopacity/logos +OUTPUTDIR=/etc/vdr/plugins/skinnopacity/logos_darkred +FOREGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/fg4.png +BACKGROUND=/usr/local/src/VDR/PLUGINS/src/skinnopacity/logoconverter/backgrounds/bg2.png + +#MAIN +IFS=$'\n' +FILES=$(find $SOURCEDIR -name *.png | sort) +sedstring="s!$SOURCEDIR!$OUTPUTDIR!g" + +[ ! -d $SOURCEDIR ] && (echo "ERR: $SOURCEDIR1 not found"; exit 1); +[ ! -f $FOREGROUND ] && (echo "ERR: $FOREGROUND not found"; exit 1); +[ ! -f $BACKGROUND ] && (echo "ERR: $BACKGROUND not found"; exit 1); + +echo "Convert new logos to format $(basename $OUTPUTDIR)" +for file in $FILES; do + targetdir=`dirname $file | sed -e $sedstring` + targetfile="$targetdir/$(basename $file)" + if [ ! -f $targetfile ] ; then + echo $targetfile + [ ! -d $targetdir ] && mkdir -p $targetdir + convert +dither -background 'transparent' -resize '220x164' -extent '268x200' -gravity 'center' "$file" png:- 2> /dev/null | \ + composite - $BACKGROUND png:- 2> /dev/null | \ + composite -compose screen -blend 50x100 $FOREGROUND - "$targetfile" 2> /dev/null + fi +done + +exit 0 |